/* ============================================================
   Rokin — component library
   Reset, typography, and the shared components (nav, footer,
   buttons, cards, forms, badges) for Rokin-native pages.

   Brand tokens live in tokens.css, NOT here. This file consumes
   them and must never define one.

   ⚠️ SCOPE: link this only on Rokin-native pages (register.html).
   The pages carried over from the predecessor are self-contained
   and conflict with the components below — notably .nav-links,
   which is absolutely positioned here and static there. Loading
   base.css into those pages breaks their nav. See Plan.md §13.3
   step A2.

   Load order:
     1. tokens.css    ← brand tokens
     2. base.css      ← this file
     3. page <style>  ← page-specific rules only
     4. mobile.css    ← responsive overrides, wins on small screens
   ============================================================ */

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

body {
  font-family: 'Archivo', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; }
a { color: inherit; }

/* ── Typography scale ────────────────────────────────────────
   Archivo weight rules: headlines 400, subheads 500, body 400.
   UI controls may go 600/700 for emphasis. */
h1 { font-size: 44px; font-weight: 400; line-height: 1.15; letter-spacing: -0.5px; }
h2 { font-size: 28px; font-weight: 500; line-height: 1.25; }
h3 { font-size: 18px; font-weight: 500; line-height: 1.35; }
p, td, li, span, label, input, select, textarea, button { font-family: 'Archivo', sans-serif; }
p { font-weight: 400; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--accent);
}
.section-title { font-size: 28px; font-weight: 500; color: var(--navy); }
.section-sub { font-size: 15px; color: var(--text-secondary); margin-top: 6px; }
.muted { color: var(--text-muted); }

/* ── Brand ────────────────────────────────────────────────────
   The logo itself is .brand-lockup, defined in brand.css and
   shared with the pages carried over from the predecessor. This
   is only the anchor that wraps it.

   The old .brand-wordmark (text "Rokin") and .brand-mark (an
   accent square holding the letter R) were scaffold placeholders
   and were retired when the real lockup landed — the lockup
   already contains both a logomark and a wordmark. */
.brand { display: flex; align-items: center; text-decoration: none; }

/* ── Top navigation ──────────────────────────────────────────
   Solid white bar. Pages with a dark hero add .nav-over to make
   it transparent and overlay the hero instead. */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  height: 68px; padding: 0 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: color var(--t-hover);
  position: relative; padding: 24px 0; display: block;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); font-weight: 700; }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; }

/* Transparent overlay variant, for pages whose hero is dark. */
.top-nav.nav-over {
  position: absolute; left: 0; right: 0; background: transparent;
  border-bottom: none;
  background-image: linear-gradient(to bottom, rgba(34,33,75,0.7) 0%, transparent 100%);
}
.nav-over .nav-links a { color: rgba(255,255,255,0.85); }
.nav-over .nav-links a:hover,
.nav-over .nav-links a.active { color: var(--white); }

/* ── Buttons ─────────────────────────────────────────────────*/
.btn-primary, .btn-secondary, .btn-ghost, .btn-white {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background var(--t-hover), color var(--t-hover), border-color var(--t-hover);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy-mid); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border-hover); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-white { background: rgba(255,255,255,0.12); color: var(--white); border-color: rgba(255,255,255,0.3); }
.btn-white:hover { background: rgba(255,255,255,0.22); }
.btn-lg { padding: 15px 32px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── Cards & surfaces ────────────────────────────────────────*/
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  background: var(--navy); color: var(--white);
  padding: 14px 18px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.card-body { padding: 20px; }

/* ── Badges ──────────────────────────────────────────────────*/
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.4px; border-radius: var(--radius);
}
.badge-accent  { background: var(--accent-tint); color: var(--accent); }
.badge-navy    { background: rgba(34,33,75,0.82); color: var(--white); }
.badge-success { background: rgba(5,150,105,0.12); color: var(--success); }
.badge-outline { border: 1px solid var(--border-hover); color: var(--text-secondary); }

/* Lot number chip — the catalogue's primary identifier. */
.lot-chip {
  display: inline-flex; align-items: center;
  padding: 5px 11px; background: var(--navy); color: var(--white);
  font-size: 12px; font-weight: 700; letter-spacing: 0.8px;
}

/* Play badge on cards that have video. */
.video-badge {
  position: absolute; bottom: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; background: rgba(34,33,75,0.82); color: var(--white);
  font-size: 11px; font-weight: 600;
}

/* ── Forms ───────────────────────────────────────────────────*/
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--navy); margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-hover); border-radius: var(--radius);
  background: var(--white); font-size: 14px; color: var(--text-primary);
  transition: border-color var(--t-focus);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { min-height: 120px; resize: vertical; }
.field-error { border-color: var(--danger) !important; }
.error-msg { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.error-msg.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Honeypot — hidden from humans, catches naive bots. See Plan.md §5. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Layout helpers ──────────────────────────────────────────*/
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 2.5rem; }
.section { padding: 4rem 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 2rem;
}

/* ── Footer ──────────────────────────────────────────────────*/
footer {
  background: var(--navy); color: rgba(255,255,255,0.55);
  padding: 3.5rem 2.5rem 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; max-width: 1200px; margin: 0 auto 2.5rem;
}
.footer-tagline { font-size: 13px; line-height: 1.7; max-width: 300px; margin-top: 10px; }
.footer-col-title {
  font-size: 12px; font-weight: 600; color: var(--white);
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.8px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a {
  text-decoration: none; font-size: 13px; color: rgba(255,255,255,0.55);
  transition: color var(--t-hover);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem;
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 16px; font-size: 12px;
}

/* ── Empty / loading states ──────────────────────────────────
   Every DB-backed region ships with one of these so the page
   never renders as a blank hole while a query is in flight. */
.state {
  padding: 3rem 1.5rem; text-align: center;
  color: var(--text-muted); font-size: 14px;
}
.state-title { font-size: 16px; font-weight: 500; color: var(--navy); margin-bottom: 6px; }
.skeleton {
  background: linear-gradient(90deg, rgba(34,33,75,0.05) 25%, rgba(34,33,75,0.10) 37%, rgba(34,33,75,0.05) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Modal (shared pattern) ──────────────────────────────────*/
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(33,34,70,0.55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-top: 3px solid var(--accent);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 500; color: var(--navy); }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-muted);
}
.modal-body { padding: 24px; }

/* ── Accessibility ───────────────────────────────────────────*/
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
