/* Shared accessibility overrides. Loaded after page styles. */
:root {
  --gold: #FFED00;
  --a11y-focus-edge: #050505;
  --a11y-muted-dark: #B3B3B3;
  --a11y-muted-light: #4B5563;
  --a11y-placeholder-light: #6B7280;
  --a11y-border-dark: #707070;
  --a11y-border-light: #767676;
  --a11y-ink: #111827;
  --a11y-error-dark: #FF5A5A;
  --a11y-error-light: #C81E1E;
  --field-line: var(--a11y-border-light);
}
[hidden] { display: none !important; }
/* .sr-only is the old Tailwind name some pages still use (players table
   "Actions" header); without it that text rendered and widened the table. */
.a11y-sr, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* The dark edge makes gold focus visible on white as well as dark surfaces. */
:is(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--gold) !important; outline-offset: 2px !important;
  box-shadow: 0 0 0 5px var(--a11y-focus-edge) !important;
}
html { scroll-padding-top: 120px; }
:is(a[href], button, input, select, textarea, summary) { scroll-margin-block: 120px 24px; }
/* Visually hidden native file/radio controls show focus on their visible label. */
:is(.f-drop, .f-card, .f-check, .onb-check, .su-role):focus-within {
  outline: 3px solid var(--gold); outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--a11y-focus-edge);
}
.f-input, .pl-filters select, .pl-search input, .ccp-input, .fld {
  border-color: var(--a11y-border-dark);
}
.f-light .f-input, #onbCard :is(input, select, textarea), .f-light .f-check input {
  border-color: var(--a11y-border-light) !important;
}
.f-light :is(.f-req, .fp-inline-link) { color: var(--a11y-ink); }
/* Placeholders on the white card: #6B7280 is 4.83:1 on white (AA) yet clearly
   lighter than typed values (#111827), so an example like "Ewood Park" no
   longer reads as a field that is already filled in. */
.f-light .f-input::placeholder { color: var(--a11y-placeholder-light); opacity: 1; }
#onbCard :is(.text-gray-400, .text-gray-500) { color: var(--a11y-muted-light); }
#onbCard :is(input, textarea)::placeholder { color: var(--a11y-placeholder-light); opacity: 1; }
#onbCard .accent-focus:focus { border-color: var(--a11y-border-light) !important; }
.f-check input { border-color: var(--a11y-border-dark); }
/* Gold selected controls on white retain a contrasting dark boundary. */
.f-light :is(.f-check input:checked, .f-card:has(input:checked)),
#onbCard :is(.onb-check input:checked, .onb-mark) { border-color: var(--a11y-border-light) !important; }
.f-input.is-invalid { border-color: var(--a11y-error-dark); }
.f-light .f-input.is-invalid { border-color: var(--a11y-error-light) !important; }
.f-err:not([hidden]) { font-weight: 600; }
/* Consistent hit areas without enlarging checkbox/radio glyphs. */
button, summary { min-height: 44px; }
button:not(.onb-head):not(.ccp-sechead) { min-width: 44px; }
:is(.button, .btn, .primary-btn, .secondary-btn, .cta-link, .fp-back,
.fp-submit, .fp-cancel, .fp-inline-link, .small-button, .step-card__link,
.ccp-link, .ccp-back, .mobile-profile, .site-footer a, .legal-footer a,
.cb-mobile-nav a, .nav-links a, .nav-actions a) {
  display: inline-flex; align-items: center; min-height: 44px;
}
:is(.f-check, .onb-check) { min-height: 44px; align-items: center; }
.icon-btn, .ccp-iconbtn { width: 44px; height: 44px; }
.su-eye { width: 44px; height: 44px; right: 2px; }
.su-page .f-input.su-has-eye { padding-right: 52px; }
:is(.button, .small-button, .fp-secondary, .pl-pager-buttons button, .su-role__card) {
  border-color: var(--a11y-border-dark);
}
.button.primary { border-color: var(--gold); }
.cb-mobile-nav { flex-wrap: wrap; }
.cb-mobile-nav a { justify-content: center; }
:is(.fp-actions, .banner-actions, .row-between) { flex-wrap: wrap; }
:is(.fp-card, .fp-side, .panel, .welcome-identity, .main, .content, .ccp-main) { min-width: 0; }
:is(.fp-file, .f-file) { flex-wrap: wrap; }
:is(.fp-file, .f-file) button { flex-shrink: 0; }
/* break-word, not anywhere: both wrap a long unbroken string rather than
   overflow, but `anywhere` also shrinks the element's min-content width to one
   character, so flex and grid let headings collapse ("T o p / P e r f o r m
   e r s" in a 1024px dashboard panel, "Profi le" in the 320px topbar). */
:is(p, h1, h2, h3, label, .legal-footer) { overflow-wrap: break-word; }
/* 44px controls at every width, not just phones: tablets in landscape
   (1024px+) are touch devices too. */
