/* Terra Drive — shared design tokens + base components (A&A Terra Inc).
   Classy dark navy + warm amber. Mobile-first. Used by driver app, marketing, portals. */
:root {
  --navy-950: #060d19;
  --navy-900: #0b1526;
  --navy-850: #0f1c31;
  --navy-800: #13233d;
  --navy-700: #1b3051;
  --navy-600: #274268;
  --navy-500: #3a5a86;
  --ink: #eef2f8;
  --ink-2: #c3cddd;
  --ink-3: #8b9ab3;
  --ink-4: #5d6e8a;
  --amber: #f2a93b;
  --amber-2: #ffc46b;
  --amber-ink: #241503;
  --amber-soft: rgba(242, 169, 59, .14);
  --green: #3ccf8e;
  --green-soft: rgba(60, 207, 142, .14);
  --red: #ff5d5d;
  --red-soft: rgba(255, 93, 93, .14);
  --blue: #6aa8ff;
  --blue-soft: rgba(106, 168, 255, .14);
  --line: rgba(195, 205, 221, .12);
  --line-2: rgba(195, 205, 221, .22);

  --bg: var(--navy-900);
  --surface: var(--navy-850);
  --surface-2: var(--navy-800);
  --surface-3: var(--navy-700);
  --text: var(--ink);
  --muted: var(--ink-3);
  --accent: var(--amber);

  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-s: 0 2px 10px rgba(0, 0, 0, .25);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tap: 52px;
  --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--amber-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 600; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 1.1em; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 1rem/1 var(--font); cursor: pointer; text-decoration: none; user-select: none;
  transition: background .15s, transform .05s, border-color .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--amber); color: var(--amber-ink); border-color: transparent; }
.btn-primary:hover { background: var(--amber-2); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red-soft); color: #ffb3b3; border-color: rgba(255, 93, 93, .35); }
.btn-success { background: var(--green); color: #04150d; border-color: transparent; }
.btn-lg { min-height: var(--tap); font-size: 1.08rem; padding: 0 1.4em; }
.btn-block { display: flex; width: 100%; }

/* Forms */
.field { display: block; margin: 0 0 14px; }
.field > span, .label { display: block; font-size: .88rem; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--navy-950); color: var(--text);
  font: 16px/1.3 var(--font);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px var(--amber-soft); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--amber); flex: none; }
.help { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.error-text { color: #ffb3b3; font-size: .9rem; }

/* Cards / layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; }
.card + .card { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.pill-amber { background: var(--amber-soft); color: var(--amber-2); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: #ffb3b3; }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.demo-badge {
  position: fixed; top: 10px; left: 10px; z-index: 9999; background: #d62828; color: #fff;
  font: 800 .72rem/1 var(--font); letter-spacing: .12em; padding: 6px 9px; border-radius: 6px;
  box-shadow: var(--shadow-s); pointer-events: none;
}
.founder-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #3a2a0e, #6b4a12); color: #ffd99a; border: 1px solid rgba(255, 196, 107, .45);
  font-weight: 700; font-size: .85rem; letter-spacing: .01em;
}
.founder-badge svg { width: 20px; height: 20px; }

/* Language switcher (i18n.js) */
.lang-switch {
  position: fixed; top: 10px; right: 10px; z-index: 9998; display: flex; gap: 2px;
  background: rgba(11, 21, 38, .88); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--ink-3); font: 700 .74rem/1 var(--font);
  padding: 7px 9px; border-radius: 999px; cursor: pointer; min-width: 34px;
}
.lang-switch button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }
.lang-switch.inline { position: static; display: inline-flex; }

/* Toast */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 10000; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: none; max-width: 480px; background: var(--navy-700); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); font-size: .95rem; animation: toast-in .2s ease-out; }
.toast.err { border-color: rgba(255, 93, 93, .5); }
.toast.ok { border-color: rgba(60, 207, 142, .5); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.draft-label { display: inline-block; background: #4a1414; color: #ffc9c9; border: 1px solid #a33; border-radius: 6px; padding: 4px 8px; font-size: .78rem; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
