/* ==========================================================
   Sellmate Auth — design tokens & base
   ========================================================== */

/* Google Fonts loaded non-blocking via <link> tags in each page <head> */

:root {
  /* — Surfaces — */
  --bg-panel: #0a0a14;
  --bg-panel-2: #11111e;
  --bg-form: #fafafb;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-2: rgba(255, 255, 255, 0.06);

  /* — Lines — */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-form: oklch(0.92 0.005 270);
  --line-form-strong: oklch(0.84 0.008 270);

  /* — Inks — */
  --ink-1: rgba(255, 255, 255, 0.96);
  --ink-2: rgba(255, 255, 255, 0.72);
  --ink-3: rgba(255, 255, 255, 0.50);
  --ink-4: rgba(255, 255, 255, 0.32);

  --form-ink-1: oklch(0.18 0.01 270);
  --form-ink-2: oklch(0.42 0.012 270);
  --form-ink-3: oklch(0.62 0.012 270);
  --form-ink-4: oklch(0.78 0.008 270);

  /* — Brand — */
  --brand: oklch(0.58 0.20 275);
  --brand-2: oklch(0.50 0.22 278);
  --brand-soft: oklch(0.58 0.20 275 / 0.14);
  --brand-glow: oklch(0.62 0.22 275 / 0.35);

  /* Fallback hex values for older browsers */
  --brand-hex: #6366F1;
  --brand-dark-hex: #4F46E5;
  --brand-light-hex: #EEF2FF;

  /* — Semantic accents — */
  --pos: oklch(0.72 0.16 152);
  --pos-soft: oklch(0.72 0.16 152 / 0.14);
  --neg: oklch(0.66 0.20 22);
  --warn: oklch(0.78 0.14 75);

  /* Legacy aliases used by auth.js */
  --brand-light: #EEF2FF;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --border: oklch(0.92 0.005 270);
  --surface: #F9FAFB;
  --ink: oklch(0.18 0.01 270);
  --ink-light-2: oklch(0.42 0.012 270);
  --ink-light-3: oklch(0.62 0.012 270);
  --ink-light-4: oklch(0.78 0.008 270);

  /* — Type — */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* — Radius — */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* — Shadows — */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --shadow-form: 0 1px 0 rgba(255, 255, 255, 0.4) inset,
                 0 12px 36px -12px rgba(15, 17, 30, 0.12);
}

/* — Theme variants — */
[data-theme="indigo"] {
  --brand: oklch(0.58 0.20 275);
  --brand-2: oklch(0.50 0.22 278);
  --brand-soft: oklch(0.58 0.20 275 / 0.14);
  --brand-glow: oklch(0.62 0.22 275 / 0.35);
}
[data-theme="navy"] {
  --bg-panel: #07091a;
  --bg-panel-2: #0d1124;
  --brand: oklch(0.62 0.16 245);
  --brand-2: oklch(0.55 0.18 248);
  --brand-soft: oklch(0.62 0.16 245 / 0.14);
  --brand-glow: oklch(0.66 0.18 245 / 0.35);
}
[data-theme="forest"] {
  --bg-panel: #07120e;
  --bg-panel-2: #0c1c17;
  --brand: oklch(0.62 0.14 158);
  --brand-2: oklch(0.54 0.15 160);
  --brand-soft: oklch(0.62 0.14 158 / 0.14);
  --brand-glow: oklch(0.66 0.16 158 / 0.35);
}
[data-theme="plum"] {
  --bg-panel: #110714;
  --bg-panel-2: #1a0e1f;
  --brand: oklch(0.60 0.18 330);
  --brand-2: oklch(0.52 0.20 332);
  --brand-soft: oklch(0.60 0.18 330 / 0.14);
  --brand-glow: oklch(0.64 0.20 330 / 0.35);
}

/* ==========================================================
   Reset & base
   ========================================================== */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--form-ink-1);
  background: var(--bg-form);
  font-feature-settings: "cv11", "ss01";
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

input { font-family: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

/* ==========================================================
   Layout — two-column shell
   ========================================================== */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .panel-left { display: none; }
}

/* ==========================================================
   Left panel — dark data-rich side
   ========================================================== */

