:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(12, 16, 22, .92);
  --panel-2: rgba(18, 23, 31, .86);
  --line: rgba(255,255,255,.105);
  --muted: #9099a8;
  --text: #f5f7fb;
  --red: #ff193c;
  --red-deep: #a9041d;
  --blue: #20a9ff;
  --green: #42df80;
  --yellow: #ffd21f;
  --shadow: 0 22px 80px rgba(0,0,0,.48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255,255,255,.022) 25%, transparent 25%) 0 0/12px 12px,
    linear-gradient(315deg, rgba(255,255,255,.018) 25%, transparent 25%) 0 0/12px 12px,
    radial-gradient(circle at 72% 12%, rgba(255,25,60,.16), transparent 34%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 6, 9, .86);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: baseline; font-size: clamp(25px, 3vw, 34px); font-weight: 850; font-style: italic; letter-spacing: -1.8px; }
.brand span { color: #fff; }
.brand strong { color: var(--red); font-weight: 900; }
.site-header nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); color: #c9ced7; font-size: 14px; font-weight: 650; }
.site-header nav a:hover { color: #fff; }
.nav-button, .button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255,53,82,.55);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #f52243, #b40520);
  box-shadow: inset 0 1px rgba(255,255,255,.2), 0 8px 30px rgba(217,0,35,.22);
  font-weight: 800;
}
.button:hover, .nav-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: rgba(255,255,255,.06); box-shadow: none; }
.button.danger { background: linear-gradient(180deg, #ff2949, #8b0017); }
.button.full { width: 100%; }

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 72px);
  align-items: center;
  overflow: hidden;
  padding: 72px clamp(22px, 7vw, 110px);
  background-image: linear-gradient(90deg, rgba(2,4,7,.95) 0%, rgba(2,4,7,.72) 40%, rgba(2,4,7,.18) 72%, rgba(2,4,7,.6) 100%), url('/assets/buddydrive-background.jpeg');
  background-position: center;
  background-size: cover;
}
.hero::after { position: absolute; inset: auto 0 0; height: 180px; content: ''; background: linear-gradient(transparent, var(--bg)); }
.hero-copy { position: relative; z-index: 2; width: min(690px, 100%); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: #d4d8df; font-size: 12px; font-weight: 800; letter-spacing: .21em; text-transform: uppercase; }
.eyebrow::before { width: 34px; height: 2px; content: ''; background: var(--red); box-shadow: 0 0 15px var(--red); }
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(46px, 7.5vw, 96px); line-height: .96; letter-spacing: -.058em; }
.hero h1 span { color: var(--red); text-shadow: 0 0 34px rgba(255,25,60,.35); }
.hero-copy > p:not(.eyebrow) { max-width: 620px; margin: 26px 0 30px; color: #c4cad3; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-stat { min-width: 126px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,8,12,.58); backdrop-filter: blur(10px); }
.hero-stat strong { display: block; font-size: 18px; }
.hero-stat span { color: var(--muted); font-size: 12px; }

.section { width: min(1220px, calc(100% - 36px)); margin: 0 auto; padding: 88px 0; }
.section-heading { max-width: 720px; margin-bottom: 32px; }
.section-heading h2 { margin: 8px 0 12px; font-size: clamp(32px, 5vw, 56px); line-height: 1.05; letter-spacing: -.04em; }
.section-heading p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.feature-card, .panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(22,27,36,.94), rgba(8,11,16,.96));
  box-shadow: var(--shadow);
}
.feature-card { min-height: 220px; padding: 24px; }
.feature-card::before { position: absolute; inset: 0 auto auto; width: 100%; height: 2px; content: ''; background: linear-gradient(90deg, transparent, var(--red), transparent); opacity: .7; }
.feature-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255,30,65,.34); border-radius: 12px; color: var(--red); background: rgba(255,25,60,.09); font-size: 22px; }
.feature-card h3 { margin: 24px 0 8px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.65; }

