/* ══════════════════════════════════════════════════════════════════════
   auth.css — anonymous (sign-in) surfaces
   Loaded ONLY by templates/accounts/{login,forgot_password,reset_password,
   accept_invitation}.html and legacy_clinics/invite_accept.html, after
   platinum.css.

   2026-09-23 — rebuilt against the public site's sign-in page
   (platinumsystem.com/accounts/login/), which is the reference every
   anonymous surface follows:

   · The shell is BRAND-LOCKED. The pitch is navy and the form side is the
     site's ice paper whatever the visitor's OS theme says. The app theme
     (system / dark) is a signed-in preference — an anonymous page has no
     toggle, and under a dark OS the old page rendered a washed-out sky CTA
     on the void. The lock is done by re-declaring the tokens on `.pl-anon`:
     custom properties resolve per element, so every `var(--pl-*)` and
     `var(--bs-*)` under the shell — Bootstrap's .form-control and
     .form-check-input included — picks up the light values without any
     `[data-theme]` selector fight.
   · Both panels centre their content vertically. The pitch carries three
     feature TILES (icon + title + line), the site's pattern, instead of a
     bullet list and a chip strip.
   · The form title is DM Serif Display, the CTA is the site's coral-dark
     button (#c94a2d — white on the brighter coral fails AA), and the page
     ends with the site's "Back to home" row.

   Everything is namespaced `.pl-anon__*`. The lock only uses platinum.css
   tokens that do NOT move in dark mode (neutral ramp, primary scale, brand
   inks, coral / sky / sage solids), plus the light status literals that
   the dark block would otherwise swap for translucent washes.
   ══════════════════════════════════════════════════════════════════════ */

/* ── 0. Brand lock ──────────────────────────────────────────────────── */
.pl-anon {
  color-scheme: light;

  --pl-bg:               var(--pl-neutral-50);
  --pl-surface:          var(--pl-neutral-0);
  --pl-surface-alt:      var(--pl-neutral-100);
  --pl-surface-elevated: var(--pl-neutral-0);
  --pl-text:             var(--pl-neutral-900);
  --pl-text-strong:      var(--pl-neutral-900);
  --pl-text-muted:       var(--pl-neutral-500);
  --pl-text-subtle:      var(--pl-neutral-500);
  --pl-border:           var(--pl-neutral-200);
  --pl-border-strong:    var(--pl-neutral-300);
  --pl-border-hairline:  rgba(13, 27, 62, 0.08);

  --pl-primary:          var(--pl-primary-600);
  --pl-primary-hover:    var(--pl-primary-700);
  --pl-primary-soft:     var(--pl-primary-50);
  --pl-primary-ring:     rgba(30, 60, 114, 0.18);
  --pl-on-primary:       #ffffff;
  --pl-link:             var(--pl-primary-600);
  --pl-link-hover:       var(--pl-primary-700);

  /* Dark-only input tokens. `[data-theme="dark"] .form-control:focus` paints
     the focused field with --pl-input-bg (a 3% white wash) at a specificity
     nothing below can out-rank; the email field is autofocused, so the very
     first thing a dark-OS visitor saw was a grey input on ice. Pinning the
     token beats the selector. */
  --pl-input-bg:         var(--pl-neutral-0);
  --pl-input-bg-hover:   var(--pl-neutral-100);

  /* Light status values, verbatim from platinum.css `:root` */
  --pl-danger:           #dc2626;
  --pl-danger-soft:      #fee2e2;
  --pl-danger-border:    #fecaca;
  --pl-danger-text:      #991b1b;
  --pl-success:          #4e7a66;
  --pl-success-text:     #3a5d4c;
  --pl-warning:          #c94a2d;
  --pl-sky-soft:         #ebf4fb;
  --pl-coral-soft:       #fdeee9;
  --pl-sage-soft:        #f0f5f2;

  /* Bootstrap bridge, re-pinned under the lock */
  --bs-body-bg:              var(--pl-surface);
  --bs-body-color:           var(--pl-text);
  --bs-emphasis-color:       var(--pl-text);
  --bs-secondary-color:      var(--pl-text-muted);
  --bs-tertiary-bg:          var(--pl-surface-alt);
  --bs-border-color:         var(--pl-border);
  --bs-link-color:           var(--pl-link);
  --bs-link-hover-color:     var(--pl-link-hover);
  --bs-link-color-rgb:       30, 60, 114;
  --bs-link-hover-color-rgb: 23, 48, 92;

  color: var(--pl-text);
  background: var(--pl-bg);
}

