/* ============================================================ LOGIN — drop 3a (0.x PWA)
   Shared between login-web / login-tablet / login-desktop.
   AUTH: PASSKEY ONLY. WebAuthn / FIDO2.
     - Returning user: tap "Continue with passkey" → Face ID / Touch ID / security key → in.
     - Invite redeem: tap email invite link → "Create passkey on this device" → biometric enrollment → in.
     - No password. No email magic-link auth. Invites are still emailed; the email is a delivery channel for the redeem URL, not an auth factor.
   Five states: sign-in · prompting · not-invited · passkey-failed · redeem-enroll.
   The work here is conveying TRUST (real origin, biometric vs hardware key, session cookie).
*/

/* ============ PASSKEY hero glyph (Face ID / Touch ID / generic passkey) */
.bio-hero {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in oklch, var(--accent) 18%, var(--surface)), var(--surface-2));
  border: 1px solid color-mix(in oklch, var(--accent) 32%, var(--border));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.5) inset, 0 6px 20px color-mix(in oklch, var(--accent) 18%, transparent);
  flex-shrink: 0;
  position: relative;
}
.bio-hero svg { width: 34px; height: 34px; }
.bio-hero[data-state="prompting"] { animation: bio-pulse 1.5s ease-in-out infinite; }
.bio-hero[data-state="failed"] {
  background: linear-gradient(160deg, color-mix(in oklch, var(--danger) 14%, var(--surface)), var(--surface-2));
  border-color: color-mix(in oklch, var(--danger) 32%, var(--border));
  color: var(--danger);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.5) inset, 0 6px 20px color-mix(in oklch, var(--danger) 14%, transparent);
}
@keyframes bio-pulse {
  0%, 100% { box-shadow: 0 1px 0 oklch(100% 0 0 / 0.5) inset, 0 6px 20px color-mix(in oklch, var(--accent) 18%, transparent), 0 0 0 0 color-mix(in oklch, var(--accent) 50%, transparent); }
  50%      { box-shadow: 0 1px 0 oklch(100% 0 0 / 0.5) inset, 0 6px 20px color-mix(in oklch, var(--accent) 18%, transparent), 0 0 0 10px color-mix(in oklch, var(--accent) 0%, transparent); }
}

/* row alignment for hero-icon + title */
.bio-row {
  display: flex; align-items: center; gap: 14px;
  margin: 2px 0 -4px;
}
.bio-row .bio-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bio-row .bio-meta .lc-title { margin: 0; font-size: 19px; }
.bio-row .bio-meta .lc-sub { margin: 0; }

/* ============ passkey-aware primary button */
.btn--passkey {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 9px;
  height: 42px; padding: 0 18px;
  font-size: 14px; font-weight: 500;
}
.btn--passkey svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--passkey .bio-label { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.btn--passkey .bio-label .sub { font-size: 10.5px; opacity: 0.78; font-weight: 400; letter-spacing: 0.02em; text-transform: uppercase; }

/* ============ system biometric sheet (sketched OS prompt) */
.bio-sheet {
  position: relative;
  margin-top: 12px;
  background: color-mix(in oklch, var(--accent) 4%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 22%, var(--border));
  border-radius: var(--radius-4);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.bio-sheet .ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid color-mix(in oklch, var(--accent) 50%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  animation: bio-ring 1.4s ease-in-out infinite;
}
.bio-sheet .ring svg { width: 22px; height: 22px; }
.bio-sheet .copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bio-sheet .copy .ttl { font-size: 13px; font-weight: 500; color: var(--fg); }
.bio-sheet .copy .det { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
@keyframes bio-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.55; }
}

/* ============ passkey row for "use another way" affordances */
.passkey-alt-row {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted);
}
.passkey-alt-row .alt-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  border-bottom: 1px dotted color-mix(in oklch, var(--accent) 40%, transparent);
  width: max-content;
}
.passkey-alt-row .alt-link svg { width: 11px; height: 11px; }
.passkey-alt-row .device-line { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.passkey-alt-row .device-line code { font-family: var(--font-mono); font-size: 10.5px; background: var(--surface-2); padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--fg-2); }


