/* Freestay CMS — design tokens, base typography and the sign-in / reset
   page layout. Loaded by dashboard.html (sign-in gate) and reset.html. */

:root {
  --bg:        #0a0a0f;
  --panel:     #0f0f1a;
  --panel-2:   #13131f;
  --border:    #1e1e2e;
  --border-2:  #2a2a3d;
  --text:      #f1f5f9;
  --text-2:    #a3aec0;
  --muted:     #6b7489;
  --accent:    #f97316;
  --accent-soft: rgba(249,115,22,.14);
  --green:     #10b981;
  --red:       #ef4444;
  --amber:     #f59e0b;
  --blue:      #3b82f6;
  --purple:    #8b5cf6;
  --cyan:      #22b8dc;
  --good-soft: rgba(16,185,129,.14);
  --warn-soft: rgba(245,158,11,.16);
  --crit-soft: rgba(239,68,68,.14);
  --info-soft: rgba(59,130,246,.14);
  --series:    #22b8dc;
  --series-fill: rgba(34,184,220,.16);
  --grid:      rgba(241,245,249,.07);
  --shadow:    none;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg:        #f5f4f0;
  --panel:     #ffffff;
  --panel-2:   #f9f8f5;
  --border:    #e3e1da;
  --border-2:  #d3d0c7;
  --text:      #15141c;
  --text-2:    #4a4956;
  --muted:     #77768a;
  --accent:    #ea6a1a;
  --accent-soft: rgba(234,106,26,.12);
  --green:     #0f9f6e;
  --red:       #d63b3b;
  --amber:     #c27a06;
  --blue:      #2f6fdd;
  --purple:    #7c4fd6;
  --cyan:      #0b8fb0;
  --good-soft: rgba(15,159,110,.12);
  --warn-soft: rgba(194,122,6,.14);
  --crit-soft: rgba(214,59,59,.12);
  --info-soft: rgba(47,111,221,.12);
  --series:    #0b8fb0;
  --series-fill: rgba(11,143,176,.18);
  --grid:      rgba(21,20,28,.08);
  --shadow:    0 1px 2px rgba(21,20,28,.05), 0 8px 24px -18px rgba(21,20,28,.25);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* An author display (flex, grid) would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5;
}
h1, h2, h3, h4 { font-weight: 700; }
b, strong { font-weight: 700; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.mono { font-family: 'Roboto Mono', ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Sign-in / reset layout ───────────────────────────────── */
.auth {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: var(--bg);
}
.auth[hidden] { display: none; }

/* The brand panel stays dark in both themes: it is the brand, not the UI. */
.auth-brand {
  position: relative; overflow: hidden; color: #f1f5f9;
  background: #0b0b14;
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(249,115,22,.28), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(139,92,246,.22), transparent 60%),
    linear-gradient(160deg, #10101c 0%, #0b0b14 60%, #0a0a0f 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px;
}
.auth-brand::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(241,245,249,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(241,245,249,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}
.auth-brand > * { position: relative; z-index: 1; }
.brand-top { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 19px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  display: grid; place-items: center; box-shadow: 0 8px 24px -8px rgba(249,115,22,.6);
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.brand-name b { color: #f97316; }
.brand-body { max-width: 440px; margin: 48px 0; }
.brand-body h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.6px; }
.brand-body p { color: #a3aec0; margin-top: 14px; font-size: 17px; }
.brand-points { list-style: none; margin-top: 34px; display: grid; gap: 16px; }
.brand-points li { display: flex; align-items: flex-start; gap: 14px; color: #cbd5e1; font-size: 15px; line-height: 1.45; }
.brand-points li b { color: #f1f5f9; }
.brand-points svg {
  flex-shrink: 0; width: 34px; height: 34px; padding: 8px; border-radius: 9px;
  background: rgba(241,245,249,.06); border: 1px solid rgba(241,245,249,.1);
  stroke: #f97316; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.brand-foot { color: #6b7489; font-size: 13px; }

.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; overflow-y: auto; gap: 28px;
}
.auth-card {
  width: 100%; max-width: 420px; animation: fadeIn .35s ease;
}
.auth-card h1 { font-size: 28px; letter-spacing: -.4px; }
.auth-sub { color: var(--muted); margin: 6px 0 24px; font-size: 16px; }
.auth-sub b { color: var(--text); }
.auth-legal { color: var(--muted); font-size: 13px; }
.auth-foot { color: var(--muted); font-size: 14px; margin-top: 22px; line-height: 1.5; }
.auth-link { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 0; }
.auth-link:hover { text-decoration: underline; }
.auth-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.field { margin-bottom: 16px; }
.field label, .label-row label { font-size: 14px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 7px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field input {
  width: 100%; height: 46px; padding: 0 14px; background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 10px; color: var(--text);
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field input:disabled { opacity: .6; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; top: 0; right: 0; width: 46px; height: 46px;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; border-radius: 10px;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }
.hint { font-size: 13px; color: var(--amber); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.hint[hidden] { display: none; }
.help { font-size: 13px; color: var(--muted); margin-top: 6px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; -webkit-user-select: none; user-select: none; margin: 4px 0 18px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }

.btn-primary {
  width: 100%; height: 48px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: filter .15s, transform .05s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .65; cursor: default; filter: none; }
.btn-secondary {
  height: 48px; padding: 0 18px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 15px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-2);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--muted); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: spin .7s linear infinite; display: none;
}
.is-busy .spinner { display: inline-block; }

.auth-notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  font-size: 14px; line-height: 1.45; margin-bottom: 18px; border: 1px solid transparent;
}
.auth-notice[hidden] { display: none; }
.auth-notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-notice[data-kind="error"]   { background: var(--crit-soft); color: var(--red);   border-color: rgba(239,68,68,.25); }
.auth-notice[data-kind="info"]    { background: var(--info-soft); color: var(--blue);  border-color: rgba(59,130,246,.25); }
.auth-notice[data-kind="success"] { background: var(--good-soft); color: var(--green); border-color: rgba(16,185,129,.25); }
.auth-notice[data-kind="warn"]    { background: var(--warn-soft); color: var(--amber); border-color: rgba(245,158,11,.25); }

.strength { margin-top: 8px; }
.strength .strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength .strength-bars i { display: block; height: 4px; border-radius: 2px; background: var(--border-2); transition: background .2s; }
.strength[data-score="1"] .strength-bars i:nth-child(-n+1) { background: var(--red); }
.strength[data-score="2"] .strength-bars i:nth-child(-n+2) { background: var(--amber); }
.strength[data-score="3"] .strength-bars i:nth-child(-n+3) { background: var(--green); }
.strength[data-score="4"] .strength-bars i { background: var(--green); }
.strength .strength-label { font-size: 13px; color: var(--muted); margin-top: 5px; }

.auth-state { text-align: center; padding: 8px 0; }
.auth-state .icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
}
.auth-state .icon svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-state .icon.good { background: var(--good-soft); color: var(--green); }
.auth-state .icon.info { background: var(--info-soft); color: var(--blue); }
.auth-state .icon.warn { background: var(--warn-soft); color: var(--amber); }
.auth-state h1 { font-size: 24px; }
.auth-state p { color: var(--text-2); margin-top: 10px; line-height: 1.55; }
.auth-state p b { color: var(--text); }
.auth-state .auth-actions { justify-content: center; margin-top: 24px; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .auth-brand { padding: 20px 24px; }
  .auth-brand .brand-body, .auth-brand .brand-foot { display: none; }
  .auth-panel { padding: 28px 16px 40px; justify-content: flex-start; }
}