/* ── 1. Shell ───────────────────────────────────────────────────────── */
.pl-anon {
  min-height: 100vh;
  min-height: 100dvh;
}
/* The 48/52 split only exists where the pitch is shown. Unconditional, it
   out-ordered the shell's `max-width: 992px { grid-template-columns: 1fr }`
   and left the phone form sitting in a half-width column. */
@media (min-width: 993px) {
  .pl-anon { grid-template-columns: minmax(0, 48fr) minmax(0, 52fr); }
}

/* ── 2. Pitch panel ─────────────────────────────────────────────────── */
/* The two-navy gradient and white glows live in platinum.css. It was a
   flex column with `space-between` and ONE child, so the copy sat pinned to
   the top-left of a full-height panel; the site centres it. */
.pl-anon__pitch {
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 7vw, 6.5rem);
}
.pl-anon__pitch-content { width: 100%; max-width: 500px; }

/* Faint grid, masked back to nothing before it reaches the copy. */
.pl-anon__pitch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000, transparent 70%);
          mask-image: radial-gradient(circle at 30% 30%, #000, transparent 70%);
}

.pl-anon__brand-logo { height: 34px; }

/* The pitch hero is a <p>, not an <h1> — each page keeps exactly one <h1>,
   the form title. It still has to read as the display line. */
.pl-anon__pitch .pl-eyebrow { margin: 2.5rem 0 0.875rem; }
p.pl-anon__hero {
  margin: 0 0 1rem;
  font-size: clamp(2.125rem, 2.9vw, 2.75rem);
}
.pl-anon__lead {
  font-size: var(--pl-fs-lg);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  max-width: 46ch;
}

/* Feature tiles — the site's card pattern: icon tile, bold line, muted line. */
.pl-anon__tiles {
  list-style: none;
  padding: 0;
  margin: 2.25rem 0 0;
  display: grid;
  gap: 0.75rem;
  position: relative; z-index: 1;
}
.pl-anon__tile {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: var(--pl-radius-tile);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  transition: background 0.25s var(--pl-ease), transform 0.35s var(--pl-ease);
}
.pl-anon__tile:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}
.pl-anon__tile-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: var(--pl-radius-tile);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
  background: rgba(139, 190, 221, 0.14);
  color: var(--pl-sky-light);
}
.pl-anon__tile--coral .pl-anon__tile-icon { background: rgba(232, 89, 58, 0.16);  color: var(--pl-coral-light); }
.pl-anon__tile--sage  .pl-anon__tile-icon { background: rgba(169, 207, 190, 0.14); color: var(--pl-sage-light); }
.pl-anon__tile-text { min-width: 0; }
.pl-anon__tile-title {
  display: block;
  font-size: var(--pl-fs-base);
  font-weight: var(--pl-fw-semibold);
  line-height: 1.3;
  color: #fff;
}
.pl-anon__tile-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--pl-fs-sm);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.66);
}

/* Chip strip — still used by the recovery / invitation pitches. */
.pl-anon__chips {
  position: relative; z-index: 1;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.pl-anon__chips-label {
  font-size: var(--pl-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--pl-fw-semibold);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.75rem;
}
.pl-anon__chips-row {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
}
.pl-anon__chip {
  padding: 0.375rem 0.75rem;
  border-radius: var(--pl-radius-control);
  background: rgba(255, 255, 255, 0.08);
  font-size: var(--pl-fs-sm);
  font-weight: var(--pl-fw-semibold);
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
}

.pl-anon__footer {
  margin-top: 2.5rem;
  font-size: var(--pl-fs-sm);
  color: rgba(255, 255, 255, 0.55);
}

/* ── 3. Form side ───────────────────────────────────────────────────── */
.pl-anon__form-wrap {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(59, 134, 188, 0.10), transparent 60%),
    radial-gradient(700px 420px at -4% 108%, rgba(232, 89, 58, 0.06), transparent 60%),
    var(--pl-bg);
}

