/* Account screens (signin.html, signup.html, my-courses.html). Loaded after
   page.css, which supplies the page, its tokens (--ink, --paper, --hair,
   --field-bg, --art-edge, --art-lift-front), the header, the theme toggle
   and the toast. These are focused app screens, not product pages: a
   minimal header (the logo and the theme toggle, plus Sign out once signed
   in), one card or one column, and a slim footer.

   The fields are contact.css's (the 3:1 control edge, the white or card
   fill, 16 px text, the green focus edge and its soft ring), restated here
   so these pages don't load the contact page's sheet. The password field's
   Show button is checkout.css's. The sign-in card mirrors Clear's own
   login (apps/clear/src/pages/login.tsx): Email, Password, the alert box
   with its mark above a full-width solid "Sign in".

   Every colour is a Clear token or a page.css token. No text carries an
   opacity. */

.ac-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ac-body [hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────────────────
   Always solid page colour with a hairline: there is no hero to sit over. */
.site-header.ac-header { background: var(--page); border-bottom-color: var(--hair-soft); }
.ac-header .site-header__inner { max-width: 1160px; }
.ac-header__right { gap: 6px; }
.ac-signout { padding: 0 14px; border: 1px solid transparent; color: var(--card-foreground); background: transparent; cursor: pointer; }
.ac-signout:hover { background: var(--nav-hover); }

/* ── Links ──────────────────────────────────────────────────────────
   Inline links in running text are underlined, so they never rely on
   colour alone; standalone links are the site's text link. */
.ac-inline { font-weight: 600; color: var(--primary-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ac-inline:hover { text-decoration-thickness: 2px; }
.ac-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15.5px; line-height: 22px; font-weight: 600; color: var(--primary-text); text-decoration: none; text-underline-offset: 4px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-sans); }
.ac-link:hover { text-decoration: underline; }
.ac-link svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ac-inline:focus-visible, .ac-link:focus-visible, .ac-pass__show:focus-visible, .ac-footer a:focus-visible, .ac-textbtn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.ac-textbtn { display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--primary-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.ac-textbtn:hover { text-decoration-thickness: 2px; }

/* Buttons sit on paper: the focus ring's gap is the paper, not the page. */
.ac-card .btn:focus-visible, .ac-panel .btn:focus-visible, .ac-dialog .btn:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }
.ac-btn-block { width: 100%; }
/* Busy (Signing in…, Sending…, Creating your account…): the button keeps
   its green and a ring turns before the label, so it reads as working, not
   broken. aria-busy, never disabled: a disabled button drops keyboard focus
   to the page. The script ignores a second press while it is busy. */
.ac-submit[aria-busy="true"] { cursor: progress; }
.ac-submit[aria-busy="true"]:hover { background: var(--primary); }
.ac-submit[aria-busy="true"]::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ac-spin 800ms linear infinite; }
@keyframes ac-spin { to { transform: rotate(360deg); } }

/* ── The centred card (sign in, create account) ─────────────────────
   Clear's login card, at the site's scale: paper, a 1 px edge and the
   collage cards' front lift. */
.ac-center { display: flex; flex-direction: column; align-items: center; padding: 56px 20px 0; }
.ac-card { box-sizing: border-box; width: 100%; max-width: 440px; padding: 36px 36px 32px; border-radius: var(--radius-2xl); border: 1px solid var(--art-edge); background: var(--paper); box-shadow: var(--art-lift-front); overflow-anchor: none; }
.ac-card--wide { max-width: 560px; }
/* A class code from the link (redeem.html): nothing in the card until the
   code's answer, or until it is slow to come (redeem.js). */
.rd-linked .ac-card { visibility: hidden; }
/* Checking a slow code: the card eases in, so an answer just behind it
   never flashes it. */
@media (prefers-reduced-motion: no-preference) {
  .ac-card.is-checking { animation: ac-appear 300ms ease-out both; }
}
@keyframes ac-appear { from { opacity: 0; } }
.ac-card__title { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.ac-card__title:focus { outline: none; }
.ac-card__title:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 4px; }
.ac-card__lede { margin-top: 8px; font-size: 16px; line-height: 24px; color: var(--muted-foreground); text-wrap: pretty; }
.ac-card__lede b { font-weight: 600; color: var(--card-foreground); }
.ac-card__foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hair-soft); font-size: 15.5px; line-height: 22px; color: var(--muted-foreground); text-align: center; }
.ac-card__foot .ac-link { min-height: 32px; }
.ac-below { margin-top: 20px; max-width: 440px; font-size: 14.5px; line-height: 20px; color: var(--muted-foreground); text-align: center; }
.ac-below a { color: var(--card-foreground); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ac-below a:hover { text-decoration-thickness: 2px; }
.ac-below a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }

