/* ═══════════════════════════════════════════════════════════════
   TruthLens – Design System v2
   Theme: Deep Navy Blue · Blue-Purple Eye Motif · Red Alert Accents
   Mobile-first · Clean premium finish
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Base – extracted from hero image blues */
  --bg-0: #04090f;        /* deepest background */
  --bg-1: #060e1c;        /* page bg */
  --bg-2: #0b1628;        /* card bg */
  --bg-3: #112040;        /* elevated card */
  --bg-4: #172a52;        /* pill / input bg  */

  /* Surfaces / glass */
  --surface-1: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.08);
  --border-hi: rgba(255,255,255,0.15);

  /* Core accents – pulled from the eye imagery */
  --blue:        #3b82f6;
  --blue-dim:    rgba(59,130,246,0.18);
  --blue-glow:   rgba(59,130,246,0.35);
  --blue-bright: #60a5fa;

  --purple:      #8b5cf6;
  --purple-dim:  rgba(139,92,246,0.20);

  --cyan:        #06b6d4;
  --cyan-dim:    rgba(6,182,212,0.15);

  /* Alert red – from warning triangles in reference image */
  --red-alert:   #dc2626;
  --red-dim:     rgba(220,38,38,0.18);
  --red-glow:    rgba(220,38,38,0.28);

  /* Semantic verdicts */
  --green:     #10b981;
  --green-dim: rgba(16,185,129,0.15);
  --red:       #ef4444;
  --amber:     #f59e0b;
  --amber-dim: rgba(245,158,11,0.15);
  --muted:     #4a6080;

  /* Text */
  --text-0: #e8f0ff;
  --text-1: #9ab0d0;
  --text-2: #5a7095;
  --text-3: #2e4060;

  /* Type */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-head: 'Outfit', 'Inter', system-ui, sans-serif;

  /* Layout */
  --max-w: 440px;
  --shell-px: 20px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --ring-circumference: 314.16px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  background: var(--bg-1);
  color: var(--text-0);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; }
input[type="file"] { display: none; }

/* ── SPA Views ───────────────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.30s ease, transform 0.30s ease;
  -webkit-overflow-scrolling: touch;
}
.view.active {
  position: relative;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── App shell ───────────────────────────────────────────────── */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--shell-px) 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════ HOME */

/* Full-bleed home wrapper */
.home-full {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Hero panel ──────────────────────────────────────────────── */
.hero-panel {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  flex-shrink: 0;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
/* Gradient fade so image blends into the content below */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(4,9,15,0.05) 0%,
    rgba(4,9,15,0.25) 55%,
    rgba(6,14,28,0.95) 100%
  );
}

/* Floating warning badges – mirroring the reference image ⚠ */
.warn-badge {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(220,38,38,0.20);
  border: 1.5px solid rgba(220,38,38,0.55);
  color: #ef4444;
  box-shadow: 0 0 14px rgba(220,38,38,0.30);
  animation: warn-float 3s ease-in-out infinite;
}
.warn-badge--tl { top: 22px;  left: 24px;  animation-delay: 0s; }
.warn-badge--tr { top: 30px;  right: 20px; animation-delay: 1.1s; }
.warn-badge--bl { bottom: 48px; left: 36px;  animation-delay: 0.6s; }
@keyframes warn-float {
  0%, 100% { transform: translateY(0);   opacity: 0.85; }
  50%       { transform: translateY(-5px); opacity: 1; }
}

/* ── Home content ────────────────────────────────────────────── */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--shell-px) 36px;
}

/* Brand */
.home-header { padding-top: 20px; margin-bottom: 10px; }
.brand {
  font-family: var(--font-head);
  font-size: clamp(36px, 11vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
}
.brand-truth { color: var(--text-0); }
.brand-lens  { color: var(--blue-bright); }
.brand-tagline {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--text-3);
}

.home-description {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Threat bar */
.threat-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  margin-bottom: 20px;
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-sm);
}
.threat-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  flex-shrink: 0;
  animation: dot-blink 2.2s ease-in-out infinite;
}
@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.threat-bar__text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-2);
}