/* The site puts the form straight on the paper — no floating card. The
   shell's `.pl-anon__card` stays as the width column only. The specificity
   is deliberate: platinum.css has a `[data-theme="dark"] .pl-anon__card`
   rule that would otherwise repaint it as a raised navy plate. */
.pl-anon .pl-anon__card {
  width: 100%;
  max-width: 440px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Card head: the escape link on the right stays at every width; the wordmark
   on the left appears only where the pitch panel is not — the shell hides the
   panel below 992px, which is exactly where the mark takes over. */
.pl-anon__card-head {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: var(--pl-fs-sm);
}
.pl-anon__card-head a { font-weight: var(--pl-fw-semibold); }
.pl-anon__card-head > span { white-space: nowrap; }
.pl-anon__mobile-brand { display: inline-flex; margin-right: auto; }
@media (min-width: 993px) { .pl-anon__mobile-brand { display: none; } }
.pl-anon__mobile-logo {
  height: 26px; width: auto;
  display: block;
  object-fit: contain;
}

/* Icon tile above the title — the site's sign-in mark. */
.pl-anon__mark {
  width: 48px; height: 48px;
  margin-bottom: 1.25rem;
  border-radius: var(--pl-radius-tile);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.375rem;
  background: var(--pl-sky-soft);
  color: var(--pl-sky);
  box-shadow: inset 0 0 0 1px rgba(59, 134, 188, 0.18);
}

/* ── 4. Form head ───────────────────────────────────────────────────── */
.pl-anon__title {
  margin: 0 0 0.375rem;
  font-family: var(--pl-font-display);
  font-size: clamp(1.625rem, 2.1vw, 2rem);
  font-weight: 400;              /* never bold the serif */
  line-height: 1.15;
  letter-spacing: 0.005em;
  color: var(--pl-brand);
}
.pl-anon__subtitle {
  margin: 0 0 1.75rem;
  font-size: var(--pl-fs-md);
  line-height: var(--pl-lh-snug);
  color: var(--pl-text-muted);
}

.pl-anon .pl-banner {
  margin-bottom: 1.25rem;
  border-radius: var(--pl-radius-card);
}

/* ── 5. Fields ──────────────────────────────────────────────────────── */
.pl-anon__field { margin-bottom: 1.125rem; }
.pl-anon__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--pl-fs-base);
  font-weight: var(--pl-fw-semibold);
  color: var(--pl-text);
}
.pl-anon__field-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.pl-anon__field-row .pl-anon__label { margin-bottom: 0; }
.pl-anon__field-row a { font-size: var(--pl-fs-sm); font-weight: var(--pl-fw-medium); }

.pl-anon__input-wrap { position: relative; }
.pl-anon__input-wrap .form-control {
  height: 46px;
  padding-left: 2.625rem;
  padding-right: 0.875rem;
  border-radius: var(--pl-radius-card);
  border: 1px solid var(--pl-border-strong);
  background-color: var(--pl-surface);
  color: var(--pl-text);
  font-size: var(--pl-fs-md);
  box-shadow: var(--pl-shadow-xs);
  transition: border-color 0.15s var(--pl-ease), box-shadow 0.15s var(--pl-ease);
}
.pl-anon__input-wrap .form-control:has(+ .pl-anon__toggle-pw) { padding-right: 2.875rem; }
.pl-anon__input-wrap .form-control::placeholder { color: var(--pl-neutral-400); }
.pl-anon__input-wrap .form-control:focus {
  border-color: var(--pl-primary);
  box-shadow: 0 0 0 3px var(--pl-primary-ring);
}
.pl-anon__input-wrap .form-control.is-invalid {
  border-color: var(--pl-danger);
  background-image: none;      /* Bootstrap's own warning glyph collides with the eye */
}
.pl-anon__input-wrap .form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--pl-danger-soft);
}
.pl-anon__icon {
  position: absolute; left: 0.9375rem; top: 50%;
  transform: translateY(-50%);
  color: var(--pl-text-subtle);
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  transition: color 0.15s var(--pl-ease);
}
.pl-anon__input-wrap:focus-within .pl-anon__icon { color: var(--pl-primary); }

