/* ============================================================================
   TCP 3.0 demo UI — "Continental Control" design system
   Shared tokens + primitives for the Mobile App (light) and Admin Portal (dark).
   Premium German-automotive engineering aesthetic: graphite + Continental orange,
   tyre-tread texture, precise type, tactile motion.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Hanken+Grotesk:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* brand */
  --conti-orange: #ff7a00;
  --conti-orange-deep: #e85d04;
  --conti-amber: #ffb245;
  --conti-ink: #16181d;          /* near-black graphite */
  --conti-ink-2: #2a2e37;

  /* mobile (light) surfaces */
  --sand: #f6f2ec;               /* warm off-white page */
  --paper: #ffffff;
  --paper-2: #fbf8f3;
  --line: #e7e0d6;               /* hairline on sand */
  --ink: #1a1c20;
  --ink-soft: #5d6066;
  --ink-faint: #9a9da3;

  /* status */
  --ok: #1f9d63;
  --ok-soft: #e6f4ec;
  --warn: #d98a00;
  --warn-soft: #fdf2dd;
  --info: #2b6cb0;
  --danger: #c0392b;

  /* type */
  --display: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  /* shape */
  --r-xs: 8px; --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px;
  --r-pill: 999px;

  /* shadow (warm, layered) */
  --sh-1: 0 1px 2px rgba(40,30,15,.06), 0 2px 8px rgba(40,30,15,.05);
  --sh-2: 0 6px 18px rgba(40,30,15,.10), 0 2px 6px rgba(40,30,15,.06);
  --sh-3: 0 22px 50px rgba(30,20,10,.18), 0 8px 18px rgba(30,20,10,.10);
  --sh-orange: 0 10px 30px rgba(255,122,0,.35);

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
}

/* tyre-tread texture: a repeating diagonal "tread block" pattern, used as a
   subtle motif on headers / dividers / empty states */
.tread {
  background-image:
    repeating-linear-gradient(135deg, rgba(0,0,0,.045) 0 6px, transparent 6px 14px);
}
.tread-orange {
  background-image:
    repeating-linear-gradient(135deg, rgba(255,122,0,.18) 0 5px, transparent 5px 13px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- shared primitives ---- */
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.02; }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--conti-orange);
}

.btn {
  font-family: var(--body); font-weight: 700; font-size: 15px;
  border: 0; border-radius: var(--r-pill); padding: 14px 22px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s var(--ease-bounce), box-shadow .2s var(--ease), filter .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--conti-orange); color: #fff; box-shadow: var(--sh-orange); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-dark { background: var(--conti-ink); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-orange { background: rgba(255,122,0,.12); color: var(--conti-orange-deep); border-color: transparent; }

.card {
  background: var(--paper); border-radius: var(--r-md);
  box-shadow: var(--sh-1); border: 1px solid var(--line);
}

/* status dot with live pulse */
.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--ok); opacity: .6; animation: pulse 1.8s var(--ease) infinite;
}
@keyframes pulse { 0%{transform:scale(.6);opacity:.7} 100%{transform:scale(1.8);opacity:0} }

/* staggered entrance — add .reveal and style --d per element */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; animation: rise .6s var(--ease) forwards; animation-delay: var(--d, 0s); }

/* odometer-ish number flip flash */
@keyframes flash-num { 0%{ color: var(--conti-orange); transform: translateY(-3px);} 100%{ color: inherit; transform: none;} }
.num-flash { animation: flash-num .6s var(--ease); }

/* orange scan beam for QR cards */
@keyframes scan { 0%{top:6%} 50%{top:90%} 100%{top:6%} }
.scan-beam {
  position: absolute; left: 8%; right: 8%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--conti-orange), transparent);
  box-shadow: 0 0 16px 3px rgba(255,122,0,.6); animation: scan 2.6s var(--ease) infinite;
}

::selection { background: var(--conti-orange); color: #fff; }
