/* Auth pages: login, signup, forgot, reset, verify, setup. */
:root {
  --accent: #0096ff;
  --accent-hover: #0077cc;
  --accent-soft: rgba(0,150,255,.10);
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #111418;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --ok: #16a34a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.auth-layout { display: grid; grid-template-columns: 1fr 480px; min-height: 100vh; }

.brand-panel {
  background: linear-gradient(135deg, #001b30 0%, #003a63 60%, #0066b0 100%);
  color: #fff; padding: 56px 64px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.brand-panel::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 600px at 80% 20%, rgba(0,150,255,.35), transparent 70%),
    radial-gradient(400px 400px at 10% 90%, rgba(0,150,255,.25), transparent 70%);
  pointer-events: none;
}
.brand-mark { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; position: relative; z-index: 1; }
.brand-mark .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 8px 24px rgba(0,150,255,.4); }
.brand-hero { position: relative; z-index: 1; max-width: 520px; }
.brand-hero h1 { font-size: 48px; line-height: 1.05; font-weight: 700; letter-spacing: -.02em; margin: 0 0 20px; }
.brand-hero p { font-size: 17px; line-height: 1.55; color: rgba(255,255,255,.78); margin: 0 0 36px; }
.thread-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); border-radius: 12px; padding: 16px 18px; backdrop-filter: blur(8px); margin-bottom: 12px; }
.thread-card .meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 8px; }
.thread-card .ch { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.10); color: rgba(255,255,255,.85); text-transform: uppercase; }
.thread-card .ch.web   { background: rgba(0,150,255,.25); color: #9fd6ff; }
.thread-card .ch.email { background: rgba(168,85,247,.22); color: #d4b9ff; }
.thread-card .ch.sms   { background: rgba(34,197,94,.22); color: #b2efc7; }
.thread-card .body { font-size: 14.5px; line-height: 1.5; color: #fff; }
.thread-card .meta strong { color: #fff; }
.thread-card.indent { margin-left: 24px; }
.alert pre.code-error {
  display: block; margin-top: 6px; padding: 8px;
  background: #fff; border-radius: 6px;
  font-size: 12px; color: #991b1b;
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}
.alert .alert-help { margin: 8px 0 0; font-size: 13px; }

/* Below-form helper line ("Already have an account?", "← Back to sign in") */
.below-form-link { margin-top: 18px; }
.below-form-link.center {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* OTP / 2FA code input on the verify page */
.field input.otp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 18px; letter-spacing: .15em; text-align: center;
}

/* Disabled / locked input style (e.g. invite email read-only) */
.field input.input-locked { opacity: .7; }
.brand-foot { position: relative; z-index: 1; font-size: 13px; color: rgba(255,255,255,.5); display: flex; gap: 18px; }
.brand-foot a { color: inherit; text-decoration: none; }
.brand-foot a:hover { color: #fff; }

.form-panel { display: flex; flex-direction: column; padding: 56px 56px 32px; background: var(--bg); }

/* When used as a single-pane layout (setup, etc.) */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 32px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06); padding: 36px 32px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.auth-card .sub { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }
.auth-card h2 { margin: 18px 0 14px; font-size: 16px; font-weight: 600; }
.auth-card .muted { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; }

.form-card { max-width: 360px; margin: auto 0; width: 100%; }
.form-card h2 { font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 6px; }
.form-card .sub { color: var(--text-muted); font-size: 14.5px; margin: 0 0 28px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; color: var(--text); background: #fff;
  transition: border .12s, box-shadow .12s;
  font-family: inherit;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: 13px; }
.field-row a { color: var(--accent); text-decoration: none; font-weight: 500; }
.field-row a:hover { text-decoration: underline; }
.field-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-2col .field { margin-bottom: 16px; }
@media (max-width: 480px) { .field-row-2col { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.btn {
  width: 100%; height: 44px; border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background .12s, transform .04s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 1px 2px rgba(0,150,255,.4); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.btn-ghost:hover { background: var(--accent-soft); }

.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.alert-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

.waitlist { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.waitlist-text { font-size: 13.5px; color: var(--text-muted); line-height: 1.4; }
.waitlist-text strong { color: var(--text); }

.form-foot { margin-top: auto; padding-top: 32px; color: var(--text-muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; }
.form-foot a { color: inherit; text-decoration: none; }
.form-foot a:hover { color: var(--text); }

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { padding: 40px 32px; min-height: 280px; }
  .brand-hero h1 { font-size: 32px; }
  .thread-card { display: none; }
  .form-panel { padding: 32px; }
}
