/* Tactivela · modules/auth — scope: .au
   The front door (#s-auth) is the DSi blue page (design system 9.7): always light, the same in both kits, drawn
   only from the fixed --tk-door-* tokens and the system font (the wordmark keeps Barlow Condensed). It has no kit
   switch. Phone first: the navy bar, the hero on white (eyebrow, heading, one line, then the sign-in card), the
   clubs on this phone, the footer (the DSi logo with "Powered by DSi Professionals" bottom left, Privacy bottom
   right). The screen scrolls and the footer sits at the bottom. Tablet (700px and up): more air. A phone held
   sideways (640px and up, 500px tall or less): the heading left and the card right. PC (1100px and up): the 64px
   bar, the heading with the three parts of Tactivela on the left and the card on the right.
   Also here, in the kit's own look: the sign-in and Manage Account sheets (their scrims carry .au) and
   Settings › Account (.au-acc). Clerk styles its own form (auth.js: doorAppearance() on the door, appearance()
   elsewhere); these rules only place it. */
.au { --au-card-w: 440px;
  --au-ring: 0 0 0 2px var(--tk-door-surface), 0 0 0 4px var(--tk-door-navy), 0 0 0 6px var(--tk-door-cyan); }

/* ── The front door ── */
.au#s-auth { color-scheme: light; background: var(--tk-door-page); color: var(--tk-door-text); font-family: var(--tk-font-system); }
/* .au#s-auth.active outranks base.css "#app > .screen" (as menu.css does; ARCHITECTURE Rule 4). */
.au#s-auth.active { overflow-y: auto; }
/* Full-width bands paint out into the notch strips (design system 6.6). */
.au .au-bar, .au .au-hero, .au .au-foot { --au-band: var(--tk-door-surface);
  box-shadow: calc(-1 * var(--tk-safe-left)) 0 0 var(--au-band), var(--tk-safe-right) 0 0 var(--au-band); }

/* Deep Navy bar with the blue reverse symbol and the wordmark ("vela" in DSi Cyan: a logo, 4.1:1 on navy). */
.au .au-bar { --au-band: var(--tk-door-navy); flex-shrink: 0; display: flex; align-items: center; min-height: calc(56px + var(--tk-safe-top));
  padding: var(--tk-safe-top) var(--tk-space-4) 0; background: var(--tk-door-navy); color: var(--tk-door-surface); }
.env-labelled .au .au-bar { padding-top: calc(var(--tk-safe-top) + 14px); min-height: calc(56px + var(--tk-safe-top) + 14px); }
.au .au-bar__in { width: 100%; max-width: var(--tk-column-wide); margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.au .au-bar svg { flex-shrink: 0; }
.au .au-word { font-size: 25px; color: var(--tk-door-surface); }
.au .au-bar .au-word b { color: var(--tk-door-cyan); }

.au .au-main { flex: 1 0 auto; display: flex; flex-direction: column; }

/* Hero on white: eyebrow, heading, line, (PC: the three parts), and the sign-in card. */
.au .au-hero { background: var(--tk-door-surface); border-bottom: var(--tk-hairline) solid var(--tk-door-line); padding: var(--tk-space-6) var(--tk-space-5); }
.au .au-hero__in { width: 100%; max-width: var(--au-card-w); margin: 0 auto; display: flex; flex-direction: column; gap: var(--tk-space-4); }
.au .au-intro { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.au .au-eyebrow { font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tk-door-blue); }
.au .au-title { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; color: var(--tk-door-navy); }
.au .au-lead { margin: 0; font-size: var(--tk-fs-body); line-height: 1.5; color: var(--tk-door-text); }
/* The three parts of Tactivela, from the main menu's own words: on a PC only (a phone keeps the card near the top). */
.au .au-feat { display: none; flex-direction: column; gap: 10px; margin: var(--tk-space-2) 0 0; padding: 0; list-style: none; }
.au .au-feat li { display: flex; gap: 10px; font-size: var(--tk-fs-body-s); line-height: 1.5; color: var(--tk-door-text); }
.au .au-feat b { color: var(--tk-door-navy); }
.au .au-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 7px; border-radius: var(--tk-radius-pill); background: var(--tk-door-cyan); }

/* The card: Clerk's sign-in (or why it cannot show), "Back to Tactivela", or the demo's "Start". */
.au .au-card { width: 100%; display: flex; flex-direction: column; gap: 14px; padding: var(--tk-space-5); background: var(--tk-door-surface);
  border: var(--tk-hairline) solid var(--tk-door-line); border-radius: var(--tk-radius);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tk-door-navy) 10%, transparent); }