/* Action cards */
.action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px 10px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-0);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.action-card:hover::before, .action-card:focus-visible::before { opacity: 1; }
.action-card:hover, .action-card:focus-visible {
  transform: translateY(-3px);
  outline: none;
}
.action-card--image { border-color: rgba(59,130,246,0.35); }
.action-card--image::before {
  background: radial-gradient(ellipse at top, rgba(59,130,246,0.14), transparent 70%);
}
.action-card--image:hover {
  border-color: rgba(59,130,246,0.70);
  box-shadow: 0 6px 28px rgba(59,130,246,0.22), 0 0 0 1px rgba(59,130,246,0.20);
}
.action-card--audio { border-color: rgba(139,92,246,0.35); }
.action-card--audio::before {
  background: radial-gradient(ellipse at top, rgba(139,92,246,0.14), transparent 70%);
}
.action-card--audio:hover {
  border-color: rgba(139,92,246,0.70);
  box-shadow: 0 6px 28px rgba(139,92,246,0.22), 0 0 0 1px rgba(139,92,246,0.20);
}

/* Tiny type badge at top of card */
.action-card__badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(59,130,246,0.15);
  color: var(--blue-bright);
  border: 1px solid rgba(59,130,246,0.35);
}
.action-card__badge--audio {
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  border-color: rgba(139,92,246,0.35);
}

.action-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-card--image .action-card__icon {
  background: var(--blue-dim);
  color: var(--blue-bright);
}
.action-card--audio .action-card__icon {
  background: var(--purple-dim);
  color: #a78bfa;
}
.action-card__icon svg { width: 22px; height: 22px; }
.action-card__title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}
.action-card__sub {
  font-size: 10px;
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.2px;
}

/* Home footer */
.home-footer {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
}

/* ════════════════════════════════════ IMAGE / AUDIO scan views */

/* Top nav */
.top-nav {
  display: flex;
  align-items: center;
  padding: 20px 0 8px;
  gap: 12px;
}
.btn-back {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  flex-shrink: 0;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.btn-back:hover { background: var(--bg-3); border-color: var(--border-hi); color: var(--text-0); }
.btn-back svg { width: 20px; height: 20px; }
.top-nav__title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-0);
}
.top-nav__spacer { flex: 1; }

/* Upload zone */
.upload-zone {
  margin-top: 16px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(59,130,246,0.30);
  background: var(--bg-2);
  min-height: 188px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: rgba(59,130,246,0.65);
  background: rgba(59,130,246,0.05);
}
.upload-zone--audio { border-color: rgba(139,92,246,0.30); }
.upload-zone--audio:hover, .upload-zone--audio.drag-over {
  border-color: rgba(139,92,246,0.65);
  background: rgba(139,92,246,0.05);
}

.upload-zone__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.upload-zone__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--blue-dim);
  color: var(--blue-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.upload-zone__icon--audio { background: var(--purple-dim); color: #a78bfa; }
.upload-zone__icon svg { width: 26px; height: 26px; }
.upload-zone__title { font-weight: 600; font-size: 15px; color: var(--text-1); }
.upload-zone__sub   { font-size: 12px; color: var(--text-2); }

.upload-preview {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 220px;
  border-radius: calc(var(--radius-lg) - 2px);
}
.upload-preview.visible { display: block; }

/* Waveform */
.waveform-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  width: 100%;
}
#waveform-canvas { width: 100%; height: 72px; }
.waveform-filename { font-size: 12px; color: var(--text-2); text-align: center; word-break: break-all; }

/* File info strip */
.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.file-info__icon { width: 16px; height: 16px; color: var(--blue-bright); flex-shrink: 0; }
.file-info__name {
  font-size: 13px;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-info__size { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Section label */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 22px 0 10px;
}

/* Model pills */
.model-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.model-pill {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  transition: all 0.16s ease;
}
.model-pill:hover { background: var(--bg-3); color: var(--text-1); border-color: var(--border-hi); }
.model-pill.active {
  background: var(--blue-dim);
  border-color: rgba(59,130,246,0.55);
  color: var(--blue-bright);
  font-weight: 600;
}

/* Progress */
.progress-wrap { margin-top: 16px; }
.progress-label { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.progress-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.15s ease;
}
.progress-fill--audio {
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

/* Analyze button */
.btn-analyze {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-md);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
  box-shadow: 0 4px 20px rgba(59,130,246,0.35);
  transition: opacity 0.2s, transform 0.18s, box-shadow 0.18s;
}
.btn-analyze svg { width: 18px; height: 18px; }
.btn-analyze:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59,130,246,0.45);
}
.btn-analyze:active:not(:disabled) { transform: translateY(0); }
.btn-analyze:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-analyze--audio {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #3b82f6 100%);
  box-shadow: 0 4px 20px rgba(139,92,246,0.35);
}
.btn-analyze--audio:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(139,92,246,0.45);
}