.panel-left {
  position: relative;
  background: var(--bg-panel);
  color: var(--ink-1);
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  min-height: 100vh;
}

.panel-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 600px at 0% -10%, var(--brand-glow) 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 110%, var(--brand-soft) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}

.panel-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(80% 80% at 50% 40%, #000 30%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

.panel-left > * { position: relative; z-index: 1; }

/* — Brand mark — */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 20px -4px var(--brand-glow);
}
.brand-mark svg { width: 18px; height: 18px; color: white; }
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}

/* — Hero area — */
.hero {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  width: fit-content;
}
.hero-eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 0 3px var(--pos-soft);
}

.hero-title {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0;
  max-width: 22ch;
  color: var(--ink-1);
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--brand) 0%, oklch(0.78 0.14 290) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  max-width: 42ch;
}

/* — Left footer — */
.left-foot {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-3);
}
.left-foot-stat {
  font-family: var(--font-mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   Dashboard preview card
   ========================================================== */

.dash {
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.dash-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.dash-hd-left { display: flex; align-items: center; gap: 10px; }
.dash-traffic { display: flex; gap: 5px; }
.dash-traffic i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.16); }
.dash-traffic i:first-child { background: #ff5f57; }
.dash-traffic i:nth-child(2) { background: #febc2e; }
.dash-traffic i:nth-child(3) { background: #28c840; }
.dash-title { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: -0.005em; }
.dash-hd-right { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }

.dash-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
  position: relative;
  flex-shrink: 0;
}
.dash-live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--pos);
  opacity: 0.35;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.8); }
}

.dash-body { padding: 20px 20px 18px; }

.dash-hero-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.dash-stat-lbl {
  font-size: 11px; font-weight: 500; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.dash-stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  color: var(--pos); background: var(--pos-soft);
  padding: 3px 7px 3px 6px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.dash-stat-val {
  font-family: var(--font-mono); font-size: 30px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--ink-1);
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 8px;
}
.dash-stat-val .rs { color: var(--ink-3); margin-right: 2px; font-weight: 400; }