.au .au-card__h { margin: 0; font-size: var(--tk-fs-h3); font-weight: 700; color: var(--tk-door-navy); }
.au .au-note { margin: 0; font-size: var(--tk-fs-body-s); line-height: 1.45; color: var(--tk-door-muted); }
.au .au-local { display: flex; flex-direction: column; gap: 14px; }   /* only a copy without sign-in (the demo) */
.au .au-box[data-state="off"] { display: none; }                      /* nothing to show there: no extra gap */
.au .au-legal { margin: 0; font-size: var(--tk-fs-meta); line-height: 1.45; color: var(--tk-door-muted); }

/* The door's own buttons, messages and focus ring in DSi blue (the sheets keep the kit's tk-btn). */
.au#s-auth .tk-btn { min-height: var(--tk-touch); border: var(--tk-hairline) solid var(--tk-door-field); border-radius: var(--tk-radius-sm);
  background: var(--tk-door-surface); color: var(--tk-door-text); font-family: var(--tk-font-system); font-size: var(--tk-fs-body);
  font-weight: 600; letter-spacing: normal; text-transform: none; }
.au#s-auth .tk-btn:hover { border-color: var(--tk-door-navy); }
.au#s-auth .tk-btn--primary { background: var(--tk-door-blue); border-color: var(--tk-door-blue); color: var(--tk-door-surface); }
.au#s-auth .tk-btn--primary:hover { background: var(--tk-door-blue-hover); border-color: var(--tk-door-blue-hover); filter: none; }
.au#s-auth .tk-btn--secondary { color: var(--tk-door-blue); border-color: var(--tk-door-blue); }
.au#s-auth .au-msg { color: var(--tk-door-muted); }
.au#s-auth .au-box[data-state="failed"] .au-msg { border: var(--tk-hairline) solid var(--tk-door-field); border-radius: var(--tk-radius-sm);
  background: var(--tk-door-panel); color: var(--tk-door-text); }
.au#s-auth .au-who__txt { color: var(--tk-door-muted); }
.au#s-auth .au-who__txt b { color: var(--tk-door-text); }
/* Keyboard focus: 2px white, 2px navy, 2px cyan (cyan alone is 2.6:1 on white). Headings that take focus
   when the screen opens (tabindex -1) show none, as everywhere in the app. */
.au#s-auth :focus-visible:not([tabindex="-1"]) { outline: none; box-shadow: var(--au-ring); }

/* Clubs already on this phone: "Continue as …" */
.au .au-here { width: 100%; max-width: calc(var(--au-card-w) + 2 * var(--tk-space-5)); margin: 0 auto; padding: var(--tk-space-5) var(--tk-space-5) 0;
  display: flex; flex-direction: column; gap: 10px; }
.au .au-here__h { margin: 0; font-size: var(--tk-fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tk-door-muted); }
.au .au-list { display: flex; flex-direction: column; gap: 8px; }
.au .au-prof { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px 8px 14px; text-align: left; cursor: pointer;
  background: var(--tk-door-surface); color: var(--tk-door-text); border: var(--tk-hairline) solid var(--tk-door-field); border-radius: var(--tk-radius-sm); font: inherit; }