:is(.f-input, .pl-filters select, .pl-search input) { min-height: 44px; }
#onbCard :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select) { min-height: 44px; }
@media (max-width: 768px) {
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
    font-size: 16px !important; min-height: 44px;
  }
  /* Make all landing nav destinations available when the desktop row hides. */
  .site-header { position: relative; }
  .navbar { height: auto; min-height: 58px; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 16px; }
  .navbar .nav-links { display: flex; flex-wrap: wrap; width: 100%; gap: 8px 16px; }
  .navbar .nav-actions { flex-wrap: wrap; gap: 8px 16px; }
  .promo-strip { height: auto; min-height: 26px; padding: 6px 12px; text-align: center; }
  .club-topbar { padding-inline: 12px; }
  .topbar-right { gap: 8px; min-width: 0; }
  .fp-thumb { flex-wrap: wrap; }
  .get-started__inner { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .step-card, #heroContent { transform: none !important; filter: none !important; }
  #heroContent { opacity: 1 !important; }
  .hero-scroll { height: auto; min-height: 100vh; }
  .hero-backdrop, .video-sticky-wrap, .step-row { position: relative; top: auto !important; }
  .hero-backdrop { height: auto; min-height: 100vh; }
  .hero-content { position: relative; top: auto; left: auto; margin: 0 auto; padding-top: 100px; }
  .video-shell { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; }
}
/* Alternate React prototype: the existing menu handler is retained. */
button.ccp-logo { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.navlink { min-height: 44px; }
@media (max-width: 900px) {
  #menuBtn { display: inline-flex !important; }
  /* Closed navigation must not retain off-screen Tab stops. */
  .app .sidebar:not(.open) { visibility: hidden; }
  /* Open navigation participates in layout rather than covering focused content. */
  .app { flex-wrap: wrap; }
  .app .sidebar.open { position: static; transform: none; height: auto; width: 100%; }
  .app > .main { width: 100%; }
  .topbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 12px; }
  .topbar > .row { min-width: 0; flex-wrap: wrap; }
  .ccp-topbar { height: auto; min-height: 60px; flex-wrap: wrap; padding: 12px; gap: 12px; }
  .ccp-tb-right { flex-wrap: wrap; }
}
.a11y-player-select { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.pl-card-top .a11y-player-select { margin-left: auto; }
.a11y-player-select:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; box-shadow: 0 0 0 5px var(--a11y-focus-edge); }
/* Row checkboxes: the 44px hit area is the label above, so the box itself
   stays checkbox-sized and dark, matching .f-check, instead of a native white
   square that was stretched to 44px on phones. */
input[type=checkbox].pl-check {
  appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0;
  width: 20px; height: 20px; margin: 0; border: 1px solid var(--a11y-border-dark); border-radius: 5px;
  background: var(--nav); cursor: pointer;
}
input[type=checkbox].pl-check:checked { background: var(--gold); border-color: var(--gold); }
input[type=checkbox].pl-check:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type=checkbox].pl-check:indeterminate::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: var(--gold);
}
/* Unselected chips need a 3:1 boundary against the card (WCAG 1.4.11);
   --nav-line on --preview was barely visible. */
.f-chip { border-color: var(--a11y-border-dark); }
.f-chip[aria-pressed="true"] { border-color: var(--gold); }
@media (max-width: 768px) {
  .su-role-grid { grid-template-columns: 1fr; }
  .banner-actions, .fp-actions { width: 100%; }
  .banner-actions > :is(a, button) { white-space: normal; }
}
/* Onboarding: paired email/phone fields get one row each on phones, where
   two side by side left ~150px and cut addresses off mid-word. */
@media (max-width: 480px) {
  #onbCard .flex.gap-3:has(input[type=email], input[type=tel], input[type=url]) { flex-wrap: wrap; }
  #onbCard .flex.gap-3:has(input[type=email], input[type=tel], input[type=url]) > .flex-1 { flex-basis: 100%; }
}
/* Height-only collapsed onboarding panels must not expose invisible Tab stops.
   Visibility does not affect the measurements used by the existing accordion. */
.onb-panel { visibility: hidden; }
.onb-panel[style*="height:"]:not([style*="height: 0px"]):not([style*="height:0px"]) { visibility: visible; }
:is(.brand, .su-logo, .ccp-logo, .ccp-btn) { min-height: 44px; display: inline-flex; align-items: center; }
/* Links inside a checkbox sentence stay inline: forcing 44px boxes broke the
   sentence into widely spaced lines on phones. In-sentence links are exempt
   from the target-size rule (WCAG 2.5.8); a little padding widens the hit area. */
:is(.f-check a, .onb-check a) { padding-block: 2px; }
/* Flex buttons drop the space between icon and label; restore it. */
.fp-submit { gap: 8px; justify-content: center; }
/* Prototype notice at the top of app pages: separate it from the heading below. */
main > p[role="note"]:first-child { margin: 0 0 20px; }
