/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-surface-2: #232736;
  --color-surface-3: #2d3244;
  --color-border: #353b4f;
  --color-text: #e8eaf0;
  --color-text-muted: #8b90a8;
  --color-text-dim: #5c6178;
  --color-primary: #4f8ef7;
  --color-primary-hover: #6ba0f8;
  --color-primary-dim: #2a4a80;
  --color-accent: #f7a84f;
  --color-green: #34d399;
  --color-green-dim: #1a6b4a;
  --color-orange: #fb923c;
  --color-orange-dim: #7c3a10;
  --color-red: #f87171;
  --color-red-dim: #7f2020;
  --color-yellow: #fbbf24;
  --color-yellow-dim: #7a5a10;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --transition: .2s ease;
  --max-width: 1100px;
}

html { scroll-behavior: smooth; scroll-padding-top: 60px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-hover); }

img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 100;
  background: var(--color-primary); color: #fff;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 23, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--color-text); font-weight: 700; font-size: 1.1rem;
  flex-shrink: 0;
}
.logo:hover { color: var(--color-text); }
.logo-icon { color: var(--color-primary); flex-shrink: 0; }
.logo-accent { color: var(--color-primary); }

.main-nav {
  display: flex; gap: 4px; align-items: center;
}
.main-nav a {
  color: var(--color-text-muted); font-size: .875rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.main-nav a:hover { color: var(--color-text); background: var(--color-surface-2); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-sans); font-weight: 600; font-size: .875rem;
  padding: 8px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  line-height: 1.4;
}
.btn-lg { padding: 12px 24px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-surface-2); color: var(--color-text); border-color: var(--color-text-dim); }
.btn-danger-ghost { background: transparent; color: var(--color-red); border-color: var(--color-red-dim); }
.btn-danger-ghost:hover { background: var(--color-red-dim); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: .8rem; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap;
}
.badge-green { background: var(--color-green-dim); color: var(--color-green); }
.badge-red { background: var(--color-red-dim); color: var(--color-red); }
.badge-orange { background: var(--color-orange-dim); color: var(--color-orange); }
.badge-yellow { background: var(--color-yellow-dim); color: var(--color-yellow); }
.badge-blue { background: var(--color-primary-dim); color: var(--color-primary); }

/* ===== Hero ===== */
.hero-section {
  padding: 80px 0 60px;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}
.hero-content { max-width: 640px; }
.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem; color: var(--color-text-muted);
  margin-bottom: 28px; max-width: 520px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-note { font-size: .85rem; color: var(--color-text-dim); }

/* ===== Section Headers ===== */
.section-header { margin-bottom: 28px; }
.section-header h2 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 6px;
}
.section-sub { color: var(--color-text-muted); font-size: .95rem; }

/* ===== Dashboard ===== */
.dashboard-section { padding: 48px 0; }
.urgency-summary {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
}
.urgency-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: .875rem; font-weight: 500;
}
.urgency-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.urgency-dot.red { background: var(--color-red); }
.urgency-dot.orange { background: var(--color-orange); }
.urgency-dot.yellow { background: var(--color-yellow); }
.urgency-dot.green { background: var(--color-green); }

.vehicle-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.vehicle-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.vehicle-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}
.vehicle-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.vehicle-card-title {
  font-size: 1.1rem; font-weight: 700;
}
.vehicle-card-meta {
  font-size: .8rem; color: var(--color-text-dim); margin-top: 2px;
}
.vehicle-card-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.vehicle-card-actions button {
  background: none; border: none; color: var(--color-text-dim);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: all var(--transition); font-size: 1rem;
}
.vehicle-card-actions button:hover { color: var(--color-text); background: var(--color-surface-2); }

.deadline-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.deadline-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--color-surface-2); font-size: .85rem;
}
.deadline-label { color: var(--color-text-muted); }
.deadline-date { font-weight: 600; font-family: var(--font-mono); font-size: .82rem; }
.deadline-item.overdue { border-left: 3px solid var(--color-red); }
.deadline-item.due-soon { border-left: 3px solid var(--color-orange); }
.deadline-item.upcoming { border-left: 3px solid var(--color-yellow); }
.deadline-item.ok { border-left: 3px solid var(--color-green); }

