/* ═══════════════════════════════════════════
   Best Car Agent Ever — Design System
   ═══════════════════════════════════════════ */

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

:root {
  /* Primary palette — deep blue automotive feel */
  --primary: #1a3a5c;
  --primary-rgb: 26, 58, 92;
  --primary-light: #2563eb;
  --primary-dark: #0f2744;
  --primary-gradient: linear-gradient(135deg, #1a3a5c 0%, #2563eb 100%);

  /* Accent — electric orange for CTAs */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-gradient: linear-gradient(135deg, #f97316 0%, #ef4444 100%);

  /* Success / Warning / Error */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Neutrals */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(37,99,235,0.15);

  /* Layout */
  --max-w: 1280px;
  --nav-h: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Timing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; line-height: 1.2; }
a { color: var(--primary-light); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ─── Typography ─────────────────────────── */
.heading-xl { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.025em; }
.heading-lg { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 700; }
.heading-md { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 700; }
.heading-sm { font-size: 1.125rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* ─── Layout ─────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-card); }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-center { justify-content: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ─── Buttons ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.95rem; border: none; transition: all 0.25s var(--ease);
  text-transform: none; letter-spacing: 0;
}
.btn-primary {
  background: var(--accent-gradient); color: white;
  box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(249,115,22,0.45); }
.btn-secondary {
  background: var(--primary-gradient); color: white;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,0.35); }
.btn-outline {
  background: transparent; color: var(--primary); border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); background: var(--info-bg); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 0.5rem 1rem; }
.btn-ghost:hover { color: var(--primary-light); background: var(--border-light); }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Cards ──────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; transition: all 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--primary-light); }
.card-body { padding: 1.5rem; }
.card-img { width: 100%; height: 200px; object-fit: cover; }

/* ─── Navigation ─────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); height: var(--nav-h);
  transition: all 0.3s var(--ease);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; height: 100%; display: flex; align-items: center; justify-content: space-between; position: relative; }
.nav-brand {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.1rem;
  font-family: 'Outfit', sans-serif;
  color: var(--primary);
  text-decoration: none;
  padding: 5px 0;
}
.brand-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transform: scaleX(-1);
  margin-right: -2px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 0.8;
}
.brand-top {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0.8;
  white-space: nowrap;
}
.brand-bottom {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 0.75;
  text-align: justify;
  text-align-last: justify;
  width: 100%;
  margin-top: 1px;
}
.nav-links { display: flex; gap: 0.25rem; list-style: none; }
.nav-links a {
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-weight: 500;
  color: var(--text-secondary); font-size: 0.95rem; transition: all 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--border-light); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-burger { display: none; background: none; border: none; padding: 0.5rem; }
.nav-burger svg { width: 24px; height: 24px; }

/* Mobile Nav */
.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: white; z-index: 99; padding: 1.5rem; flex-direction: column; gap: 0.5rem;
  animation: slideDown 0.3s var(--ease);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block; padding: 1rem; border-radius: var(--radius-sm); font-weight: 500;
  color: var(--text); font-size: 1.1rem; transition: background 0.2s;
}
.mobile-menu a:hover { background: var(--border-light); }

@media (max-width: 992px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-actions .btn { display: none; }
}

/* ─── Hero ────────────────────────────────── */
.hero {
  min-height: 85vh; display: flex; align-items: center; position: relative;
  background: var(--primary-gradient); color: white; overflow: hidden;
  margin-top: var(--nav-h);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(249,115,22,0.15) 0%, transparent 50%),
              radial-gradient(circle at 30% 80%, rgba(37,99,235,0.2) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-content h1 { margin-bottom: 1rem; }
.hero-content p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.15);
  padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.875rem; margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

/* ─── Quick Entry ────────────────────────── */
.quick-entry {
  background: var(--bg-card); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow-lg); position: relative; z-index: 2; margin-top: -3rem;
}
.quick-entry-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.quick-entry-row .form-group { flex: 1; min-width: 200px; }
@media (max-width: 640px) {
  .quick-entry-row .form-group { min-width: 100%; }
  .quick-entry-row .btn { width: 100%; margin-top: 0.5rem; }
}