/* — Sparkline — */
.spark { margin-top: 14px; height: 56px; width: 100%; position: relative; }
.spark svg { width: 100%; height: 100%; overflow: visible; display: block; }
.spark-line {
  fill: none; stroke: var(--brand); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: draw 2.5s cubic-bezier(0.3, 0.7, 0.4, 1) 0.3s forwards;
  filter: drop-shadow(0 4px 8px var(--brand-glow));
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.spark-fill {
  fill: url(#sparkFill);
  opacity: 0;
  animation: fadein 1.2s ease-out 1.6s forwards;
}
@keyframes fadein { to { opacity: 1; } }
.spark-marker {
  fill: var(--brand); stroke: var(--bg-panel-2); stroke-width: 2;
  opacity: 0;
  animation: pop-circ 0.4s cubic-bezier(0.3, 0.7, 0.4, 1) 2.5s forwards;
}
@keyframes pop-circ {
  0% { opacity: 0; r: 0; }
  60% { r: 6; }
  100% { opacity: 1; r: 4; }
}
.spark-tip {
  position: absolute;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-1); background: var(--bg-panel-2);
  border: 1px solid var(--line-strong);
  padding: 3px 7px; border-radius: 6px;
  white-space: nowrap; opacity: 0;
  animation: fadein 0.4s ease-out 2.7s forwards;
  pointer-events: none;
  transform: translate(-50%, -130%);
}

/* — KPI grid — */
.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--line); border-top: 1px solid var(--line);
}
.kpi {
  background: var(--bg-panel); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-lbl {
  font-size: 10.5px; font-weight: 500; color: var(--ink-3);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.kpi-val {
  font-family: var(--font-mono); font-size: 17px; font-weight: 500;
  color: var(--ink-1); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.kpi-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kpi-meta.pos { color: var(--pos); }
.kpi-meta.neg { color: var(--neg); }

/* ==========================================================
   Stat ticker (alt layout)
   ========================================================== */

.ticker {
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  padding: 22px 22px 20px;
}
.ticker-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.ticker-hd-lbl {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.ticker-rows { display: flex; flex-direction: column; gap: 14px; }
.ticker-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 12px;
}
.ticker-row-left { min-width: 0; }
.ticker-row-cap { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.ticker-row-val {
  font-family: var(--font-mono); font-size: 20px; font-weight: 500;
  color: var(--ink-1); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.ticker-row-delta {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--pos); font-variant-numeric: tabular-nums;
}
.ticker-row-delta.neg { color: var(--neg); }
.ticker-bar {
  position: relative; height: 4px; border-radius: 999px;
  background: var(--bg-card-2); overflow: hidden; margin-top: 8px;
}
.ticker-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: inherit; transition: width 0.8s cubic-bezier(0.3, 0.7, 0.4, 1);
}

/* ==========================================================
   Testimonial
   ========================================================== */

.testi {
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.testi-content { position: relative; }
.testi-anim { animation: fadein 0.45s ease-out; }

.testi-quote {
  font-size: 14.5px; line-height: 1.55; color: var(--ink-1);
  font-weight: 400; margin: 0 0 14px; letter-spacing: -0.005em;
}
.testi-quote::before {
  content: "\201C"; color: var(--brand); font-size: 20px; margin-right: 2px;
}
.testi-foot { display: flex; align-items: center; gap: 12px; }
.testi-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  display: grid; place-items: center; color: white;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.testi-who { min-width: 0; flex: 1; }
.testi-name { font-size: 12.5px; font-weight: 500; color: var(--ink-1); }
.testi-role { font-size: 11.5px; color: var(--ink-3); }
.testi-dots { display: flex; gap: 5px; }
.testi-dots button {
  width: 14px; height: 4px; border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.2s, width 0.2s; cursor: pointer;
}
.testi-dots button.active { background: var(--brand); width: 20px; }

/* ==========================================================
   Right panel — sign in / sign up form
   ========================================================== */

.panel-right {
  background: var(--bg-form);
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100vh;
}

.right-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--form-ink-3);
  padding: 8px 10px 8px 6px; border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.back-link:hover { color: var(--form-ink-1); background: oklch(0.96 0.005 270); }
.back-link svg { width: 14px; height: 14px; }

.right-top-cta { color: var(--form-ink-3); }
.right-top-cta a {
  color: var(--brand); font-weight: 500; margin-left: 4px;
}
.right-top-cta a:hover { text-decoration: underline; text-underline-offset: 3px; }

.form-wrap {
  margin: auto;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  padding-top: 32px;
  padding-bottom: 32px;
}

.form-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--brand);
  background: oklch(0.96 0.04 275);
  padding: 5px 10px; border-radius: 999px;
  width: fit-content; margin-bottom: 14px; letter-spacing: 0.01em;
}

.form-title {
  font-size: 30px; letter-spacing: -0.025em; font-weight: 500;
  margin: 0 0 8px; color: var(--form-ink-1); line-height: 1.1;
}

.form-sub {
  font-size: 14px; color: var(--form-ink-3);
  margin: 0 0 28px; line-height: 1.5;
}

/* — Google button — */
.oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 44px; border-radius: 10px;
  border: 1px solid var(--line-form-strong);
  background: white; font-size: 14px; font-weight: 500;
  color: var(--form-ink-1); text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  cursor: pointer;
}
.oauth:hover { background: oklch(0.98 0.003 270); border-color: oklch(0.78 0.012 270); }
.oauth:active { transform: scale(0.99); }
.oauth svg { width: 18px; height: 18px; flex-shrink: 0; }

/* — Divider — */
.div-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; font-size: 11px; font-weight: 500;
  color: var(--form-ink-4); letter-spacing: 0.08em; text-transform: uppercase;
}
.div-or::before, .div-or::after {
  content: ""; flex: 1; height: 1px; background: var(--line-form);
}

/* — Fields — */
.fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }

.field-lbl {
  font-size: 12px; font-weight: 500; color: var(--form-ink-2);
  letter-spacing: 0.01em;
  display: flex; justify-content: space-between; align-items: baseline;
}
.field-lbl-link {
  font-size: 12px; font-weight: 500; color: var(--brand);
}
.field-lbl-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.field-input-wrap { position: relative; display: flex; align-items: center; }