.vehicle-notes {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: .82rem; color: var(--color-text-muted);
  white-space: pre-wrap; word-break: break-word;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  background: var(--color-surface); border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.empty-icon { color: var(--color-text-dim); margin-bottom: 16px; display: flex; justify-content: center; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--color-text-muted); margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ===== Dashboard Actions ===== */
.dashboard-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--color-border);
}

/* ===== Form Section ===== */
.form-section {
  padding: 48px 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.vehicle-form { max-width: 720px; }
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: .85rem; font-weight: 600; color: var(--color-text-muted);
}
.required { color: var(--color-red); }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--color-bg); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: .9rem; font-family: var(--font-sans);
  transition: border-color var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, .15);
}
.form-group textarea { resize: vertical; }

.form-fieldset {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 16px;
}
.form-fieldset legend {
  font-weight: 700; font-size: 1rem; padding: 0 8px;
}

.form-actions {
  display: flex; gap: 12px; align-items: center; margin-top: 8px;
}

/* ===== Guide Section ===== */
.guide-section { padding: 48px 0; border-top: 1px solid var(--color-border); }
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 40px;
}
.guide-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 24px;
}
.guide-step {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary-dim); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; margin-bottom: 12px;
}
.guide-card h3 { font-size: 1rem; margin-bottom: 8px; }
.guide-card p { font-size: .875rem; color: var(--color-text-muted); line-height: 1.55; }

.guide-details { display: flex; flex-direction: column; gap: 12px; }
.guide-details-panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden;
}
.guide-details-panel summary {
  padding: 16px 20px; cursor: pointer;
  transition: background var(--transition);
}
.guide-details-panel summary:hover { background: var(--color-surface-2); }
.guide-details-panel summary h3 { font-size: 1rem; }
.guide-details-panel[open] summary { border-bottom: 1px solid var(--color-border); }
.guide-details-panel > *:not(summary) {
  padding: 16px 20px;
}
.guide-details-panel ul, .guide-details-panel ol {
  padding-left: 20px; display: flex; flex-direction: column; gap: 8px;
}
.guide-details-panel li { font-size: .875rem; color: var(--color-text-muted); line-height: 1.55; }
.guide-details-panel dl { display: flex; flex-direction: column; gap: 12px; }
.guide-details-panel dt { font-weight: 600; font-size: .9rem; }
.guide-details-panel dd { font-size: .875rem; color: var(--color-text-muted); }

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 24px 0;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: .82rem; color: var(--color-text-dim);
}
.footer-brand a { color: var(--color-text-muted); font-weight: 600; }
.footer-brand a:hover { color: var(--color-primary); }
.footer-nav { display: flex; gap: 16px; margin-left: auto; }
.footer-nav a { color: var(--color-text-dim); }
.footer-nav a:hover { color: var(--color-text-muted); }
.footer-note { width: 100%; text-align: right; }

/* ===== Toast ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--color-surface-3); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: .85rem;
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-section { padding: 48px 0 40px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .vehicle-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .urgency-summary { gap: 8px; }
  .urgency-pill { font-size: .8rem; padding: 6px 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { margin-left: 0; }
  .footer-note { text-align: left; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 4px 8px; font-size: .8rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .header-inner { height: 48px; }
  .logo-text { font-size: .95rem; }
  .dashboard-section, .form-section, .guide-section { padding: 32px 0; }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .form-section, .hero-actions, .hero-note,
  .dashboard-actions, .vehicle-card-actions, .guide-details { display: none !important; }
  body { background: #fff; color: #000; }
  .vehicle-card { break-inside: avoid; border: 1px solid #ccc; }
  .hero-section { padding: 20px 0; border: none; }
  .hero-content h1 { -webkit-text-fill-color: #000; background: none; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