/* ════════════════════════════════════════════════════ RESULT */

.verdict-card {
  margin-top: 12px;
  padding: 28px 20px 24px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 2px solid var(--border);
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}
.verdict-card.verdict--real    { border-color: var(--green); background: var(--green-dim); box-shadow: 0 0 32px rgba(16,185,129,0.18); }
.verdict-card.verdict--ai      { border-color: var(--red);   background: var(--red-dim);   box-shadow: 0 0 32px rgba(239,68,68,0.18); }
.verdict-card.verdict--uncertain { border-color: var(--amber); background: var(--amber-dim); box-shadow: 0 0 32px rgba(245,158,11,0.18); }
.verdict-card.verdict--error   { border-color: var(--muted); }

.verdict-icon { font-size: 40px; line-height: 1; }
.verdict-label {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.verdict-card.verdict--real      .verdict-label { color: var(--green); }
.verdict-card.verdict--ai        .verdict-label { color: var(--red); }
.verdict-card.verdict--uncertain .verdict-label { color: var(--amber); }
.verdict-card.verdict--error     .verdict-label { color: var(--muted); }
.verdict-sublabel { font-size: 13px; color: var(--text-2); text-align: center; }

/* Confidence ring */
.confidence-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.confidence-ring-wrap {
  position: relative;
  width: 106px;
  height: 106px;
  flex-shrink: 0;
}
.confidence-ring { width: 106px; height: 106px; transform: rotate(-90deg); }
.confidence-ring__track { fill: none; stroke: var(--bg-3); stroke-width: 10; }
.confidence-ring__fill {
  fill: none;
  stroke: var(--blue);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: var(--ring-circumference);
  transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1), stroke 0.4s;
}
.confidence-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.confidence-pct {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-0);
  line-height: 1;
}
.confidence-pct-label { font-size: 9px; color: var(--text-3); letter-spacing: 1px; margin-top: 2px; }
.confidence-meta { flex: 1; }
.confidence-desc  { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.confidence-model { font-size: 12px; color: var(--text-2); }

/* Features */
.features-list { display: flex; flex-direction: column; gap: 8px; }
.feature-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.feature-row__label {
  font-size: 12px;
  color: var(--text-1);
  flex: 0 0 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feature-row__bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.feature-row__bar {
  height: 100%;
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.9s cubic-bezier(.4,0,.2,1);
}
.feature-row__pct { font-size: 12px; font-weight: 600; flex: 0 0 34px; text-align: right; }
.bar--red    { background: var(--red); }
.bar--amber  { background: var(--amber); }
.bar--green  { background: var(--green); }
.pct--red    { color: var(--red); }
.pct--amber  { color: var(--amber); }
.pct--green  { color: var(--green); }

/* Result actions */
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}
.btn-primary svg, .btn-secondary svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,0.30);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(59,130,246,0.40); }
.btn-secondary {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1.5px solid var(--border-hi);
}
.btn-secondary:hover { background: var(--bg-3); color: var(--text-0); }

/* ══════════════════════════════════════════════════ RESPONSIVE */

@media (min-width: 540px) {
  body { display: flex; align-items: flex-start; justify-content: center; }
  .view { max-width: var(--max-w); margin: 0 auto; }
  .view.active { position: relative; }
  .home-full { box-shadow: 0 0 80px rgba(59,130,246,0.10); }
}