/* ─── Forms ──────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-weight: 500; font-size: 0.875rem; color: var(--text-secondary); }
.form-input, .form-select {
  padding: 0.75rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 1rem; color: var(--text); transition: all 0.2s var(--ease);
  width: 100%; appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input.border-error, .form-select.border-error {
  border-color: var(--error);
}
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { color: var(--error); font-size: 0.8rem; }
.form-hint { color: var(--text-muted); font-size: 0.8rem; }

.form-check { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] {
  width: 20px; height: 20px; accent-color: var(--primary-light); cursor: pointer;
}

.form-toggle {
  position: relative; display: inline-block; width: 52px; height: 28px;
}
.form-toggle input { display: none; }
.form-toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px;
  transition: 0.3s; cursor: pointer;
}
.form-toggle-slider::before {
  content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: 0.3s; box-shadow: var(--shadow-sm);
}
.form-toggle input:checked + .form-toggle-slider { background: var(--primary-light); }
.form-toggle input:checked + .form-toggle-slider::before { transform: translateX(24px); }

/* ─── Progress Bar ───────────────────────── */
.progress-bar { width: 100%; background: var(--border-light); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-gradient); border-radius: 999px; transition: width 0.5s var(--ease); }

/* ─── Steps Indicator ────────────────────── */
.steps { display: flex; align-items: center; gap: 0; padding: 1.5rem 0; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem; border: 2px solid var(--border); color: var(--text-muted);
  background: var(--bg-card); transition: all 0.3s var(--ease); flex-shrink: 0;
}
.step.active .step-circle { background: var(--primary-light); border-color: var(--primary-light); color: white; }
.step.completed .step-circle { background: var(--success); border-color: var(--success); color: white; }
.step-label { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--primary-light); font-weight: 600; }
.step.completed .step-label { color: var(--success); }
.step-line { width: 32px; height: 2px; background: var(--border); flex-shrink: 0; margin: 0 0.25rem; }
.step.completed + .step-line, .step.completed ~ .step-line { background: var(--success); }

/* ─── Status Badges ──────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-draft { background: #f1f5f9; color: #64748b; }
.badge-submitted { background: #dbeafe; color: #2563eb; }
.badge-processing { background: #fef3c7; color: #d97706; }
.badge-approved { background: #d1fae5; color: #059669; }
.badge-rejected { background: #fee2e2; color: #dc2626; }
.badge-completed { background: #d1fae5; color: #059669; }
.badge-pending { background: #fef3c7; color: #d97706; }

/* ─── Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { background: var(--border-light); padding: 0.875rem 1rem; text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.table td { padding: 0.875rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--border-light); }

/* ─── Footer ─────────────────────────────── */
.footer {
  background: var(--bg-dark); color: rgba(255,255,255,0.7); padding: 4rem 0 2rem;
}
.footer h4 { color: white; margin-bottom: 1rem; font-size: 1rem; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 3rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.85rem; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ─── Utility Classes ────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; } .p-4 { padding: 2rem; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }

/* ─── Value Props ────────────────────────── */
.value-card {
  text-align: center; padding: 2rem 1.5rem; border-radius: var(--radius); background: var(--bg-card);
  border: 1px solid var(--border); transition: all 0.3s var(--ease);
}
.value-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-glow); transform: translateY(-4px); }
.value-icon {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem; background: var(--info-bg); color: var(--primary-light);
}

