:root {
  --primary: #1e293b; /* Slate 800 */
  --primary-rgb: 30, 41, 59;
  --secondary: #d97706; /* Amber 600 */
  --secondary-rgb: 217, 119, 6;
  --accent: #f59e0b; /* Amber 500 */
  --bg: #f8fafc; /* Slate 50 */
  --surface: #ffffff;
  --text: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --radius: 12px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --primary: #f8fafc;
  --primary-rgb: 248, 250, 252;
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.text-primary { color: #1e293b !important; }
.text-warning { color: #d97706 !important; }
.bg-primary { background-color: #1e293b !important; }
.bg-warning { background-color: #fbbf24 !important; }

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #1e293b;
  border-color: #1e293b;
  color: #fff;
}

.btn-primary:hover {
  background-color: #0f172a;
  border-color: #0f172a;
  transform: translateY(-1px);
}

.btn-warning {
  background-color: #fbbf24;
  border-color: #fbbf24;
  color: #1e293b;
}

.btn-warning:hover {
  background-color: #f59e0b;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

/* Navbar */
.navbar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  z-index: 1020;
}

.navbar.scrolled {
  background: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  color: white;
  min-height: 500px;
  display: flex;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 8rem;
}

/* Feature Cards Overlap */
.feature-card {
  /* margin-top: -4rem; handled by parent section margin-top now */
  background: white;
  z-index: 10;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Animation only runs once on load due to forwards fill mode */
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  /* Use animation-delay to stagger, but ensure opacity starts at 0 */
}

/* Staggered delays for cards */
.col-md-4:nth-child(1) .feature-card { animation-delay: 0.2s; }
.col-md-4:nth-child(2) .feature-card { animation-delay: 0.4s; }
.col-md-4:nth-child(3) .feature-card { animation-delay: 0.6s; }

/* Move hero text up slightly to avoid overlap */
.hero-features-text {
  margin-bottom: 2rem;
  position: relative;
  z-index: 5;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 70px -15px rgba(0, 0, 0, 0.35);
  background: var(--primary);
  color: #fff;
}

.feature-card .rounded-circle {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover .rounded-circle {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.feature-card:hover h4, 
.feature-card:hover .h4,
.feature-card:hover .text-muted,
.feature-card:hover a,
.feature-card:hover i {
  color: #fff !important;
}

.feature-card:hover .text-primary,
.feature-card:hover .text-success,
.feature-card:hover .text-info,
.feature-card:hover .bg-opacity-10 {
  color: #fff !important;
}

.feature-card a i {
  transition: transform 0.3s ease;
}

.feature-card:hover a i {
  transform: translateX(5px);
}

.mt-n5 { margin-top: -5rem; }

@media (min-width: 992px) {
  .mt-lg-n8 {
    margin-top: -8rem !important;
  }
}

[data-theme="dark"] .feature-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.05);
}

.width-80 { width: 80px; }
.height-80 { height: 80px; }

.hero {
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(245, 158, 11, 0.1));
  padding: 24px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(217, 119, 6, 0.1);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15));
  border-color: rgba(217, 119, 6, 0.2);
}

.backdrop-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Cards */
.card {
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .card {
  border: 1px solid rgba(255,255,255,0.05);
}

.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Utilities */
.hover-up:hover {
  transform: translateY(-5px);
}

.transition-all {
  transition: all 0.3s ease;
}

.width-60 { width: 60px; }
.height-60 { height: 60px; }

.leading-tight { line-height: 1.1; }

/* Process Steps */
.step-item:last-child .step-line {
  display: none;
}

/* Violation Card */
.violation-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.violation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
  border-color: var(--secondary);
  background: linear-gradient(to right, rgba(217, 119, 6, 0.05), transparent);
}

.violation-card i {
  font-size: 1.5rem;
  color: var(--secondary);
  background: rgba(217, 119, 6, 0.1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.violation-card:hover i {
  background: var(--secondary);
  color: white;
  transform: rotate(10deg);
}

/* Info List Item */
.info-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  transition: all 0.2s ease;
}
.info-card:hover {
  background: rgba(0,0,0,0.02);
}

/* FAQ Accordion */
.accordion-item {
  border: none;
  margin-bottom: 1rem;
  background: transparent;
}
.accordion-button {
  background: var(--surface);
  border-radius: 1rem !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 1.25rem;
  font-weight: 600;
}
.accordion-button:not(.collapsed) {
  background: white;
  color: var(--primary);
  box-shadow: 0 10px 20px -10px rgba(0,0,0,0.1);
  border-color: transparent;
}
.accordion-button:focus {
  box-shadow: none;
  border-color: var(--secondary);
}
.accordion-body {
  padding: 1.25rem;
  background: var(--surface);
  border-radius: 0 0 1rem 1rem;
  margin-top: -10px;
  padding-top: 20px;
  border: 1px solid rgba(0,0,0,0.05);
  border-top: none;
}

/* Footer */
.bg-footer {
  background-color: #0f172a;
  color: #94a3b8;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Progress Bar */
.progress {
  background-color: rgba(0,0,0,0.05);
  border-radius: 100px;
  overflow: hidden;
}

[data-theme="dark"] .progress {
  background-color: rgba(255,255,255,0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section .container {
  animation: fadeIn 0.8s ease-out backwards;
}

/* Ensure animation only plays once on page load and doesn't replay on hover/reflow */
.animate-once {
  animation-fill-mode: backwards;
}
.timeline {
  border-left: 3px solid rgba(217, 119, 6, 0.35);
  margin-left: 8px;
}
.timeline .item {
  position: relative;
  padding-left: 18px;
}
.timeline .item::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.20);
}
.form-control, .form-select {
  border-radius: 12px;
  border-color: rgba(0,0,0,0.1);
  padding: 0.75rem 1rem;
}
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
  background-color: var(--surface);
  border-color: rgba(255,255,255,0.1);
  color: var(--text);
}
.badge {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.5em 0.8em;
}

/* Violation Badge */
.violation-badge{
  border: 1px dashed rgba(217, 119, 6, 0.5);
  padding: 10px 12px;border-radius: 12px;background: rgba(217, 119, 6, 0.08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.violation-badge:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.inf-item{padding:8px 0;border-bottom:1px dashed rgba(0,0,0,.05)}

/* Maps */
.map-lg, .map-sm {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.map-lg { height: 320px; }
.map-sm { height: 220px; }
.leaflet-container {
  border-radius: var(--radius);
}

/* Utils */
.reveal{ opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in{ opacity: 1; transform: none; }
.progress-top{ position:fixed; top:0; left:0; height:3px; background: linear-gradient(90deg, var(--secondary), var(--accent)); width:0; z-index:1030; }

/* Theme Refinements */
a { color: var(--secondary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-control:focus, .form-select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

/* Mobile Menu */
.mobile-menu{ position:fixed; inset:0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display:none; z-index:1050; }
.mobile-menu .sheet{ position:absolute; top:0; right:0; height:100%; width:80%; max-width:360px; background:var(--surface); padding:16px; padding-top: max(16px, env(safe-area-inset-top)); box-shadow: -12px 0 28px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .25s ease; border-top-left-radius:16px; border-bottom-left-radius:16px; }
.mobile-menu.show{ display:block; }
.mobile-menu.show .sheet{ transform: translateX(0); }
.mobile-menu .list-group-item{ font-size: 1.05rem; padding: 14px 16px; border:0; background: transparent; color: var(--text); }
.mobile-menu .list-group-item{ font-weight:600; letter-spacing:.2px; border-radius:10px; margin-bottom: 4px; }
.mobile-menu .list-group-item:hover{ background: rgba(0,0,0,.04); }
[data-theme="dark"] .mobile-menu .list-group-item:hover{ background: rgba(255,255,255,.06); }
.mobile-menu .list-group-item.active{ background: rgba(217, 119, 6, 0.15); color: var(--secondary); }

[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); opacity:.8; }