:root {
  --bg: #050608;
  --panel: #0d1117;
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.18);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --danger: #fb7185;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  background:
    linear-gradient(115deg, rgba(8, 17, 34, 0.98), rgba(5, 6, 8, 0.98) 46%, rgba(2, 6, 8, 0.98)),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  background-image: url("/assets/hero-car-bg.png");
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  inset: 0;
  opacity: 0.82;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

body::after {
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.12), rgba(5, 6, 8, 0.58) 86%),
    linear-gradient(90deg, rgba(5, 6, 8, 0.34), rgba(5, 6, 8, 0.62) 44%, rgba(5, 6, 8, 0.46));
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

a {
  color: inherit;
}

.site-shell,
.portal-shell {
  padding: 24px;
  width: 100%;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  position: relative;
  z-index: 1;
}

main {
  position: relative;
  z-index: 1;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-img,
.preview-logo {
  display: inline-block;
  height: 44px;
}

.brand-logo-img {
  filter: drop-shadow(0 14px 22px rgba(37, 99, 235, 0.3));
  object-fit: contain;
  width: min(240px, 58vw);
}

.preview-logo {
  width: 36px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand small,
.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topnav {
  align-items: center;
  display: flex;
  gap: 22px;
}

.topnav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.topnav a:hover {
  color: var(--text);
}

.topnav .nav-button,
.button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

.button.primary,
.topnav .nav-button {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.button.ghost,
.button.subtle {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
}

.button.subtle {
  cursor: pointer;
}

.hero {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1.14fr);
  margin: 56px auto 0;
  max-width: 1180px;
  min-height: calc(100vh - 132px);
  min-width: 0;
  position: relative;
  width: 100%;
}

.hero::before {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0), rgba(59, 130, 246, 0.35), rgba(34, 197, 94, 0));
  content: "";
  height: 1px;
  left: 0;
  opacity: 0.8;
  position: absolute;
  right: 0;
  top: 16%;
}

.hero-copy,
.portal-intro,
.auth-card,
.app-preview,
.preview-main,
.metric-card,
.vehicle-card,
.portal-preview {
  min-width: 0;
  max-width: 100%;
}

.hero-copy h1,
.portal-intro h1 {
  font-size: clamp(48px, 7vw, 92px);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 18px 0;
}

.hero-text,
.portal-intro p,
.muted {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0 0;
  padding-top: 18px;
}

.hero-stats div {
  min-width: 0;
}