.auth-shell { display: grid; min-height: calc(100vh - 72px); grid-template-columns: 1fr minmax(360px, 520px); }
.auth-visual { min-height: 650px; background: linear-gradient(90deg, rgba(3,5,8,.18), rgba(3,5,8,.82)), url('/assets/buddydrive-background.jpeg') center/cover; }
.auth-panel { display: flex; align-items: center; padding: clamp(28px, 5vw, 70px); background: #07090d; }
.auth-card { width: 100%; }
.auth-card h1 { margin: 7px 0 9px; font-size: 40px; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { color: #d8dce3; font-size: 13px; font-weight: 750; }
.field input, .field select {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid #2d333d;
  border-radius: 10px;
  outline: none;
  color: #fff;
  background: #10141b;
}
.field input:focus, .field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,25,60,.12); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; color: #aeb5c0; font-size: 13px; line-height: 1.5; }
.check input { margin-top: 3px; accent-color: var(--red); }
.auth-switch { margin-top: 20px !important; text-align: center; font-size: 14px; }
.auth-switch a, .link { color: #ff6078; font-weight: 700; }

.flash-stack { position: fixed; z-index: 100; top: 86px; right: 18px; display: grid; gap: 8px; width: min(420px, calc(100% - 36px)); }
.flash { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #111720; box-shadow: var(--shadow); }
.flash-success { border-color: rgba(66,223,128,.4); }
.flash-error { border-color: rgba(255,25,60,.45); }

.dashboard { width: min(1500px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 70px; }
.dash-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dash-heading h1 { margin: 4px 0 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.045em; }
.live-pill { display: inline-flex; gap: 8px; align-items: center; color: #b9c0ca; font-size: 13px; font-weight: 750; }
.live-pill::before { width: 9px; height: 9px; content: ''; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(66,223,128,.1), 0 0 16px var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 7px; font-size: 28px; letter-spacing: -.03em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); gap: 14px; }
.map-panel { min-height: 620px; }
#fleet-map { position: absolute; inset: 0; }
.map-overlay { position: absolute; z-index: 4; top: 15px; left: 15px; display: flex; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,8,12,.85); backdrop-filter: blur(10px); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; color: #cad0d8; font-size: 11px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.side-stack { display: grid; align-content: start; gap: 14px; }
.panel-pad { padding: 20px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-title h2 { margin: 0; font-size: 18px; }
.panel-title small { color: var(--muted); }
.vehicle-list, .trip-list { display: grid; gap: 9px; }
.vehicle-row, .trip-row { display: grid; gap: 6px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.vehicle-row.live { border-color: rgba(66,223,128,.35); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reg { font-weight: 850; letter-spacing: .08em; }
.status { padding: 4px 7px; border-radius: 20px; color: #adb5c1; background: rgba(255,255,255,.07); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.status.live { color: var(--green); background: rgba(66,223,128,.1); }
.row-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.trip-row { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.trip-row:hover, .trip-row.active { border-color: rgba(255,25,60,.42); background: rgba(255,25,60,.055); }
.empty { padding: 30px 12px; color: var(--muted); text-align: center; }
.activation-card { display: grid; gap: 14px; padding: 22px; border: 1px solid rgba(255,25,60,.35); border-radius: 16px; background: linear-gradient(135deg, rgba(255,25,60,.11), rgba(10,13,19,.95)); }
.activation-code { color: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(28px, 5vw, 42px); font-weight: 900; letter-spacing: .1em; text-shadow: 0 0 22px rgba(255,25,60,.45); }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-table { display: grid; gap: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.info-row strong { color: var(--text); text-align: right; }
.content-page { width: min(900px, calc(100% - 36px)); margin: 0 auto; padding: 70px 0 100px; }
.content-page h1 { font-size: clamp(38px, 6vw, 64px); letter-spacing: -.05em; }
.content-page h2 { margin-top: 38px; }
.content-page p, .content-page li { color: #b5bcc7; line-height: 1.75; }
.site-footer { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; padding: 28px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); color: #777f8c; font-size: 12px; }

@media (max-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .map-panel { min-height: 520px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-header { min-height: 64px; padding: 10px 16px; }
  .site-header nav a:not(.nav-button) { display: none; }
  .brand { font-size: 26px; }
  .hero { min-height: calc(100vh - 64px); padding: 58px 22px 80px; background-position: 64% center; }
  .hero::before { position: absolute; inset: 0; content: ''; background: rgba(0,0,0,.25); }
  .feature-grid, .account-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: calc(100vh - 64px); }
  .dash-heading { align-items: flex-start; flex-direction: column; }
  .map-panel { min-height: 450px; }
  .dashboard { width: min(100% - 20px, 1500px); }
}

@media (max-width: 460px) {
  .hero h1 { font-size: 46px; }
  .hero-actions .button { width: 100%; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 23px; }
  .map-overlay { right: 12px; left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