/* Show/hide password. Reachable by keyboard — it used to carry
   tabindex="-1", which made the only way to check a typed password a
   mouse. */
.pl-anon__toggle-pw {
  position: absolute; right: 0.5rem; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--pl-radius-control);
  color: var(--pl-text-subtle);
  font-size: 1rem;
}
.pl-anon__toggle-pw:hover { color: var(--pl-text); background: var(--pl-surface-alt); }
.pl-anon__toggle-pw:focus-visible {
  outline: 2px solid var(--pl-primary);
  outline-offset: 1px;
  color: var(--pl-text);
}

.pl-anon__error {
  display: flex; align-items: center; gap: 0.25rem;
  margin-top: 0.375rem;
  font-size: var(--pl-fs-sm);
  color: var(--pl-danger);
}
.pl-anon__help {
  margin-top: 0.375rem;
  font-size: var(--pl-fs-sm);
  color: var(--pl-text-muted);
}

/* ── 6. Options row (remember me · forgot password) ─────────────────── */
.pl-anon__options {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 1.375rem;
}
.pl-anon__options .form-check {
  display: flex; align-items: center; gap: 0.5rem;
  padding-left: 0;
  margin: 0;
  min-height: 0;
}
.pl-anon__options .form-check .form-check-input {
  float: none;
  flex: 0 0 auto;
  width: 1.0625rem; height: 1.0625rem;
  margin: 0;
  border-radius: var(--pl-radius-control);
  border-color: var(--pl-border-strong);
  background-color: var(--pl-surface);
  cursor: pointer;
}
.pl-anon .form-check-input:checked {
  background-color: var(--pl-primary);
  border-color: var(--pl-primary);
}
.pl-anon .form-check-input:focus {
  border-color: var(--pl-primary);
  box-shadow: 0 0 0 3px var(--pl-primary-ring);
}
.pl-anon__options .form-check-label {
  font-size: var(--pl-fs-base);
  color: var(--pl-text);
  cursor: pointer;
}
.pl-anon__options a {
  font-size: var(--pl-fs-sm);
  font-weight: var(--pl-fw-semibold);
  white-space: nowrap;
}

/* ── 7. Primary CTA ─────────────────────────────────────────────────── */
/* The site's button: flat coral-dark, travels to navy on hover. Pinned on
   the button itself so the dark-mode `.btn-primary` (sky on the void) can
   never reach it. */
.pl-anon .btn.pl-anon__submit {
  --bs-btn-bg:                    var(--pl-coral-dark);
  --bs-btn-border-color:          var(--pl-coral-dark);
  --bs-btn-color:                 #ffffff;
  --bs-btn-hover-bg:              var(--pl-brand);
  --bs-btn-hover-border-color:    var(--pl-brand);
  --bs-btn-hover-color:           #ffffff;
  --bs-btn-active-bg:             var(--pl-brand-ink);
  --bs-btn-active-border-color:   var(--pl-brand-ink);
  --bs-btn-active-color:          #ffffff;
  --bs-btn-disabled-bg:           var(--pl-coral-dark);
  --bs-btn-disabled-border-color: var(--pl-coral-dark);
  --bs-btn-disabled-color:        #ffffff;
  --bs-btn-focus-shadow-rgb:      201, 74, 45;
  width: 100%;
  height: 48px;
  font-size: var(--pl-fs-md);
  font-weight: var(--pl-fw-bold);
  letter-spacing: 0.01em;
  border-radius: var(--pl-radius-card);
  box-shadow: 0 8px 18px -10px rgba(201, 74, 45, 0.6);
  transition:
    background-color 0.2s var(--pl-ease),
    border-color 0.2s var(--pl-ease),
    box-shadow 0.2s var(--pl-ease),
    transform 0.2s var(--pl-ease);
}
.pl-anon .btn.pl-anon__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(13, 27, 62, 0.45);
}
.pl-anon .btn.pl-anon__submit:active { transform: none; }
.pl-anon .btn.pl-anon__submit:disabled { transform: none; box-shadow: none; }