.field-input {
  width: 100%; height: 44px; border-radius: 10px;
  border: 1px solid var(--line-form-strong);
  background: white; padding: 0 14px;
  font-size: 14px; color: var(--form-ink-1);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none; -webkit-appearance: none;
}
.field-input::placeholder { color: var(--form-ink-4); }
.field-input:hover { border-color: oklch(0.74 0.01 270); }
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field-input.has-icon { padding-right: 44px; }
.field-input.invalid {
  border-color: var(--neg);
  box-shadow: 0 0 0 4px oklch(0.66 0.20 22 / 0.12);
}
.field-input.valid { border-color: var(--pos); }

/* Phone field */
.phone-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-form-strong);
  border-radius: 10px; overflow: hidden;
  background: var(--surface);
  transition: border-color .15s;
}
.phone-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.phone-prefix {
  flex-shrink: 0; background: var(--surface-2, #f5f5f7);
  border: none; border-right: 1px solid var(--line-form-strong);
  padding: 0 14px; font-size: 14px; font-weight: 600;
  color: var(--form-ink-2); display: flex; align-items: center;
}
.phone-group .field-input {
  border: none; border-radius: 0; background: transparent;
  box-shadow: none; flex: 1; min-width: 0;
}
.phone-group .field-input:focus { outline: none; box-shadow: none; border: none; }

.field-icon {
  position: absolute; right: 12px;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  color: var(--form-ink-3); border-radius: 6px;
}
.field-icon button {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: inherit; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.field-icon button:hover { background: oklch(0.94 0.005 270); color: var(--form-ink-1); }
.field-icon svg { width: 16px; height: 16px; }
.field-icon.ok { color: var(--pos); }
.field-icon.err { color: var(--neg); }

.field-hint {
  font-size: 11.5px; color: var(--form-ink-3);
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
  transition: color 0.2s;
}
.field-hint:empty { display: none; }
.field-hint.err { color: var(--neg); }
.field-hint.ok { color: var(--pos); }

/* — Password strength meter — */
.pw-meter {
  display: flex; gap: 4px; margin-top: 2px; height: 4px;
}
.pw-meter i {
  flex: 1; background: oklch(0.92 0.005 270);
  border-radius: 999px; transition: background 0.2s;
}
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--neg); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: oklch(0.74 0.14 110); }
.pw-meter[data-level="4"] i { background: var(--pos); }

/* — Checkbox row — */
.row {
  display: flex; justify-content: space-between;
  align-items: center; margin: 18px 0 22px;
}
.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--form-ink-2);
  cursor: pointer; user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--line-form-strong);
  background: white; display: grid; place-items: center;
  transition: all 0.15s;
}
.check-box svg {
  width: 10px; height: 10px; color: white;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check-box svg { opacity: 1; transform: scale(1); }

/* — Submit button — */
.submit {
  width: 100%; height: 46px; border-radius: 10px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white; font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset,
              0 8px 24px -8px var(--brand-glow);
  cursor: pointer;
}
.submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 12px 28px -8px var(--brand-glow);
}
.submit:active { transform: scale(0.99); }
.submit:disabled { opacity: 0.7; cursor: not-allowed; }
.submit svg { width: 16px; height: 16px; }

.submit-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* — Alert — */
.auth-alert {
  display: none; padding: 11px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 16px; line-height: 1.45;
}
.auth-alert.show { display: block; }
.auth-alert.error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth-alert.success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

/* — Form footer / legal — */
.form-foot {
  margin-top: 24px; text-align: center;
  font-size: 11.5px; color: var(--form-ink-3); line-height: 1.55;
}
.form-foot a { color: var(--form-ink-2); font-weight: 500; }
.form-foot a:hover { color: var(--brand); }

/* — OTP section — */
.otp-section { display: none; }
.otp-section.show { display: block; }