/* A view's icon tile (reset sent, account ready): Clear's logo tile. */
.ac-tile { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 20px; border-radius: var(--radius-xl); background: var(--primary-tint); color: var(--primary-text); }
.ac-tile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* The course a free sign-up is for (signup.html?free=fm). */
.ac-course { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 12px 14px; border-radius: var(--radius-xl); border: 1px solid var(--hair); background: var(--paper); }
.ac-course__code { font-size: 17px; line-height: 22px; font-weight: 700; letter-spacing: -0.012em; color: var(--card-foreground); }
.ac-course__name { font-size: 14px; line-height: 19px; color: var(--muted-foreground); }
.ac-course__text { display: grid; min-width: 0; }
.ac-course .badge { margin-left: auto; }

/* Free badge: page.css's .badge--free (success edge, neutral label). */
.ac-badge-free { border-color: color-mix(in oklab, var(--success) 45%, transparent); background: color-mix(in oklab, var(--success) 8%, var(--paper)); color: var(--card-foreground); }

/* ── Notices ────────────────────────────────────────────────────────
   One shape for every message in a card: a 1 px edge, a mark, ink text.
   Error is Clear's login alert (TriangleAlert in danger red, the
   sentence in card-foreground on a faint danger wash). Info is neutral. */
.ac-alert { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 11px 14px 12px; border-radius: var(--radius-lg); border: 1px solid color-mix(in oklab, var(--danger) 45%, transparent); background: color-mix(in oklab, var(--danger) 6%, var(--paper)); font-size: 15px; line-height: 22px; color: var(--card-foreground); }
.ac-alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--danger); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ac-alert a { color: var(--card-foreground); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ac-alert a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
.ac-alert:focus { outline: none; }
.ac-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 11px 14px 12px; border-radius: var(--radius-lg); border: 1px solid var(--hair); background: var(--mono-surface); font-size: 15px; line-height: 22px; color: var(--card-foreground); }
.theme-dark .ac-note { background: var(--muted); }
.ac-note svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--muted-foreground); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ac-note--ok svg { stroke: var(--success); }
/* Confirm your email: the address, then Resend · Change email, which give
   way to a short "Sent again" line. */
.ac-confirm b { font-weight: 600; overflow-wrap: anywhere; }
.ac-confirm__acts { white-space: nowrap; }
.ac-confirm__acts[hidden] { display: none; }

/* ── Fields (contact.css's) ───────────────────────────────────────── */
fieldset.fld { margin-left: 0; margin-right: 0; padding: 0; border: 0; min-width: 0; }
.fld { margin-top: 20px; }
.fld__label { display: block; float: none; padding: 0; margin-bottom: 8px; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--card-foreground); }
.fld__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.fld__labelrow .fld__label { margin-bottom: 0; }
.fld__labelrow .ac-textbtn, .fld__labelrow .ac-inline { font-size: 14.5px; line-height: 20px; text-decoration: none; }
.fld__labelrow .ac-textbtn:hover, .fld__labelrow .ac-inline:hover { text-decoration: underline; }
.fld__control { box-sizing: border-box; display: block; width: 100%; height: 48px; margin: 0; padding: 0 14px; border: 1px solid var(--input-border); border-radius: var(--radius-xl); background: var(--field-bg); color: var(--card-foreground); font: 16px/22px var(--font-sans); transition: border-color 150ms ease, box-shadow 150ms ease; }
.fld__control::placeholder { color: var(--muted-foreground); }
.fld__control:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ring) 22%, transparent); }
.fld__control[readonly] { background: var(--muted); }
.fld__hint { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.fld__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.fld__row > .fld { min-width: 0; }
.fld--short .fld__control { max-width: 140px; }

/* Errors: the field's edge turns danger red, and the message sits under it
   with a mark, so it never relies on colour alone. */
.fld__err { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--danger); }
.fld__err::before { content: ""; flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.2'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.2'/%3E%3C/svg%3E") center / 16px 16px no-repeat; }
.fld__err a { color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.fld__err a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
.fld.is-invalid .fld__control { border-color: var(--danger); }
.fld.is-invalid .fld__control:focus { box-shadow: 0 0 0 4px color-mix(in oklab, var(--danger) 22%, transparent); }

/* Password: checkout.css's Show button inside the field's right edge. */
.ac-pass { position: relative; }
.ac-pass .fld__control { padding-right: 84px; }
/* Edge adds its own eye to password fields; Show is ours, so hide it. */
.ac-pass .fld__control::-ms-reveal { display: none; }
.ac-pass__show { position: absolute; right: 5px; top: 5px; height: 38px; min-width: 64px; padding: 0 12px; border: 0; border-radius: var(--radius-lg); background: transparent; font: 600 14.5px/20px var(--font-sans); color: var(--primary-text); cursor: pointer; }
.ac-pass__show:hover { background: var(--nav-hover); }

/* Checkbox (terms): native, in Clear's selection ink. */
.ac-check { display: flex; align-items: flex-start; gap: 11px; font-size: 15px; line-height: 22px; color: var(--card-foreground); cursor: pointer; }
.ac-check input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--selection-solid); cursor: pointer; }
.ac-check input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.fld.is-invalid .ac-check input { outline: 2px solid var(--danger); outline-offset: 1px; }