/* ============ brand mark, used in card header + in the desktop split panel */
.fd-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.18) c calc(h + 22)));
  color: var(--accent-fg);
  font-weight: 700; font-size: 12.5px; letter-spacing: -0.04em;
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.2) inset, 0 2px 8px oklch(from var(--accent) l c h / 0.28);
  flex-shrink: 0;
}
.fd-brand { display: inline-flex; align-items: center; gap: 9px; }
.fd-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; letter-spacing: -0.012em; }
.fd-brand .sub { color: var(--muted); font-size: 11.5px; }

/* ============ the login card */
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-5);
  box-shadow: var(--shadow-2);
  padding: 28px 28px 22px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
}
.login-card[data-state="check-inbox"]      { padding-bottom: 18px; }
.login-card[data-state="not-invited"]      { border-color: color-mix(in oklch, var(--warning) 30%, var(--border)); }
.login-card[data-state="link-expired"]     { border-color: color-mix(in oklch, var(--danger) 30%, var(--border)); }
.login-card[data-state="redeem"]           { border-color: color-mix(in oklch, var(--accent) 30%, var(--border)); }
.login-card[data-state="passkey-prompt"]   { border-color: color-mix(in oklch, var(--accent) 36%, var(--border)); }
.login-card[data-state="passkey-failed"]   { border-color: color-mix(in oklch, var(--danger) 30%, var(--border)); }
.login-card[data-state="redeem-enroll"]    { border-color: color-mix(in oklch, var(--accent) 30%, var(--border)); }

.lc-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 500;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.lc-eyebrow .pill {
  height: 18px; padding: 0 7px; font-size: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.lc-eyebrow .pill--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.lc-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500; line-height: 1.2;
  letter-spacing: -0.018em;
  color: var(--fg);
  margin: 0;
}
.lc-sub {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  margin: -8px 0 0;
}
.lc-sub strong { color: var(--fg-2); font-weight: 500; }

/* ============ field + input */
.lc-field {
  display: flex; flex-direction: column; gap: 5px;
}
.lc-label {
  font-size: 11.5px; font-weight: 500; color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.lc-input {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-3);
  transition: border-color var(--duration-1) var(--ease), box-shadow var(--duration-1) var(--ease);
}
.lc-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);
}
.lc-input input {
  flex: 1; height: 100%; border: 0; outline: none; background: transparent;
  font-size: 14px; color: var(--fg);
  letter-spacing: -0.005em;
}
.lc-input input::placeholder { color: var(--muted-2); }
.lc-input .lead-icon { color: var(--muted-2); display: inline-flex; flex-shrink: 0; }

.lc-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.lc-actions .btn--full { height: 38px; font-size: 14px; }
.lc-actions .btn--full[disabled] { opacity: 0.55; cursor: not-allowed; }

.lc-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted);
}
.lc-meta a { color: var(--accent); border-bottom: 1px dotted color-mix(in oklch, var(--accent) 40%, transparent); }
.lc-meta .dot-sep { color: var(--muted-2); }

/* ============ check-inbox state: icon, recipient row, countdown */
.lc-mailshot {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  background: color-mix(in oklch, var(--accent) 5%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 22%, var(--border));
  border-radius: var(--radius-4);
  padding: 14px 14px 14px;
}
.lc-mailshot .recip {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--fg);
}
.lc-mailshot .recip .at-mask { color: var(--muted); }
.lc-mailshot .recip .mail-ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  border: 1px solid var(--border);
}
.lc-mailshot .countdown {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--fg-2);
}
.lc-mailshot .countdown .t {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 14px; color: var(--fg); font-weight: 500;
}
.lc-mailshot .countdown .label { color: var(--muted); font-size: 11.5px; }
.lc-mailshot .progress-rail {
  height: 4px; background: color-mix(in oklch, var(--accent) 10%, var(--surface-2));
  border-radius: 999px; overflow: hidden; position: relative;
}
.lc-mailshot .progress-rail i {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  width: 78%;
  border-radius: 999px;
}