.otp-group {
  display: flex; gap: 8px; justify-content: center; margin: 20px 0;
}
.otp-input {
  width: 48px; height: 52px; text-align: center;
  font-size: 20px; font-weight: 700; font-family: var(--font-mono);
  border: 1.5px solid var(--line-form-strong);
  border-radius: 10px; outline: none;
  color: var(--form-ink-1); background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.otp-input.filled { border-color: var(--brand); background: oklch(0.96 0.04 275); }

.otp-resend {
  text-align: center; font-size: 13px;
  color: var(--form-ink-3); margin-bottom: 18px; font-weight: 500;
}
.otp-resend button {
  background: none; border: none; color: var(--brand);
  font-weight: 700; font-size: 13px; cursor: pointer;
  font-family: inherit; padding: 0;
}
.otp-resend button:disabled { color: var(--form-ink-4); cursor: not-allowed; }

/* — Success overlay — */
.success-overlay {
  position: absolute; inset: 0;
  background: rgba(250, 250, 251, 0.96);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 10;
  animation: fadein-overlay 0.3s ease-out;
}
@keyframes fadein-overlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.success-card {
  text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 16px;
}
.success-check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--pos-soft); color: var(--pos);
  display: grid; place-items: center;
  animation: pop-in 0.4s cubic-bezier(0.3, 0.7, 0.4, 1.4);
}
.success-check svg { width: 28px; height: 28px; }
@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.success-title {
  font-size: 18px; font-weight: 500;
  letter-spacing: -0.015em; color: var(--form-ink-1);
}
.success-sub { font-size: 13px; color: var(--form-ink-3); }

/* — Rolling digit animation — */
.roll {
  display: inline-flex; overflow: hidden;
  height: 1em; vertical-align: baseline;
}
.roll-col {
  display: inline-flex; flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.roll-col span { display: block; height: 1em; line-height: 1; }

/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 960px) {
  .panel-right { padding: 32px 24px; min-height: 100vh; }
  .form-wrap { padding-top: 16px; }
}
@media (max-width: 640px) {
  .panel-right { padding: 24px 20px; }
  .form-title { font-size: 26px; }
}

/* ==========================================================
   auth-shell two-column layout (used by reset_password.php,
   forgot.php, and similar standalone auth pages)
   ========================================================== */

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

/* ── Left brand panel ─────────────────────────────────────── */
.auth-brand {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: auto;
}

.brand-logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-logo-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}

.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}

.brand-body h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-1);
  line-height: 1.2;
  margin: 0 0 12px;
}

.brand-body p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 32px;
}

.brand-feats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.4;
}

.brand-feat-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-footer {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: auto;
  padding-top: 24px;
}

/* ── Right form panel ─────────────────────────────────────── */
.auth-form-panel {
  background: var(--bg-form);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  min-height: 100vh;
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--form-ink-3);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.auth-back:hover { color: var(--brand); }

.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--form-ink-1);
  margin: 0 0 8px;
  line-height: 1.15;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--form-ink-3);
  line-height: 1.55;
  margin: 0 0 28px;
}

/* ── Form controls (shared with .form-group etc.) ─────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--form-ink-2);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--form-ink-1);
  background: #fff;
  border: 1.5px solid var(--line-form-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ── Password wrapper ─────────────────────────────────────── */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-control {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--form-ink-4);
  display: grid;
  place-items: center;
  transition: color 0.15s;
}
.password-toggle:hover { color: var(--form-ink-2); }

/* ── Strength bar ─────────────────────────────────────────── */
.strength-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: 6px;
  background: var(--line-form);
  transition: background 0.3s, width 0.3s;
}
.strength-bar[data-level="1"] { background: var(--neg); width: 25%; }
.strength-bar[data-level="2"] { background: var(--warn); width: 50%; }
.strength-bar[data-level="3"] { background: oklch(0.72 0.16 152); width: 75%; }
.strength-bar[data-level="4"] { background: var(--pos); width: 100%; }

/* ── Primary button (auth-shell variant) ──────────────────── */
.btn-primary-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  background: var(--brand);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-sizing: border-box;
  margin-top: 8px;
}
.btn-primary-auth:hover {
  background: var(--brand-2);
  box-shadow: 0 4px 18px var(--brand-glow);
}
.btn-primary-auth:active { transform: scale(0.98); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 40px 24px; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 32px 20px; }
  .auth-title { font-size: 22px; }
}
