/* Public pages: sign in, forgot / reset password, activate, MFA code.
   Colours come from the brand's generated stylesheet (--brand-* variables);
   nothing here names a colour. */
*, *::before, *::after { box-sizing: border-box; }
body.auth-page {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5;
  color: var(--brand-text); background: var(--brand-page);
  -webkit-font-smoothing: antialiased;
}
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* The side panel: one picture and one line, large screens only. */
.auth-panel {
  display: none; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(165deg, var(--brand-secondary), var(--brand-primary));
}
.auth-panel-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.auth-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 60%); pointer-events: none; }
.auth-headline { position: relative; z-index: 1; padding: clamp(40px, 9vh, 88px) clamp(24px, 3.5vw, 48px) 0 clamp(28px, 4vw, 56px); max-width: 32rem; text-shadow: 0 1px 14px rgba(0, 0, 0, .35); }
.auth-headline-title { margin: 0 0 8px; font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.2; font-weight: 700; }
.auth-headline-body { margin: 0; font-size: clamp(1.05rem, 1.9vw, 1.55rem); line-height: 1.3; font-weight: 300; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 24px 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.auth-card {
  width: 100%; max-width: 520px; background: var(--brand-surface); border-radius: 24px; padding: 32px 24px 32px;
  box-shadow: 0 10px 40px rgba(17, 24, 39, .06);
}
.auth-brandmark { display: flex; justify-content: center; padding-bottom: 20px; }
.auth-logo { height: 56px; width: auto; max-width: 100%; display: block; }
.auth-wordmark { font-size: 1.6rem; font-weight: 700; color: var(--brand-text); }
.auth-divider { border: 0; border-top: 1px solid var(--brand-border); margin: 0 0 24px; }
.auth-title { margin: 0 0 20px; text-align: center; font-size: 1.35rem; line-height: 1.3; font-weight: 500; }
.auth-lead { margin: -8px 0 20px; text-align: center; color: var(--brand-muted); font-size: .95rem; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-message { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; font-size: .92rem; background: var(--brand-tint); color: var(--brand-text); }
.auth-message-error { background: #FEF2F2; color: #991B1B; }
.auth-message-success { background: #F0FDF4; color: #166534; }

.auth-field { display: flex; align-items: stretch; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: 12px; min-height: 56px; overflow: hidden; }
.auth-field:focus-within { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.auth-field-icon { display: none; align-items: center; justify-content: center; width: 56px; flex: none; background: var(--brand-tint); color: var(--brand-primary); }
.has-icons .auth-field-icon { display: flex; }
.auth-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 16px; font: inherit; color: var(--brand-text); outline: none; }
.auth-input::placeholder { color: var(--brand-muted); opacity: 1; }
.auth-eye { flex: none; width: 52px; border: 0; background: transparent; color: var(--brand-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.auth-eye[hidden] { display: none; }
.auth-eye .auth-eye-on { display: none; }
.auth-eye.is-shown .auth-eye-on { display: block; }
.auth-eye.is-shown .auth-eye-off { display: none; }
.auth-eye:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; border-radius: 10px; }

.auth-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-row-end { justify-content: flex-end; margin-top: -4px; }
.auth-link { color: var(--brand-link); text-decoration: none; font-size: .95rem; }
.auth-link:hover { text-decoration: underline; }
.auth-muted { color: var(--brand-muted); }
.auth-hint { margin: -6px 0 0; color: var(--brand-muted); font-size: .8rem; }
.auth-fineprint { margin: 20px 0 0; text-align: center; color: var(--brand-muted); font-size: .85rem; }

.auth-switch-label { color: var(--brand-muted); font-size: 1rem; }
.auth-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex: none; }
.auth-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.auth-switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--brand-border); transition: background .15s; }
.auth-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.auth-switch input:checked + .auth-switch-track { background: var(--brand-primary); }
.auth-switch input:checked + .auth-switch-track::after { transform: translateX(22px); }
.auth-switch input:focus-visible + .auth-switch-track { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

.auth-check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--brand-text); }
.auth-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand-primary); flex: none; }

.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; margin-top: 6px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--brand-primary); color: var(--brand-on-primary); font: inherit; font-weight: 600; text-decoration: none;
}
.auth-btn:hover { filter: brightness(.95); }
.auth-btn:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 2px; }
.auth-btn-chevron { margin-right: -4px; }
.auth-btn-quiet { background: transparent; color: var(--brand-link); border: 1px solid var(--brand-border); }
.auth-code { letter-spacing: .3em; text-align: center; font-size: 1.3rem; }
.auth-list { margin: 0 0 16px; padding-left: 1.2rem; color: var(--brand-muted); font-size: .88rem; }
.auth-errorlist { margin: -6px 0 0; padding: 0; list-style: none; color: #991B1B; font-size: .88rem; }

.auth-install { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--brand-border); text-align: center; }
.auth-install[hidden], .auth-install [hidden] { display: none; }
.auth-install-text { margin: 0 0 12px; color: var(--brand-muted); font-size: .9rem; }
.auth-install .auth-btn { margin-top: 0; min-height: 48px; }
.auth-install-dismiss { margin-top: 10px; border: 0; background: transparent; color: var(--brand-muted); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; }

@media (min-width: 900px) {
  .auth-shell.has-panel { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
  .auth-shell.has-panel .auth-panel { display: block; }
  .auth-main { padding: 48px; }
  .auth-card { padding: 40px 48px 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-switch-track, .auth-switch-track::after { transition: none; }
}

/* The landing page at the site root: one card per kind of person. */
.auth-card-wide { max-width: 640px; }
.auth-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.auth-choice { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--brand-border); border-radius: 16px; background: var(--brand-surface); }
.auth-choice-title { margin: 0; font-size: 1.1rem; font-weight: 600; }
.auth-choice-text { margin: 0 0 10px; color: var(--brand-muted); font-size: .92rem; flex: 1; }
.auth-choice .auth-btn { min-height: 48px; margin-top: 0; }
.auth-staff { margin: 24px 0 0; text-align: center; font-size: .85rem; color: var(--brand-muted); }
@media (min-width: 640px) { .auth-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } .auth-choices.auth-choices-single { grid-template-columns: minmax(0, 1fr); } }