/* ── 8. Footers ─────────────────────────────────────────────────────── */
.pl-anon__form-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: var(--pl-fs-sm);
  color: var(--pl-text-muted);
}
.pl-anon__back {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: var(--pl-fs-sm);
  font-weight: var(--pl-fw-medium);
  color: var(--pl-text-muted);
  text-decoration: none;
}
.pl-anon__back:hover { color: var(--pl-primary); }
.pl-anon__legal {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: var(--pl-fs-xs);
  line-height: 1.5;
  color: var(--pl-text-subtle);
}
.pl-anon__legal a {
  color: var(--pl-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pl-anon__legal a:hover { color: var(--pl-primary); }

/* reCAPTCHA v3 (accounts/_recaptcha_field.html + _recaptcha_script.html).
   Google's floating badge is hidden, which its branding terms allow only
   when the notice below sits in the form's own flow — the partial renders
   that notice, this styles it like the legal line. */
.grecaptcha-badge { visibility: hidden; }
.pl-anon__recaptcha {
  margin: 1rem 0 0;
  text-align: center;
  font-size: var(--pl-fs-xs);
  line-height: 1.5;
  color: var(--pl-text-subtle);
}
.pl-anon__recaptcha a {
  color: var(--pl-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pl-anon__recaptcha a:hover { color: var(--pl-primary); }

/* The site's closing row: a hairline, then quiet links. */
.pl-anon__links {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--pl-border);
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: var(--pl-fs-sm);
}
.pl-anon__links a {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-weight: var(--pl-fw-medium);
  color: var(--pl-text-muted);
}
.pl-anon__links a:hover { color: var(--pl-primary); }

/* ── 9. Invalid / expired big state ─────────────────────────────────── */
.pl-anon__bigstate { text-align: center; padding: 1.5rem 0.5rem; }
.pl-anon__bigstate-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--pl-danger-soft);
  color: var(--pl-danger);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
}

/* ── 10. Password strength meter ────────────────────────────────────── */
.pl-anon__pw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 0.5rem;
}
.pl-anon__pw-meter span {
  height: 4px;
  border-radius: 999px;
  background: var(--pl-border);
  transition: background 0.15s ease;
}
.pl-anon__pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--pl-danger); }
.pl-anon__pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--pl-warning); }
.pl-anon__pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--pl-sky); }
.pl-anon__pw-meter[data-score="4"] span:nth-child(-n+4) { background: var(--pl-success); }
.pl-anon__pw-meter-label {
  margin-top: 0.25rem;
  font-size: var(--pl-fs-xs);
  color: var(--pl-text-muted);
}

/* ── 11. Requirements list ──────────────────────────────────────────── */
.pl-anon__pw-rules {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--pl-surface-alt);
  border-radius: var(--pl-radius-card);
  box-shadow: inset 0 0 0 1px var(--pl-border);
  font-size: var(--pl-fs-sm);
}
.pl-anon__pw-rules strong {
  font-weight: var(--pl-fw-semibold);
  color: var(--pl-text);
}
.pl-anon__pw-rules ul {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  display: grid;
  gap: 0.125rem;
}
.pl-anon__pw-rules li {
  display: flex; align-items: center; gap: 0.375rem;
  color: var(--pl-text-muted);
}
.pl-anon__pw-rules li.is-ok { color: var(--pl-success); }
.pl-anon__pw-rules li .bi { font-size: 0.875rem; }

/* ── 12. Small screens ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  .pl-anon__form-wrap {
    align-items: flex-start;
    padding: 1.5rem 1rem 2.5rem;
  }
  .pl-anon .pl-anon__card { margin: 0 auto; }
  .pl-anon__card-head { margin-bottom: 1.5rem; }
  .pl-anon__mark { width: 44px; height: 44px; font-size: 1.25rem; }
}
@media (max-width: 420px) {
  .pl-anon__options { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-anon__tile,
  .pl-anon .btn.pl-anon__submit { transition: none; }
  .pl-anon__tile:hover,
  .pl-anon .btn.pl-anon__submit:hover { transform: none; }
}