.lc-resend-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 2px;
}
.lc-resend-row .resend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
}
.lc-resend-row .resend.armed { color: var(--accent); cursor: pointer; }
.lc-resend-row .change {
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  border-bottom: 1px dotted var(--border-2);
}

/* ============ not-invited / expired hero icons */
.lc-hero-ic {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lc-hero-ic.warning { background: color-mix(in oklch, var(--warning) 18%, var(--surface)); color: var(--warning); }
.lc-hero-ic.danger  { background: color-mix(in oklch, var(--danger) 18%, var(--surface));  color: var(--danger); }
.lc-hero-ic.accent  { background: color-mix(in oklch, var(--accent) 18%, var(--surface));  color: var(--accent); }

/* ============ invite redeem: inviter chip */
.invite-from {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  font-size: 12.5px;
}
.invite-from .ifrom-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.invite-from .ifrom-meta .who { color: var(--fg); font-weight: 500; }
.invite-from .ifrom-meta .when { color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.invite-from .verified {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--success);
  font-size: 11px; font-weight: 500;
}

/* ============ session footer — appears below the card */
.session-foot {
  width: 100%; max-width: 380px;
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; color: var(--muted);
  text-align: center;
  line-height: 1.55;
}
.session-foot .row1 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.session-foot code {
  font-family: var(--font-mono); font-size: 10.5px;
  background: var(--surface-2); padding: 1.5px 5px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--fg-2);
}
.session-foot .row2 a { color: var(--muted); border-bottom: 1px dotted var(--border-2); }
.session-foot .row2 a:hover { color: var(--fg-2); }

/* ============ "edge states" gallery (web variant) */
.states-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 24px;
}
.states-gallery .state-cell {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.states-gallery .state-cell .state-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.states-gallery .state-cell .state-label .num {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-2);
}
.states-gallery .login-card { max-width: none; padding: 22px 22px 18px; }
.states-gallery .login-card .lc-title { font-size: 18px; }
.states-gallery .session-foot { display: none; }

/* ============ stepper (tablet) */
.lc-stepper {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.lc-stepper .step {
  display: inline-flex; align-items: center; gap: 5px;
}
.lc-stepper .step .pip {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600;
  color: var(--muted-2);
}
.lc-stepper .step.active .pip { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.lc-stepper .step.done .pip { background: var(--success); border-color: var(--success); color: oklch(15% 0 0); }
.lc-stepper .step.active .lbl { color: var(--fg); font-weight: 500; }
.lc-stepper .joiner {
  width: 22px; height: 1px; background: var(--border-2);
}

/* ============ desktop split-pane */
.split-pane {
  display: grid;
  grid-template-columns: 1fr 460px;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}
.split-pane .brand-pane {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 36px 40px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.split-pane .brand-pane .glow {
  position: absolute; inset: -20% -10% auto auto;
  width: 520px; height: 520px;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 16%, transparent), transparent 62%);
  pointer-events: none;
}
.split-pane .brand-pane .brand-headline {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 32px; font-weight: 500; letter-spacing: -0.024em; line-height: 1.12;
  color: var(--fg);
  max-width: 32ch;
}
.split-pane .brand-pane .brand-headline em {
  font-style: normal; color: var(--accent);
}
.split-pane .brand-pane .brand-sub {
  margin-top: 14px;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
  max-width: 48ch;
}
.split-pane .brand-pane .quiet-feats {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 12.5px; color: var(--fg-2);
}
.split-pane .brand-pane .quiet-feats .qf {
  display: flex; align-items: flex-start; gap: 10px;
}
.split-pane .brand-pane .quiet-feats .qf .ic {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.split-pane .form-pane {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 36px;
  background: var(--bg);
  position: relative;
}
.split-pane .form-pane .top-meta {
  position: absolute; top: 22px; right: 24px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.split-pane .form-pane .top-meta code {
  font-family: var(--font-mono); font-size: 10.5px;
  background: var(--surface-2); padding: 1.5px 6px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--fg-2);
}

/* ============ small-screen behavior shared by tablet + web */
@media (max-width: 720px) {
  .login-card { padding: 22px 22px 18px; }
  .lc-title { font-size: 19px; }
}
