:root {
  --bg: #050816;
  --bg-soft: #0f172a;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #f97373;
  --success: #22c55e;
  --border-radius: 16px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.5);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 45%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.site-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.logo {
  display: flex;
  gap: 0.5rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #4ade80);
  display: inline-flex;
  align-items: left;
  justify-content: left;
  font-weight: 700;
  color: #020617;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.logo-img {
  height: 1.25rem;
}
.nav-link {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Hero */

main {
  flex: 1;
}

.hero {
  max-width: 1100px;
  margin: clamp(4rem, 12vh, 7rem) auto 2.5rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin: 0 0 0.75rem;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  max-width: 32rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Waitlist form */

.waitlist-form {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--border-radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.4);
  max-width: 26rem;
}

.waitlist-form h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.waitlist-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-row {
  margin-bottom: 0.75rem;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

input::placeholder {
  color: #6b7280;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}
select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  appearance: none;   /* removes ugly default arrow */
  cursor: pointer;
}

/* Optional: style the dropdown arrow */
select::-ms-expand {
  display: none;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* Desktop (keeps header floating over hero if you want) */
@media (min-width: 700px) {
  .site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
}

/* Mobile (header stays in normal flow so hero moves under it) */
@media (max-width: 699px) {
  .site-header {
    position: relative;
    padding: 1rem 1.2rem;
  }
}


@media (max-width: 699px) {
  .hero {
    display: flex;            /* switch from grid to flex on mobile */
    flex-direction: column;   /* stack vertically */
  }

  .hero-content {
    order: 1;                 /* content/cards first */
  }

  .hero-visual {
    order: 2;                 /* visual below content */
    margin-top: 1.5rem;
  }
}
@media (min-width: 700px) {
  .hero-visual {
     /* padding-top: 4rem; adjust until it looks perfect */
    margin-top: clamp(5rem, 14vh, 8rem); /* more top margin for mobile */
  }
}

/* Buttons */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #4ade80);
  color: #020617;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  box-shadow: 0 10px 25px rgba(34, 197, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 235, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(34, 197, 235, 0.25);
}

/* Hero visual */

.hero-visual {
  display: flex;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 320px;
  background: var(--bg-soft);
  border-radius: var(--border-radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card li {
  font-size: 0.9rem;
  padding: 0.25rem 0;
  color: var(--muted);
}

.card strong {
  color: var(--text);
}

/* Form message */

.form-message {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  height: 1.2em;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ==================== DEMO PAGE STYLES ==================== */

/* Auth Section */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 2rem;
}

.auth-container {
  background: var(--bg-soft);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.3);
  text-align: center;
}

.auth-logo {
  height: 2.5rem;
  margin-bottom: 1.5rem;
}

.auth-container h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
}

.auth-subtitle {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.auth-form {
  text-align: left;
}

/* Calculator Main */
.calculator-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.container {
  width: 100%;
}

.calculator-title {
  text-align: center;
  font-size: 2.5rem;
  margin: 2rem 0;
}

/* Calculator Card */
.calculator-card {
  background: var(--bg-soft);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.15s ease;
}

input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

input[type="number"]:focus,
input[type="password"]:focus,
.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.calculate-btn {
  width: 100%;
  margin-top: 1rem;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results Section */
.result-section {
  margin-bottom: 2rem;
}

.result-section h2 {
  font-size: 1.8rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

/* Vehicle Details */
.details-grid {
  background: var(--bg-soft);
  border-radius: var(--border-radius);
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.comparison-card {
  background: var(--bg-soft);
  border-radius: var(--border-radius);
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  position: relative;
  transition: all 0.2s ease;
}

.comparison-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.comparison-card.highlighted {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(74, 222, 128, 0.05));
}

.best-value-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, #38bdf8, #4ade80);
  color: #020617;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-card h3 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
}

.comparison-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.loan-terms {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Expandable Details */
.expand-btn {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.expand-btn:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--accent);
}

.expand-btn .arrow {
  transition: transform 0.2s ease;
}

.expand-btn.expanded .arrow {
  transform: rotate(180deg);
}

.expandable-content {
  background: var(--bg-soft);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 2rem;
  margin-top: -12px;
}

.expandable-content h3 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.info-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.summary-container {
  background: #020617;
  border-radius: 12px;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Error Banner */
.error-banner {
  background: rgba(249, 115, 115, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  color: var(--danger);
  margin-bottom: 2rem;
  text-align: center;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
  }

  .hero-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  .calculator-title {
    font-size: 2rem;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .calculator-main {
    padding: 1rem;
  }
}
