/* ==================================================================
   AgniCycle "app shell" design system — account/admin/auth pages.
   Linked from account/, admin/, signup/, and auth-action/ via
   <link rel="stylesheet" href="/assets/app-shell.css">.
   Own token set, separate from assets/site.css's marketing-page
   tokens/components (different component shapes: bespoke .topbar
   instead of the full .nav, etc.) — but now supports both themes,
   same [data-theme="dark"] attribute convention as site.css.
   Page-specific CSS (dashboard grids, KPI cards, signup's footer,
   admin's approval queue, etc.) stays local to each page.
   ================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f7fa; --bg2: #edf1f7; --surface: #ffffff; --surface2: #edf2f8;
  --border: rgba(15,23,42,0.09); --border2: rgba(15,23,42,0.15);
  --text: #1e293b; --text2: #475569; --text3: #94a3b8; --muted: #64748b;
  --fire: #f97316; --teal: #0ea5b7; --green: #22c55e; --red: #dc2626;
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --grid-line: rgba(15,23,42,0.028);
}
[data-theme="dark"] {
  --bg: #07090f; --bg2: #0d1320; --surface: #111827; --surface2: #1a2235;
  --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.12);
  --text: #e2e8f0; --text2: #94a3b8; --text3: rgba(255,255,255,0.35); --muted: #64748b;
  --red: #ef4444;
  --grid-line: rgba(255,255,255,0.035);
  color-scheme: dark;
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { color: var(--text); }
[data-theme="dark"] .card { box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
[data-theme="dark"] .msg-error { color: #fca5a5; }
[data-theme="dark"] .msg-ok { color: #86efac; }
[data-theme="dark"] .msg-info { color: #67e8f9; }
html { background: var(--bg); }
body {
  font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: 'Sora', sans-serif; line-height: 1.25; color: #0f172a; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.icon-circle { width: 54px; height: 54px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.icon-lg { width: 24px; height: 24px; display: block; }

/* ── TOPBAR ── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #0B2536; border: 1.5px solid var(--teal); display: flex; align-items: center; justify-content: center; }
.brand-mark svg, .brand-mark img { width: 18px; height: 18px; }
.brand em { color: var(--fire); font-style: normal; }
.back-link { font-size: 13px; font-weight: 600; color: var(--text2); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; transition: color 0.2s, background 0.2s;
}
.theme-toggle-btn:hover { color: var(--text); background: var(--surface); }
#theme-sun { display: block; }
#theme-moon { display: none; }
[data-theme="dark"] #theme-sun { display: none; }
[data-theme="dark"] #theme-moon { display: block; }

/* ── CARD SHELL ── */
.wrap { flex: 1; padding: 40px 20px 80px; }
.center-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px 80px; }
.card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px; box-shadow: 0 10px 40px rgba(15,23,42,0.06); }
.card h1 { font-size: 22px; margin-bottom: 8px; }
.card .sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; }

/* ── FORM FIELDS ── */
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--bg); font: inherit; font-size: 14px; color: var(--text); }
.field input:focus, .field select:focus { outline: 2px solid rgba(249,115,22,0.35); border-color: var(--fire); }
.optional-tag { font-weight: 500; text-transform: none; color: var(--text3); }

.pw-field { position: relative; }
.pw-field input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text3); cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; }
.pw-toggle:hover { color: var(--text2); }
.forgot-link { display: block; text-align: right; font-size: 12.5px; font-weight: 600; margin-top: 6px; }

/* ── BUTTONS ── */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 10px; border: none; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: opacity 0.15s; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--fire); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-google { background: var(--surface); border: 1px solid var(--border2); color: var(--text); }
.btn-google:hover:not(:disabled) { background: var(--surface2); }
.btn-ghost { background: none; border: none; color: var(--teal); font-weight: 600; font-size: 13.5px; width: auto; padding: 4px 0; }
.btn-ghost:hover { text-decoration: underline; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text3); font-size: 12px; font-weight: 600; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── MESSAGES ── */
.msg { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; line-height: 1.5; }
.msg-error { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.25); color: #b91c1c; }
.msg-ok { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.3); color: #15803d; }
.msg-info { background: rgba(14,165,183,0.08); border: 1px solid rgba(14,165,183,0.3); color: #0e7490; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: 13.5px; color: var(--text2); }
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }

/* ── STEP FLOW ── */
.step { display: none; }
.step.active { display: block; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border2); border-top-color: var(--fire); animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER — plain one-liner. signup/ overrides with its own full footer. ── */
footer { text-align: center; padding: 24px; font-size: 12.5px; color: var(--text3); }

@media (max-width: 600px) { .wrap { padding: 24px 14px 60px; } }