.hero-stats dt {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-stats dd {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 5px 0 0;
}

.app-preview {
  background: rgba(5, 6, 8, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
  display: grid;
  grid-template-columns: 86px 1fr;
  min-height: 520px;
  overflow: hidden;
  width: 100%;
}

.preview-sidebar {
  background: rgba(0, 0, 0, 0.48);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
}

.preview-logo {
  background-image: url("/assets/servicesnap-icon.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 14px;
  height: 36px;
  margin-bottom: 38px;
  width: 36px;
}

.preview-line {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  display: block;
  height: 10px;
  margin: 18px 0;
}

.preview-line.active {
  background: var(--blue);
}

.preview-line.short {
  width: 62%;
}

.preview-main {
  padding: 26px;
}

.preview-header,
.metric-grid,
.vehicle-grid,
.reminder-strip,
.records-section {
  display: grid;
  gap: 14px;
}

.preview-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.preview-header small,
.metric-card small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-header strong {
  display: block;
  font-size: 26px;
}

.preview-pill {
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  color: #bbf7d0;
  font-size: 12px;
  padding: 6px 10px;
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metric-card,
.vehicle-card,
.auth-card,
.portal-preview,
.feature-band article {
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  font-size: 25px;
  margin: 8px 0 2px;
}

.metric-card span,
.vehicle-card p,
.record-list,
.handoff-note {
  color: var(--muted);
  font-size: 13px;
}

.accent-blue {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.24);
}

.accent-green {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.accent-amber {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.vehicle-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 16px;
}

.vehicle-card {
  min-height: 152px;
  padding: 20px;
  position: relative;
}

.vehicle-card h3 {
  font-size: 22px;
  margin: 34px 0 6px;
}

.reg {
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  position: absolute;
  right: 18px;
  top: 18px;
}

.progress {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  display: block;
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
}

.progress i {
  background: var(--blue);
  display: block;
  height: 100%;
}

.progress-72 i {
  width: 72%;
}

.progress-54 i {
  width: 54%;
}

.reminder-strip {
  align-items: center;
  background: rgba(59, 130, 246, 0.09);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 8px;
  display: flex;
  margin-top: 18px;
  padding: 14px;
}

.status-dot,
.feature-icon {
  background: var(--blue);
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.feature-band {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto 72px;
  max-width: 1180px;
}

.feature-band article {
  padding: 24px;
}

.feature-band h2,
.records-section h2,
.auth-card h2 {
  font-size: 26px;
  letter-spacing: 0;
  margin: 10px 0;
}

.feature-band p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.feature-icon {
  height: 14px;
  width: 14px;
}

.feature-icon.green {
  background: var(--green);
}

.feature-icon.amber {
  background: var(--amber);
}

.records-section {
  align-items: start;
  border-top: 1px solid var(--line);
  grid-template-columns: 0.8fr 1fr;
  margin: 0 auto 72px;
  max-width: 1180px;
  padding-top: 42px;
}

.records-section h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.record-list {
  line-height: 1.8;
  margin: 0;
}

.portal-layout {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 480px);
  margin: 0 auto;
  max-width: 1040px;
  min-height: calc(100vh - 48px);
  min-width: 0;
  width: 100%;
}

.portal-shell::after {
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.14), rgba(5, 6, 8, 0.66)),
    linear-gradient(90deg, rgba(5, 6, 8, 0.5), rgba(5, 6, 8, 0.76));
}

.portal-intro .brand {
  margin-bottom: 56px;
}

.portal-intro h1 {
  font-size: clamp(46px, 6vw, 76px);
}

.portal-preview {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding: 18px;
}

.portal-preview-row {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  height: 10px;
}

.portal-preview-row.medium {
  width: 78%;
}

.portal-preview-row.short {
  width: 56%;
}

.auth-card {
  min-height: 360px;
  padding: 32px;
}

#signedInBox {
  display: none;
}

.google-control {
  margin-top: 22px;
  min-height: 44px;
  max-width: 100%;
  overflow: hidden;
}

.google-control > div,
.google-control iframe {
  max-width: 100% !important;
}

.error-box {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 8px;
  color: #fecdd3;
  display: none;
  margin-top: 18px;
  padding: 12px;
  white-space: pre-wrap;
}

@media (max-width: 920px) {
  .site-shell,
  .portal-shell {
    padding: 18px;
  }

  .topbar,
  .topnav,
  .hero-actions,
  .portal-actions {
    align-items: flex-start;
  }

  .topbar {
    gap: 18px;
  }

  .topnav {
    gap: 12px;
    width: 100%;
  }

  .hero,
  .portal-layout,
  .records-section {
    grid-template-columns: 1fr;
  }

  .hero {
    margin-top: 42px;
  }

  .app-preview {
    grid-template-columns: 64px 1fr;
    min-height: 460px;
  }

  .metric-grid,
  .vehicle-grid,
  .feature-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-shell,
  .portal-shell {
    padding: 18px 0;
  }

  .topbar,
  .topnav {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav a {
    min-height: 36px;
  }

  .topnav .nav-button,
  .hero-actions .button,
  .portal-actions .button {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero,
  .portal-layout,
  .feature-band,
  .records-section,
  .hero-copy,
  .portal-intro,
  .app-preview,
  .auth-card,
  .portal-preview {
    max-width: calc(100vw - 36px);
    width: min(280px, calc(100vw - 36px));
  }

  .eyebrow,
  .hero-text,
  .portal-intro p,
  .muted {
    overflow-wrap: anywhere;
  }

  .hero-copy h1,
  .portal-intro h1 {
    font-size: 42px;
    overflow-wrap: anywhere;
  }

  .app-preview {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .preview-sidebar {
    display: none;
  }

  .preview-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-main,
  .auth-card {
    padding: 20px;
  }
}
