/* ═══════════════════════════════════════════════════════════════
   LegalTranslate — Design Theme
   All visual tokens live here. Add new components using the
   CSS variables below and the component patterns already defined.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #050c18;
  --panel:       #0b1624;
  --panel-2:     #0f1e33;

  /* Text */
  --ink:         #ede8da;
  --ink-2:       #bfb49a;
  --muted:       #66768f;

  /* Borders */
  --line:        rgba(255,255,255,0.07);

  /* Gold accent */
  --gold:        #eec67f;
  --gold-h:      #d4a85e;
  --gold-light:  rgba(238,198,127,0.08);
  --gold-border: rgba(238,198,127,0.25);

  /* Semantic colours */
  --ok:          #86efac;
  --ok-bg:       rgba(134,239,172,0.07);
  --ok-border:   rgba(134,239,172,0.18);
  --bad:         #fca5a5;
  --bad-bg:      rgba(252,165,165,0.07);
  --bad-border:  rgba(252,165,165,0.2);

  /* Warn */
  --warn:        #fde68a;
  --warn-bg:     rgba(253,230,138,0.07);
  --warn-border: rgba(253,230,138,0.2);

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,.4);
  --shadow-md:   0 6px 20px rgba(0,0,0,.5);
  --shadow-lg:   0 24px 64px rgba(0,0,0,.7);

  /* Layout */
  --header-h:    66px;

  /* Shape */
  --radius:      10px;
  --radius-sm:   6px;

  /* Typography */
  --font-display: 'Marcellus', Georgia, serif;
  --font-body:    'Poppins', system-ui, -apple-system, sans-serif;
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

::selection { background: rgba(238,198,127,.3); color: #050c18; }

/* gold-tinted page scrollbar */
html { scrollbar-color: rgba(238,198,127,.22) var(--bg); }
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb {
  background: rgba(238,198,127,.18);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
html::-webkit-scrollbar-thumb:hover { background: rgba(238,198,127,.35); }

body {
  margin: 0;
  /* layered atmosphere: faint gold dawn at the top, cool depth at the corner */
  background:
    radial-gradient(ellipse 90% 55% at 50% -12%, rgba(238,198,127,.05), transparent 60%),
    radial-gradient(ellipse 65% 50% at 88% 112%, rgba(56,98,160,.09), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .brand-name {
  font-family: var(--font-display);
}

/* ── Utilities ───────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex-1   { flex: 1; }
.flex-end { display: flex; gap: 8px; align-items: flex-end; }
.mt-sm    { margin-top: 14px; }

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  /* spinners stay animated — they communicate in-progress state */
  .spinner { animation-duration: .7s !important; }
  /* loader fallbacks: static document, static first glyph, plain title */
  .loader-doc::after, .ld-spark { display: none !important; }
  .glyph-cycle span { animation: none !important; }
  .glyph-cycle span:first-child { opacity: 1 !important; }
  .loader-title {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    animation: none !important;
  }
  .status.info::after { display: none !important; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 1400px) {
  main {
    grid-template-columns: 420px 1fr;
    gap: 28px;
    padding: 36px 40px;
  }
  header { height: 80px; padding: 0 40px; }
  .brand-logo   { width: 185px; }
  .brand-tag    { font-size: 11px; }
  .nav-link     { font-size: 13px; }
  .nav-username { font-size: 13px; }
  .btn-hdr      { font-size: 13px; padding: 5px 14px; }
}

@media (max-width: 900px) {
  header { padding: 0 16px; }
  main   { grid-template-columns: 1fr; padding: 16px; }
  .right-col { gap: 16px; }
  .page-card-body { grid-template-columns: 1fr; }
  .scan-col { border-right: none; border-bottom: 1px solid var(--line); }
  .fields-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .reg-row-2 { grid-template-columns:1fr; }
  .reg-row-3 { grid-template-columns:1fr 1fr; }
  .reg-row-3 .field:last-child { grid-column:1/-1; }
  /* Restore vertical gap between fields when grid collapses to single column */
  .modal-box .reg-row-2 .field + .field,
  .modal-box .reg-row-3 .field + .field { margin-top:14px; }
}

@media (max-width: 640px) {
  .cookie-banner { padding: 16px 20px; }
  .cookie-banner-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1; text-align: center; }
}