@media (max-width: 360px) {
  :root { --shell-px: 14px; }
  .brand { font-size: 34px; }
  .hero-panel { height: 230px; }
  .action-cards { gap: 10px; }
  .action-card { padding: 16px 8px; }
  .model-pill { padding: 6px 12px; font-size: 12px; }
  .result-actions { grid-template-columns: 1fr; }
}

/* Very tall phones */
@media (min-height: 800px) {
  .hero-panel { height: 320px; }
}

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ════════════════════════════════════════════════════ AUTH */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--shell-px);
  background: radial-gradient(ellipse at top, rgba(59,130,246,0.08) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-xl);
  padding: 36px 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(59,130,246,0.10);
}

.auth-logo {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.auth-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 20px;
}

/* Error banner */
.auth-error {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.40);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  border-color: rgba(59,130,246,0.70);
  background: var(--bg-4);
}

.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border-radius: var(--radius-md);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
  box-shadow: 0 4px 16px rgba(59,130,246,0.30);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(59,130,246,0.40); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: 0.45; cursor: not-allowed; }

/* Loading spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.auth-link {
  color: var(--blue-bright);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.auth-link:hover { color: #93c5fd; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--text-3, #64748b);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.btn-continue {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(99,102,241,0.45);
  background: transparent;
  color: #a5b4fc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .03em;
  transition: all .2s;
  margin-top: 4px;
}
.btn-continue:hover {
  background: rgba(99,102,241,0.12);
  border-color: #818cf8;
  color: #c7d2fe;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════ USER BAR (home) */

.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  gap: 10px;
}
.user-bar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-bar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1.5px solid rgba(59,130,246,0.45);
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-bar__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-bar__role {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--blue-dim);
  color: var(--blue-bright);
  border: 1px solid rgba(59,130,246,0.35);
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-bar__actions { display: flex; gap: 8px; flex-shrink: 0; }
.user-bar__btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-hi);
  color: var(--text-1);
  background: var(--bg-3);
  transition: background 0.15s, color 0.15s;
}
.user-bar__btn:hover { background: var(--bg-4); color: var(--text-0); }
.user-bar__btn--admin {
  border-color: rgba(59,130,246,0.45);
  color: var(--blue-bright);
  background: var(--blue-dim);
}
.user-bar__btn--admin:hover { background: rgba(59,130,246,0.30); }
.user-bar__btn--logout {
  border-color: rgba(220,38,38,0.40);
  color: #fca5a5;
  background: rgba(220,38,38,0.10);
}
.user-bar__btn--logout:hover { background: rgba(220,38,38,0.20); }

/* ════════════════════════════════════════════════════ ADMIN */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 4px;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-0);
  line-height: 1;
}
.stat-value--green { color: var(--green); }
.stat-value--blue  { color: var(--blue-bright); }
.stat-label { font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; }

.admin-error {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.40);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.users-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-2);
  margin-bottom: 24px;
}

.loading-text {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.users-table thead tr {
  border-bottom: 1px solid var(--border-hi);
}
.users-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  white-space: nowrap;
}
.users-table td {
  padding: 11px 14px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.users-table tbody tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.table-avatar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.table-avatar__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue-bright);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.table-user-name  { font-weight: 600; color: var(--text-0); }
.table-user-email { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }

.role-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.role-badge--admin {
  background: rgba(139,92,246,0.18);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.40);
}
.role-badge--user {
  background: var(--blue-dim);
  color: var(--blue-bright);
  border: 1px solid rgba(59,130,246,0.35);
}

.toggle-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid;
  transition: background 0.15s, opacity 0.15s;
  cursor: pointer;
}
.toggle-btn--deactivate {
  color: #fca5a5;
  border-color: rgba(220,38,38,0.45);
  background: rgba(220,38,38,0.10);
}
.toggle-btn--deactivate:hover { background: rgba(220,38,38,0.22); }
.toggle-btn--activate {
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.45);
  background: rgba(16,185,129,0.10);
}
.toggle-btn--activate:hover { background: rgba(16,185,129,0.22); }