.au .au-prof:hover { border-color: var(--tk-door-navy); }
.au .au-prof .tk-icon { flex-shrink: 0; color: var(--tk-door-muted); }
.au .au-prof__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au .au-prof__name { font-size: 15px; font-weight: 600; color: var(--tk-door-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au .au-prof__meta { font-size: var(--tk-fs-meta); color: var(--tk-door-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Footer: DSi bottom left (the logo, unchanged, 56px high; clear space well over 10 percent of it), Privacy bottom right. */
.au .au-foot { flex-shrink: 0; margin-top: var(--tk-space-8); background: var(--tk-door-surface); border-top: var(--tk-hairline) solid var(--tk-door-line);
  padding: var(--tk-space-4) var(--tk-space-5) calc(var(--tk-space-4) + var(--tk-safe-bottom)); }
.au .au-foot__in { width: 100%; max-width: var(--tk-column-wide); margin: 0 auto; display: flex; align-items: flex-end;
  justify-content: space-between; gap: var(--tk-space-4); }
/* On a narrow phone "Powered by DSi Professionals" wraps beside the logo, so Privacy stays bottom right. */
.au .au-dsi { min-width: 0; display: flex; align-items: center; gap: var(--tk-space-3); font-size: var(--tk-fs-meta); line-height: 1.35; color: var(--tk-door-muted); }
.au .au-nowrap { white-space: nowrap; }
.au .au-dsi__logo { display: block; flex-shrink: 0; width: auto; height: 56px;
  mix-blend-mode: multiply; }   /* the supplied logo has a near-white (not transparent) ground: on the white footer it then shows no box */
.au .au-foot__link { flex-shrink: 0; display: inline-flex; align-items: center; min-height: var(--tk-touch); padding: 0 var(--tk-space-1); border-radius: var(--tk-radius-sm);
  font-size: var(--tk-fs-body-s); font-weight: 600; color: var(--tk-door-blue); text-underline-offset: 3px; }
/* A toast shown over the door (for example "Use the sign-in above") takes the door's colours. */
body:has(.au#s-auth.active) .tk-toast { background: var(--tk-door-surface); color: var(--tk-door-text); border-color: var(--tk-door-blue); }

/* ── The sign-in box, shared by the door ('d') and the sign-in sheet ('s'): a message, "Signed in as",
   Try Again, and the node Clerk mounts in. These are the sheet's (kit) colours; the door's are above. ── */
.au .au-box { display: flex; flex-direction: column; gap: 10px; }
.au .au-msg { margin: 0; font-size: var(--tk-fs-body-s); color: var(--tk-text-muted); line-height: 1.45; }
.au .au-box[data-state="failed"] .au-msg { padding: 10px 12px; border: var(--tk-hairline) solid var(--tk-line-strong); border-radius: var(--tk-radius); background: var(--tk-card); color: var(--tk-text); }
.au .au-who { display: flex; flex-direction: column; gap: 10px; }
.au .au-who__txt { margin: 0; font-size: var(--tk-fs-body-s); color: var(--tk-text-muted); overflow-wrap: anywhere; }
.au .au-who__txt b { color: var(--tk-text); }
.au .au-clerk { width: 100%; min-width: 0; }
.au .au-clerk:empty { display: none; }

/* The sign-in and Manage Account sheets. Clerk's account screen needs the wide sheet's room. */
.au .au-clerk--profile { min-height: 200px; }

/* Settings › Account (the slot 'settings.account' inside Settings' panel) */
.au.au-acc { display: flex; flex-direction: column; gap: 10px; }
.au .au-val { min-width: 0; color: var(--tk-text-muted); font-size: var(--tk-fs-body-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au .au-txt { margin: 0; font-size: var(--tk-fs-body-s); color: var(--tk-text-muted); line-height: 1.45; }
.au.au-acc > .note { margin: -2px 0 0; }

/* Tablet: more air around the hero and the clubs (the screen scrolls, as on the phone). */
@media (min-width: 700px) {
  .au .au-hero { padding: var(--tk-space-10) var(--tk-space-5); }
  .au .au-title { font-size: 32px; }
}
/* A phone held sideways (short and wide): the heading left and the card right, so the form is on screen at
   once; the bar is a line shorter. The PC block below overrides this on a short, wide PC window. */
@media (min-width: 640px) and (orientation: landscape) and (max-height: 500px) {
  .au .au-bar { min-height: calc(48px + var(--tk-safe-top)); }
  .au .au-hero { padding: var(--tk-space-5); }
  .au .au-hero__in { max-width: var(--tk-column-wide); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--tk-space-6); align-items: start; }
  .au .au-title { font-size: 26px; }
  .au .au-here { max-width: var(--tk-column-wide); }
  .au .au-list { max-width: var(--au-card-w); }
  .au .au-foot { margin-top: var(--tk-space-5); }
}
/* PC: the 64px bar; the heading, the line and the three parts of Tactivela on the left, the card on the right,
   inside --tk-column-wide; the clubs below, under the heading; the DSi logo 64px high. */
@media (min-width: 1100px) {
  .au .au-bar { min-height: calc(64px + var(--tk-safe-top)); padding-left: var(--tk-space-8); padding-right: var(--tk-space-8); }
  .env-labelled .au .au-bar { min-height: calc(64px + var(--tk-safe-top) + 14px); }
  .au .au-word { font-size: 28px; }
  .au .au-hero { padding: var(--tk-space-10) var(--tk-space-8); }
  .au .au-hero__in { max-width: var(--tk-column-wide); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--tk-space-10); align-items: start; }
  .au .au-intro { gap: var(--tk-space-4); padding-top: var(--tk-space-4); }
  .au .au-title { font-size: 38px; }
  .au .au-lead { font-size: 17px; }
  .au .au-feat { display: flex; }
  .au .au-card { justify-self: end; max-width: var(--au-card-w); }
  .au .au-here { max-width: calc(var(--tk-column-wide) + 2 * var(--tk-space-8)); padding: var(--tk-space-6) var(--tk-space-8) 0; }
  .au .au-list { max-width: 420px; }
  .au .au-foot { padding-left: var(--tk-space-8); padding-right: var(--tk-space-8); }
  .au .au-dsi__logo { height: 64px; }
}
