*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  /* Huuzy brand */
  --bg:           #FAFAF7;
  --bg-warm:      #F3F0EA;
  --text-primary: #1A1A18;
  --text-secondary:#6B6860;
  --text-muted:   #9C9889;
  --accent:       #C85A2A;
  --accent-rgb:   200, 90, 42;
  --accent-light: #E8744A;
  --accent-bg:    #FFF4EF;
  --card-bg:      #FFFFFF;
  --border:       #E5E2DB;
  --green:        #3A7D5C;
  --green-rgb:    58, 125, 92;
  --green-bg:     #EEF6F1;

  /* Bootstrap mapped to Huuzy tokens */
  --bs-primary:           var(--accent);
  --bs-primary-rgb:       var(--accent-rgb);
  --bs-link-color:        var(--accent);
  --bs-link-color-rgb:    var(--accent-rgb);
  --bs-link-hover-color:  var(--accent-light);
  --bs-success:           var(--green);
  --bs-success-rgb:       var(--green-rgb);
  --bs-body-bg:           var(--bg);
  --bs-body-color:        var(--text-primary);
  --bs-body-font-family:  'DM Sans', sans-serif;
  --bs-secondary-color:   var(--text-secondary);
  --bs-tertiary-color:    var(--text-muted);
  --bs-border-color:      var(--border);
  --bs-card-bg:           var(--card-bg);
  --bs-card-border-color: var(--border);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.card-title,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'DM Serif Display', serif;
  letter-spacing: -0.02em;
}

/* ─── Bootstrap overrides ────────────────────────────────────────────────── */
.btn-primary {
  --bs-btn-bg:                  var(--accent);
  --bs-btn-border-color:        var(--accent);
  --bs-btn-hover-bg:            var(--accent-light);
  --bs-btn-hover-border-color:  var(--accent-light);
  --bs-btn-active-bg:           #b34e24;
  --bs-btn-active-border-color: #b34e24;
  --bs-btn-focus-shadow-rgb:    var(--accent-rgb);
}

.navbar {
  background-color: var(--text-primary) !important;
}
.navbar-brand {
  font-family: 'DM Serif Display', serif;
  letter-spacing: -0.02em;
}

.card {
  border-radius: 0.75rem;
}
.card-header {
  border-radius: 0.75rem 0.75rem 0 0 !important;
}

.border-dashed {
  border-style: dashed !important;
  border-color: var(--border) !important;
}

/* ─── Landing: nav ───────────────────────────────────────────────────────── */
nav.landing {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.landing.scrolled { border-bottom-color: var(--border); }

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-cta {
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* ─── Landing: hero ──────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-bg);
  color: var(--green);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2rem;
  width: fit-content;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 800px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.35s forwards;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero h1 em::after {
  content: '';
  position: absolute;
  left: 0; bottom: 4px; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}

/* ─── Landing: form ──────────────────────────────────────────────────────── */
.signup-form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.65s forwards;
}
.signup-form input[type="email"] {
  flex: 1;
  padding: 0.9rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  background: var(--card-bg);
  transition: border-color 0.2s;
  outline: none;
}
.signup-form input[type="email"]:focus { border-color: var(--accent); }
.signup-form input[type="email"]::placeholder { color: var(--text-muted); }

.signup-form button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.signup-form button:hover { background: var(--accent-light); transform: translateY(-1px); }
.signup-form button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.success-msg {
  display: none;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 1rem;
}
.success-msg.show { display: flex; }

.error-msg {
  display: none;
  color: #C43B31;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.error-msg.show { display: block; }

/* ─── Landing: commute card ──────────────────────────────────────────────── */
.hero-visual {
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.6s forwards;
}

.commute-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  transform: rotate(2deg);
}
.commute-card-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.commute-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.commute-row:last-child { border-bottom: none; }

.commute-location { font-weight: 500; font-size: 0.95rem; }
.commute-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.commute-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  flex-shrink: 0;
}
.commute-time.good { background: var(--green-bg); color: var(--green); }
.commute-time.ok   { background: #FFF8EC; color: #B5850A; }
.commute-time.far  { background: #FCEEED; color: #C43B31; }

/* ─── Landing: sections ──────────────────────────────────────────────────── */
section { padding: 6rem 2rem; }

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 3.5rem;
  max-width: 550px;
}

.how-it-works {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-warm);
  border-radius: 28px;
  padding: 4rem 3rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.step-number {
  font-family: 'DM Serif Display', serif;
  font-size: 3.5rem;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.step p  { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

.features { max-width: 1200px; margin: 0 auto; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.feature-icon {
  width: 48px; height: 48px;
  background: var(--accent-bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p  { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }

/* ─── Landing: CTA ───────────────────────────────────────────────────────── */
.cta-section { max-width: 1200px; margin: 0 auto; }
.cta-box {
  background: var(--text-primary);
  border-radius: 28px;
  padding: 4.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.08;
}
.cta-box h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--bg);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  position: relative;
}
.cta-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.cta-box .signup-form {
  max-width: 440px;
  margin: 0 auto;
  position: relative;
  opacity: 1;
  animation: none;
}
.cta-box .signup-form input[type="email"] {
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: white;
}
.cta-box .signup-form input[type="email"]:focus { border-color: var(--accent); }
.cta-box .signup-form input[type="email"]::placeholder { color: rgba(255,255,255,0.35); }
.cta-box .success-msg { justify-content: center; margin-top: 1.25rem; }

/* ─── Landing: footer ────────────────────────────────────────────────────── */
footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ─── Web app: geocode dropdown ──────────────────────────────────────────── */
#geocode-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: .375rem;
  box-shadow: 0 .25rem .5rem rgba(0,0,0,.1);
  background: var(--card-bg);
}
#geocode-dropdown .dropdown-item { padding: .35rem .75rem; white-space: normal; line-height: 1.3; }
#geocode-dropdown .dropdown-item:hover { background-color: var(--bg-warm); }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-visual { display: none; }
  .steps-grid { grid-template-columns: 1fr; gap: 2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 7rem; }
  .how-it-works, .cta-box { padding: 3rem 1.75rem; }
}

@media (max-width: 520px) {
  .signup-form { flex-direction: column; }
  .signup-form button { width: 100%; }
  nav.landing { padding: 1rem 1.25rem; }
}