/* Cloudflare's "Verify you are human" box, only when Turnstile asks. */
.ac-bot { margin-top: 20px; }
.ac-bot[hidden] { display: none; }
.ac-bot:focus { outline: none; }
/* The check gave up (page.js): its message and Try again, centred. */
.ac-bot:has(.ac-bot__msg:not(:empty)) { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ac-bot__msg:empty { display: none; }
.ac-bot__msg { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }

/* The error summary at the top of a long form (contact.css's). */
.ac-errors { margin-top: 20px; padding: 14px 18px 14px 18px; border-radius: var(--radius-xl); border: 1px solid var(--danger); background: var(--paper); }
.ac-errors:focus { outline: none; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ring); }
.ac-errors__title { display: flex; align-items: center; gap: 8px; font-size: 15.5px; line-height: 22px; font-weight: 700; color: var(--card-foreground); }
.ac-errors__title::before { content: ""; flex-shrink: 0; width: 18px; height: 18px; background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.2'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.2'/%3E%3C/svg%3E") center / 18px 18px no-repeat; }
.ac-errors__list { display: grid; row-gap: 4px; margin-top: 8px; padding-left: 26px; }
.ac-errors__list a { display: inline-block; padding: 2px 0; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--card-foreground); text-decoration: underline; text-underline-offset: 3px; }
.ac-errors__list a:hover { text-decoration-thickness: 2px; }
.ac-errors__list a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }

.ac-submit { margin-top: 28px; }
#si-msg:empty, #rd-msg:empty { display: none; }
.si-forgot { margin-top: 10px; font-size: 14.5px; line-height: 20px; }
.ac-fine { margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--muted-foreground); text-align: center; }

/* ── Footer: one line ─────────────────────────────────────────────── */
.ac-footer { margin-top: 72px; padding: 22px 0 24px; border-top: 1px solid var(--hair-soft); }
.ac-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; max-width: 1160px; }
.ac-footer__legal { font-size: 13.5px; line-height: 20px; color: var(--muted-foreground); }
.ac-footer__links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.ac-footer__links a { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; color: var(--muted-foreground); text-decoration: none; }
.ac-footer__links a:hover { color: var(--card-foreground); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .fld__control { transition: none; }
  .ac-submit[aria-busy="true"]::before { animation: none; border-right-color: currentColor; border-style: dotted; }
}

/* ── Phones ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ac-center { padding: 24px 16px 0; }
  .ac-card { padding: 26px 20px 24px; border-radius: var(--radius-xl); }
  .ac-card__title { font-size: 26px; line-height: 32px; }
  .ac-card__lede { font-size: 15.5px; }
  .fld__row { grid-template-columns: minmax(0, 1fr); }
  .ac-footer { margin-top: 48px; }
  .ac-footer__links { gap: 0 18px; }
  .ac-footer__links a { min-height: 44px; }
}
@media (max-width: 480px) {
  /* The logo's mark and name stay; Sign out and the toggle fit beside it. */
  .ac-header .brand__name { font-size: 15px; }
}
@media (max-width: 380px) {
  .ac-header .brand__name { display: none; }
}
