/* Sign-up, sign-in and second-factor pages. Builds on /app/styles.css (tokens, .btn, .field, .input,
   .notice); this file only adds the split-screen layout and the pieces the auth flows need. The brand
   panel stays dark in both themes, and the QR code always sits on white so phones can read it. */

.auth-page { background: var(--canvas); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 42%) minmax(0, 1fr); }

/* Brand panel */
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 36px 48px; color: #efeafd;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(126, 104, 255, .55) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(178, 166, 255, .22) 0%, transparent 60%),
    linear-gradient(160deg, #2b2058 0%, #1a1622 72%);
}
.auth-brand::after {
  content: ""; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 120px rgba(255, 255, 255, .02);
  pointer-events: none;
}
.auth-logo { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; }
.auth-pitch { position: relative; z-index: 1; max-width: 440px; }
.auth-kicker { margin: 0 0 12px; color: #c9c0ff; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-headline { margin: 0 0 22px; color: #fff; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.auth-points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; color: #ddd6f6; font-size: 14px; }
.auth-points li { position: relative; padding-left: 26px; }
.auth-points li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(178, 166, 255, .22); box-shadow: inset 0 0 0 4px rgba(178, 166, 255, .5);
}
.auth-legal { position: relative; z-index: 1; margin: 0; color: #a79fc4; font-size: 11px; }

/* Form side */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 48px 24px; }
.auth-card { width: min(460px, 100%); padding: 34px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-card h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
.auth-card h2 { margin: 0 0 8px; font-size: 15px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.auth-card .notice { margin-bottom: 16px; line-height: 1.5; }
.auth-card .notice a { color: inherit; font-weight: 650; }
.auth-form { max-width: none; }
.auth-card .field p { margin: 0; }
.auth-card p.hint { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.auth-form .field.has-error .input { border-color: var(--red); }
/* Signing up from an invitation: which account it joins, and the invited address, which can't change. */
.auth-card .auth-invite { margin: 0 0 12px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.auth-form .input[readonly] { background: var(--surface-soft); cursor: default; }
.btn-block { width: 100%; min-height: 42px; font-size: 13px; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; transform: none; }
.input-code { font-family: var(--mono); font-size: 20px; letter-spacing: .35em; text-align: center; }
.input-recovery { font-family: var(--mono); font-size: 15px; letter-spacing: .08em; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.field-with-link { position: relative; }
.field-link { position: absolute; top: 0; right: 0; font-size: 12px; font-weight: 600; text-decoration: none; }
.field-link:hover { text-decoration: underline; }
.turnstile { min-height: 65px; }
.auth-alt { margin: 20px 0 0; color: var(--muted); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.auth-alt a { font-weight: 650; }
.auth-alt + .auth-alt { margin-top: 8px; }
.auth-fine { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-inline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin: 16px 0 0; color: var(--muted); font-size: 12.5px; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-dark); font: inherit; font-weight: 650; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.auth-who { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.auth-who strong { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.auth-who form { margin: 0; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: 12px; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--ink); text-decoration: underline; }

/* Second-factor set-up */
.factor-option { display: grid; gap: 12px; }
.factor-option h2 { margin: 0; }
.setup-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.totp-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.totp-qr-frame { padding: 6px; border-radius: 10px; background: #fff; line-height: 0; }
.totp-qr-frame svg { display: block; width: 176px; height: 176px; }
.totp-key { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.secret { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Recovery codes */
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-soft); list-style: none; counter-reset: code; }
.recovery-codes li { display: flex; align-items: baseline; gap: 8px; counter-increment: code; }
.recovery-codes li::before { content: counter(code); width: 18px; color: var(--muted); font-size: 11px; text-align: right; }
.recovery-codes code { font-family: var(--mono); font-size: 14px; letter-spacing: .06em; }
.recovery-actions { margin-bottom: 20px; }

/* Second-factor challenge */
.passkey-prompt { display: grid; gap: 12px; }
.other-methods { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.other-methods p { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.other-methods ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.other-methods a { font-weight: 600; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { flex-direction: row; align-items: center; padding: 16px 20px; gap: 12px; }
  .auth-brand::after, .auth-pitch, .auth-legal { display: none; }
  .auth-main { justify-content: flex-start; padding: 24px 16px 40px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; border-radius: var(--radius); }
  .auth-card h1 { font-size: 21px; }
  .totp-setup { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .recovery-codes { grid-template-columns: minmax(0, 1fr); }
}
