/* =========================================================
   CaronaConect — Design tokens
   Paleta: roxo profundo sobre quase-preto, traço lilás como
   assinatura (herdado do símbolo carro+pessoa da marca).
   Tipografia: Sora (display) + Inter (corpo) + JetBrains Mono (dados/preço)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg-void: #0D0818;
  --bg-deep: #150C29;
  --bg-surface: #221142;
  --bg-surface-2: #2B1652;
  --bg-elevated: #331D63;

  --line: #362254;
  --line-soft: #251739;

  --purple-500: #7C3AED;
  --purple-400: #9161F5;
  --lilac-300: #C9A6FF;
  --lilac-glow: #A855F7;

  --text-hi: #F5F2FF;
  --text-mid: #C6B9E8;
  --text-low: #8577A8;

  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.12);

  --grad-signature: linear-gradient(135deg, #8B5CF6 0%, #5B21B6 100%);
  --grad-bg: radial-gradient(120% 120% at 15% -10%, #2A1454 0%, #0D0818 55%);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-card: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 1px rgba(201,166,255,0.15), 0 8px 24px rgba(139,92,246,0.25);

  --nav-h: 68px;
  --header-h: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--grad-bg);
  background-color: var(--bg-void);
  color: var(--text-hi);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- utility ---------- */
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--lilac-300);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- header ---------- */
.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 8, 24, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--grad-signature);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-name b { font-weight: 800; color: var(--text-hi); }

.header-action {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
}

/* ---------- main / views ---------- */
.view {
  flex: 1;
  padding: 20px 20px calc(var(--nav-h) + 28px);
  animation: fade-up 0.25s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view, .card, .fab { animation: none !important; transition: none !important; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac-300);
  margin: 0 0 6px;
}
h1.view-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.view-subtitle {
  color: var(--text-mid);
  font-size: 14px;
  margin: 0 0 20px;
}

/* ---------- route path signature (linha de trajeto) ---------- */
.route-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.route-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lilac-300);
  flex-shrink: 0;
}
.route-dot.end { background: var(--purple-400); }
.route-line {
  flex: 1;
  height: 1px;
  min-width: 16px;
  background-image: linear-gradient(90deg, var(--lilac-300) 0 4px, transparent 4px 8px);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  opacity: 0.7;
}
.route-label {
  font-size: 13.5px;
  color: var(--text-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}
.ride-card { display: flex; flex-direction: column; gap: 12px; }
.ride-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ride-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-low);
}
.price-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--lilac-300);
  white-space: nowrap;
}
.ride-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.driver-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-mid);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  color: var(--lilac-300);
  border: 1px solid var(--line);
}
.seats-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  color: var(--success);
}
.seats-pill.full { background: var(--danger-bg); color: var(--danger); }
.seats-pill.low { background: var(--warn-bg); color: var(--warn); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-signature);
  color: #120A24;
  width: 100%;
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-hi);
  border: 1px solid var(--line);
  width: 100%;
}
.btn-ghost {
  background: transparent;
  color: var(--lilac-300);
}
.btn-whatsapp {
  background: #1E5C4F;
  color: #DFFFF3;
  width: 100%;
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-mid);
  margin-bottom: 7px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 15px;
}
.field input::placeholder { color: var(--text-low); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.seat-picker { display: flex; gap: 8px; }
.seat-option {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-surface-2);
  color: var(--text-mid);
  font-family: var(--font-mono);
  cursor: pointer;
}
.seat-option.active {
  border-color: var(--lilac-300);
  color: var(--lilac-300);
  background: rgba(201,166,255,0.08);
}

/* ---------- empty state ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-low);
}
.empty-state svg { margin-bottom: 14px; opacity: 0.6; }
.empty-state p { font-size: 14px; margin: 0; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: var(--nav-h);
  background: rgba(21, 12, 41, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-low);
  font-size: 11px;
  background: none; border: none;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--lilac-300); }

/* ---------- status banner (assinatura) ---------- */
.banner {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.banner-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(251,191,36,0.25); }
.banner-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-hi);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 90%;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- auth screen ---------- */
.auth-hero {
  padding-top: 8vh;
  text-align: center;
  margin-bottom: 32px;
}
.auth-mark {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: var(--grad-signature);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
}
.auth-mark svg { width: 44px; height: 44px; }
.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}
.auth-slogan {
  color: var(--text-mid);
  font-size: 13.5px;
  margin-top: 4px;
  font-style: italic;
}
.role-toggle {
  display: flex;
  background: var(--bg-surface-2);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
}
.role-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-mid);
  padding: 10px 0;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13.5px;
}
.role-toggle button.active {
  background: var(--grad-signature);
  color: #120A24;
}

.loading-dot { display: inline-flex; gap: 4px; }
.loading-dot span {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.1s infinite ease-in-out;
}
.loading-dot span:nth-child(2) { animation-delay: 0.15s; }
.loading-dot span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