/* ─── Car Card ───────────────────────────── */
.car-card { cursor: pointer; }
.car-card .card-img { height: 180px; background: var(--border-light); object-fit: contain; padding: 1rem; }
.car-card .card-body { padding: 1.25rem; }
.car-card .car-brand { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.08em; font-weight: 600; margin-bottom: 0.25rem; }
.car-card .car-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.car-card .car-tagline { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.car-card .car-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.car-card .car-monthly { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-top: 0.25rem; }

/* ─── Timeline ───────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -2rem; top: 0.25rem; width: 16px; height: 16px;
  border-radius: 50%; background: var(--border); border: 3px solid var(--bg-card);
}
.timeline-item.active .timeline-dot { background: var(--primary-light); box-shadow: 0 0 0 4px rgba(37,99,235,0.2); }
.timeline-item.completed .timeline-dot { background: var(--success); }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.timeline-event { font-weight: 500; }
.timeline-remark { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ─── Loan Calculator ────────────────────── */
.calc-result {
  background: var(--primary-gradient); color: white; border-radius: var(--radius);
  padding: 2rem; text-align: center;
}
.calc-monthly { font-size: 2.5rem; font-weight: 800; font-family: 'Outfit'; }
.calc-label { font-size: 0.85rem; opacity: 0.8; margin-top: 0.25rem; }

/* ─── Variant Comparison ─────────────────── */
.variant-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.variant-table th { background: var(--border-light); padding: 1rem; text-align: center; font-weight: 600; position: sticky; top: 0; }
.variant-table td { padding: 0.75rem 1rem; text-align: center; border-bottom: 1px solid var(--border); }
.variant-table .recommended { background: rgba(37,99,235,0.04); }
.variant-table .recommended th { background: var(--primary-light); color: white; }

/* ─── 3D Carousel (Featured Cars) ────────── */
.carousel-3d-wrapper {
  position: relative; width: 100%; overflow: hidden; padding: 4rem 0;
  margin: 0 auto; perspective: 1200px;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.carousel-3d-wrapper:active { cursor: grabbing; }
.carousel-3d-container {
  position: relative; height: 480px; width: 100%;
  display: flex; justify-content: center; align-items: center;
  transform-style: preserve-3d;
}
.carousel-item-3d {
  position: absolute; width: 340px; transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d; opacity: 0; pointer-events: none;
  cursor: pointer;
}
.carousel-item-3d.visible { opacity: 1; pointer-events: auto; }
.carousel-item-3d.active { z-index: 50; }

.carousel-fade-l, .carousel-fade-r {
  position: absolute; top: 0; bottom: 0; width: 25vw; z-index: 20;
  pointer-events: none;
}
.carousel-fade-l { left: 0; background: linear-gradient(to right, #ffffff 20%, transparent 100%); }
.carousel-fade-r { right: 0; background: linear-gradient(to left, #ffffff 20%, transparent 100%); }

.carousel-nav {
  display: flex; justify-content: center; gap: 1rem; margin-top: 2rem;
  position: relative; z-index: 30;
}
.carousel-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--border);
  transition: all 0.3s; cursor: pointer;
}
.carousel-dot.active { background: var(--primary-light); width: 24px; border-radius: 5px; }

/* Mobile Portrait Adjustments */
@media (max-width: 900px) {
  .carousel-fade-l, .carousel-fade-r { display: none !important; }
}

@media (max-width: 480px) and (orientation: portrait) {
  .carousel-3d-wrapper { padding: 2rem 0; }
  .carousel-3d-container { height: 400px; }
  /* No edge — hide all cards except active */
  .carousel-item-3d { 
    opacity: 0; pointer-events: none; visibility: hidden; 
    width: calc(100% - 40px) !important; /* Margin from edges */
  }
  .carousel-3d-wrapper.is-dragging .carousel-item-3d { opacity: 1; visibility: visible; }
  .carousel-item-3d.active { opacity: 1; pointer-events: auto; visibility: visible; }
}

/* ─── Loading States ─────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary-light);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}

/* ─── Animations ─────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.animate-slideUp { animation: slideUp 0.5s var(--ease) both; }
.animate-fadeIn { animation: fadeIn 0.4s var(--ease) both; }
.animate-scaleIn { animation: scaleIn 0.3s var(--ease) both; }

/* ─── Stagger delays ─────────────────────── */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ─── Page content offset ────────────────── */
.page-content { margin-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); }

/* ─── Modal ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem;
  overflow-y: auto; backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}
.modal {
  background: var(--bg-card); border-radius: 24px; max-width: 500px; width: 100%;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.3s var(--ease);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  margin-bottom: 2rem;
}
.modal-header { padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-body { padding: 2rem; flex: 1; overflow-y: auto; }
.modal-footer { padding: 1.25rem 2rem; border-top: 1px solid var(--border); background: #fcfdfe; flex-shrink: 0; }
@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card); /* Fix: use defined variable */
  color: var(--text); /* Fix: ensure text is visible */
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}
.auth-modal .modal-header {
  border-bottom: 1px solid var(--border-light);
}
.auth-modal .form-input {
  background: var(--bg);
  border: 1px solid var(--border);
}
.auth-modal .form-input:focus {
  background: var(--bg-card);
}

.hover-underline:hover { text-decoration: underline; }
.py-2-5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.border-dashed { border-style: dashed !important; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.text-error { color: #ef4444; }
.border-error { border-color: #ef4444 !important; }

/* --- File Upload Styles --- */
.file-upload-group {
    margin-bottom: 0.5rem;
}
.file-drop {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.file-drop:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}
.file-drop.active {
    border-color: var(--success);
    background: rgba(var(--success-rgb), 0.05);
    border-style: solid;
}
.file-drop input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-drop .text-xs {
    color: var(--text-muted);
    font-weight: 500;
}
.file-drop.active .text-xs {
    color: var(--success);
}
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
/* Auth & Profile */
.user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}
.user-pill:hover {
    background: rgba(255, 255, 255, 0.15);
}
.logout-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fca5a5;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    background: none;
    cursor: pointer;
}
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--muted);
    font-size: 0.75rem;
    margin: 1rem 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.divider span {
    padding: 0 0.75rem;
}
.auth-modal {
    animation: authPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes authPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Overlay Base */
/* Modal utilities consolidated above */

/* ─── Tabs ───────────────────────────────── */
.tabs { 
  display: flex; 
  border-bottom: 2px solid var(--border); 
  gap: 0; 
  overflow-x: auto; 
  overflow-y: hidden; 
}
.tabs::-webkit-scrollbar { display: none; }
.tabs { -ms-overflow-style: none; scrollbar-width: none; }
.tab {
  padding: 0.75rem 1.5rem; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: all 0.2s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

/* ─── Toast ──────────────────────────────── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 300;
  background: var(--bg-dark); color: white; padding: 1rem 1.5rem;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease); font-size: 0.9rem;
  max-width: 360px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }

/* ─── Color Swatches ─────────────────────── */
.color-swatches { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: all 0.2s; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-light); }

/* ─── Price Display ──────────────────────── */
.price-display { font-family: 'Outfit'; font-weight: 700; }
.price-rm { font-size: 0.85em; }

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .hero { min-height: 60vh; text-align: center; }
  .hero-content { margin: 0 auto; }
  .hero-content h1 { font-size: 2.25rem; line-height: 1.1; }
  .hero-content p { font-size: 1rem; }
  .hero-actions { justify-content: center; }
  .hero-actions .btn { width: 100%; }
  .quick-entry { padding: 1.5rem; margin-top: -2rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps { gap: 0.5rem; }
  .step-label { display: none; }
}
/* Calculator Specials */
.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 250px; transition: stroke-dasharray 0.6s var(--ease); }
circle { transition: stroke-dasharray 0.6s var(--ease); }
@media (max-width: 640px) { .no-scrollbar::-webkit-scrollbar { display: none; } .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; } } .tab-btn { padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: bold; border-bottom: 2px solid transparent; transition: all 0.2s; background: none; border: none; cursor: pointer; color: var(--text-secondary); } .tab-btn.active { border-bottom-color: var(--primary-light); color: var(--primary-light); } .tab-btn:hover { background: rgba(var(--primary-rgb), 0.05); }
/* ─── Premium Utilities & Components ─────── */
.p-0 { padding: 0 !important; } .p-2 { padding: 0.5rem !important; } .p-3 { padding: 0.75rem !important; } .p-4 { padding: 1rem !important; } .p-6 { padding: 1.5rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; } .py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.mt-1 { margin-top: 0.25rem !important; } .mt-2 { margin-top: 0.5rem !important; } .mt-3 { margin-top: 0.75rem !important; } .mt-4 { margin-top: 1rem !important; } .mt-6 { margin-top: 1.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; } .mb-2 { margin-bottom: 0.5rem !important; } .mb-4 { margin-bottom: 1rem !important; }
.w-full { width: 100% !important; } .w-10 { width: 2.5rem !important; } .h-10 { height: 2.5rem !important; }
.rounded-sm { border-radius: 4px !important; } .rounded { border-radius: 8px !important; } .rounded-xl { border-radius: 16px !important; }
.border { border: 1px solid var(--border) !important; } .border-b { border-bottom: 1px solid var(--border) !important; } .border-0 { border: 0 !important; }
.bg-white { background-color: #ffffff !important; } .bg-muted-light { background-color: var(--border-light) !important; }
.text-primary { color: var(--primary-light) !important; } .text-muted { color: var(--text-secondary) !important; }
.text-xs { font-size: 0.75rem !important; } .text-sm { font-size: 0.875rem !important; }
.font-bold { font-weight: 700 !important; } .font-medium { font-weight: 500 !important; }
.uppercase { text-transform: uppercase !important; } .tracking-widest { letter-spacing: 0.1em !important; }
.col-span-2 { grid-column: span 2 / span 2 !important; }
.p-8 { padding: 2rem !important; } .p-10 { padding: 2.5rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; } .px-10 { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; } .py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.tab-btn { 
  padding: 0.75rem 1.25rem; font-size: 0.75rem; font-weight: 700; 
  border-bottom: 2px solid transparent; transition: all 0.2s; 
  background: none; border: none; cursor: pointer; color: var(--text-secondary);
  white-space: nowrap; 
}
.tab-btn.active { border-bottom-color: var(--primary-light); color: var(--primary-light); }
.tab-btn:hover { background: rgba(var(--primary-rgb), 0.05); }

.detail-group { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem; transition: all 0.3s var(--ease); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.detail-group:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.detail-label { font-size: 9px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; display: block; opacity: 0.7; }
.detail-value { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.detail-icon { 
  width: 40px; height: 40px; background: var(--bg-secondary); 
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--primary-light); font-size: 1.25rem;
}

/* Premium Modal Components */
.card-premium {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}
.tab-pill {
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tab-pill.active {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}
.tab-pill:not(.active):hover {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.chassis-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
}
.chassis-id {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--primary-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rounded-t { border-top-left-radius: var(--radius) !important; border-top-right-radius: var(--radius) !important; }
.rounded-b { border-bottom-left-radius: var(--radius) !important; border-bottom-right-radius: var(--radius) !important; }
.pl-8 { padding-left: 2rem !important; }
.pr-8 { padding-right: 2rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.pb-6 { padding-bottom: 1.5rem !important; }

/* --- Bank Selection --- */
.bank-option { cursor: pointer; display: block; }
.bank-option.active .bank-card { border-color: var(--primary-light); background: rgba(37,99,235,0.05); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.bank-card { border: 2px solid var(--border-light); border-radius: var(--radius); padding: 1.25rem; text-align: center; transition: all 0.2s var(--ease); background: white; }
.bank-icon { font-size: 1.5rem; font-weight: 800; color: var(--primary-light); margin-bottom: 0.5rem; background: var(--border-light); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-left: auto; margin-right: auto; transition: all 0.2s; }
.bank-name { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.bank-option.active .bank-icon { background: var(--primary-light); color: white; }

/* --- Admin Additions --- */
.comm-log { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 0.5rem; }
.comm-log-time { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 2px; }
.comm-log-msg { font-size: 0.8rem; line-height: 1.4; color: var(--text); }
.whatsapp-badge { background: #25d366; color: white; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }

/* ─── Car Detail Premium Components ──────── */
.variant-card { transition: all 0.2s var(--ease); border: 2px solid var(--border-light) !important; margin-bottom: 0.5rem; }
.variant-card:hover { border-color: var(--primary-light) !important; background: rgba(var(--primary-rgb), 0.02); }
.variant-card.active { border-color: var(--primary-light) !important; background: rgba(var(--primary-rgb), 0.05) !important; box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.1); }

.color-swatches-labeled { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.color-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; cursor: pointer; transition: all 0.2s; min-width: 60px; }
.color-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px var(--border); transition: all 0.2s; }
.color-name { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); text-align: center; }
.color-item.active .color-dot { transform: scale(1.15); box-shadow: 0 0 0 2px var(--primary-light); }
.color-item.active .color-name { color: var(--primary-light); }
.color-item:hover .color-dot { transform: scale(1.1); }

.config-section { margin-bottom: 1.5rem; }
.sticky-cta { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border); z-index: 50; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 -4px 20px rgba(0,0,0,0.05); }

@media (min-width: 1024px) {
  .sticky-cta { display: none !important; }
}
.sticky-cta { 
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s; 
}
[x-cloak] { display: none !important; }

/* ─── Video Hero ────────────── */
.video-hero {
  position: relative; width: 100%; height: 60vh; background: #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.video-hero video {
  position: absolute; top: 50%; left: 50%; min-width: 100%; min-height: 100%;
  width: auto; height: auto; transform: translate(-50%, -50%); object-fit: cover;
}
.video-hero-overlay {
  position: absolute; inset: 0; 
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}
.video-hero-content { position: relative; z-index: 2; text-align: center; color: #fff; pointer-events: none; }
.hero-bottom-left { position: absolute; bottom: 3.5rem; left: 4rem; z-index: 10; transform: translateZ(0); }
.hero-bottom-right { position: absolute; bottom: 3.5rem; right: 4rem; z-index: 10; text-align: right; transform: translateZ(0); }
.hero-emblem { height: 70px; width: auto; margin-bottom: 0.75rem; object-fit: contain; }
.hero-king-text { font-size: 2.25rem; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; text-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.hero-price-hint { font-size: 0.8rem; font-weight: 800; color: #fff; margin-bottom: 0.75rem; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-btn-brochure { 
  display: inline-flex; align-items: center; padding: 0.75rem 2rem; 
  border: 1.5px solid rgba(255,255,255,0.8); border-radius: 10px; 
  color: #fff; font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
  background: rgba(0,0,0,0.2); backdrop-filter: blur(8px); transition: all 0.3s;
}
.hero-btn-brochure:hover { background: #fff; color: #000; border-color: #fff; }

@media (max-width: 768px) {
  .video-hero { height: 85vh; }
  .hero-bottom-left { bottom: 1.5rem; left: 1.5rem; }
  .hero-bottom-right { bottom: 1.5rem; right: 1.5rem; }
  .hero-emblem { height: 40px; }
  .hero-king-text { font-size: 1.25rem; }
  .hero-price-hint { font-size: 0.7rem; margin-bottom: 0.5rem; }
  .hero-btn-brochure { padding: 0.5rem 1rem; font-size: 0.7rem; }
}

/* Refined Config Section Spacing */
.config-grid { display: flex; flex-direction: column; gap: 2rem; }

@media (min-width: 1024px) {
  .config-grid { 
    display: grid !important; 
    grid-template-columns: repeat(12, 1fr) !important; 
    gap: 4rem !important; 
    align-items: center;
  }
  .config-grid-left { grid-column: span 7 / span 7; }
  .config-grid-right { grid-column: span 5 / span 5; }
}

.config-media-card { background: #fff; border-radius: 32px; border: 1.5px solid #f1f5f9; box-shadow: 0 10px 40px rgba(0,0,0,0.04); padding: 2.5rem; }

/* ─── Clean Style Refinements (Screenshot-Perfect) ────────────── */
.clean-header { margin-bottom: 2rem; }
.clean-header h2 { font-size: 2.25rem; font-weight: 800; color: #1e293b; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.clean-header p { font-size: 1rem; color: #64748b; font-weight: 500; line-height: 1.6; }

.config-label { 
  font-size: 0.7rem; font-weight: 800; color: #94a3b8; 
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; display: block; 
}

.variant-btns { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.variant-btn {
  padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 700; font-size: 0.9rem;
  border: 1.5px solid #e2e8f0; background: #fff; color: #334155;
  transition: all 0.2s var(--ease); cursor: pointer; min-width: 100px; text-align: center;
}
.variant-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.variant-btn.active { 
  background: #f97316; border-color: #f97316; color: #fff;
  box-shadow: 0 6px 16px rgba(249,115,22,0.3); transform: translateY(-1px);
}

.color-dots { display: flex; gap: 0.75rem; margin-bottom: 2.5rem; }
.color-dot-wrap { position: relative; cursor: pointer; padding: 4px; }
.color-dot-inner { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #e2e8f0; transition: all 0.2s; }
.color-dot-wrap.active { border: 3px solid #3b82f6; border-radius: 50%; }
.color-dot-wrap:hover .color-dot-inner { transform: scale(1.1); }

.price-card-clean {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 20px; padding: 1.5rem 2rem;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.price-card-info { display: flex; flex-direction: column; gap: 4px; }
.price-card-label { font-size: 0.95rem; font-weight: 800; color: #1e293b; }
.price-card-sub { font-size: 0.75rem; color: #94a3b8; font-weight: 600; }
.price-card-value { font-size: 1.5rem; font-weight: 800; color: #2563eb; }

/* Specs Feature Grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.feature-card {
  padding: 1.25rem; background: white; border: 1px solid var(--border-light); 
  border-radius: 16px; text-align: center; transition: all 0.3s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.feature-icon-lg { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.feature-label { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.05em; margin-bottom: 2px; }
.feature-val { font-size: 0.9rem; font-weight: 700; color: var(--primary-dark); }

