/* ============================================================
   Municipal Account Guardian — design system
   Signature: the "Sentinel" glass + scan-line motif — the one
   thing the product does (scan a bill, verify it, flag it) is
   the one thing the interface visually performs.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark theme (default) */
  --bg: #090D13;
  --bg-elevated: #0F141C;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #E7ECF2;
  --text-muted: #8B96A7;
  --text-faint: #5A6576;

  --accent: #5B6EF5;        /* indigo — primary action */
  --accent-2: #2FD9C4;      /* teal — verified / safe */
  --warn: #F5A623;          /* amber — flagged */
  --danger: #F5566A;        /* rose — high severity */

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --blur: blur(18px);

  --mesh-1: rgba(91, 110, 245, 0.20);
  --mesh-2: rgba(47, 217, 196, 0.14);
}

[data-theme="light"] {
  --bg: #F3F5F8;
  --bg-elevated: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(20, 25, 35, 0.08);
  --border-strong: rgba(20, 25, 35, 0.14);
  --text: #131722;
  --text-muted: #5B6577;
  --text-faint: #97A0AF;

  --mesh-1: rgba(91, 110, 245, 0.10);
  --mesh-2: rgba(47, 217, 196, 0.10);
  --shadow: 0 8px 32px rgba(20, 25, 35, 0.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--mesh-1), transparent 60%),
    radial-gradient(1000px 500px at 100% 10%, var(--mesh-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  transition: background-color .3s ease, color .3s ease;
  min-height: 100vh;
}

h1, h2, h3, h4, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--text);
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

p { color: var(--text-muted); margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ---------- Glass surfaces ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7B8AFA);
  color: #fff;
  box-shadow: 0 4px 20px rgba(91, 110, 245, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 26px rgba(91, 110, 245, 0.5); text-decoration: none; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); text-decoration: none; }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }

/* ripple micro-interaction */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: ripple .5s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(9, 13, 19, 0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav { background: rgba(255,255,255,0.7); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(91,110,245,0.5);
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 14.5px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 46px; height: 26px; border-radius: 20px;
  background: var(--surface-strong); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: background .2s ease;
}
.theme-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
[data-theme="light"] .theme-toggle::after { transform: translateX(20px); }

/* ---------- Layout: app shell ---------- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  padding: 24px 16px; border-right: 1px solid var(--border);
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  position: sticky; top: 0; height: 100vh;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 14.5px; margin-bottom: 4px;
  transition: background .2s ease, color .2s ease;
}
.sidebar-link:hover, .sidebar-link.active { background: var(--surface-strong); color: var(--text); text-decoration: none; }
.sidebar-link.active { border: 1px solid var(--border-strong); }
.main { padding: 32px; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; overflow-x: auto; gap: 4px; }
}

/* ---------- Hero ---------- */
.hero { padding: 100px 0 70px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .03em;
  color: var(--accent-2); background: rgba(47,217,196,0.1);
  border: 1px solid rgba(47,217,196,0.25); padding: 6px 14px; border-radius: 100px;
  margin-bottom: 22px;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); max-width: 820px; margin: 0 auto 20px; }
.hero .lead { font-size: 18px; max-width: 620px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 60px; }
.stat { background: var(--bg-elevated); padding: 28px; text-align: center; }
.stat .num { font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; color: var(--accent-2); }
.stat .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 780px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.step {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent-2);
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Pricing ---------- */
.price-card { text-align: left; position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.price-tag { position: absolute; top: -12px; right: 20px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 100px; }
.price-amount { font-family: 'Space Grotesk', sans-serif; font-size: 36px; font-weight: 700; margin: 10px 0; }
.price-amount span { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.price-list { list-style: none; padding: 0; margin: 20px 0; }
.price-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; color: var(--text-muted); font-size: 14.5px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 14.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,110,245,0.18);
}
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; }

/* ---------- Badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 100px; }
.badge-high { background: rgba(245, 86, 106, 0.14); color: var(--danger); border: 1px solid rgba(245,86,106,0.3); }
.badge-medium { background: rgba(245, 166, 35, 0.14); color: var(--warn); border: 1px solid rgba(245,166,35,0.3); }
.badge-low { background: rgba(139, 150, 167, 0.14); color: var(--text-muted); border: 1px solid var(--border); }
.badge-verified { background: rgba(47, 217, 196, 0.14); color: var(--accent-2); border: 1px solid rgba(47,217,196,0.3); }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14.5px; border: 1px solid; }
.alert-success { background: rgba(47,217,196,0.1); border-color: rgba(47,217,196,0.3); color: var(--accent-2); }
.alert-error { background: rgba(245,86,106,0.1); border-color: rgba(245,86,106,0.3); color: var(--danger); }
.alert-info { background: rgba(91,110,245,0.1); border-color: rgba(91,110,245,0.3); color: var(--accent); }

/* ---------- Upload / scan (signature moment) ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 56px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent-2); background: rgba(47,217,196,0.04); }
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  box-shadow: 0 0 12px var(--accent-2);
  top: 0; display: none;
}
.scanning .scan-line { display: block; animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-faint); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Modal (tutorial) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,8,12,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { max-width: 480px; width: 100%; padding: 32px; }
.modal-dots { display: flex; gap: 6px; margin: 20px 0; }
.modal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background .2s ease, width .2s ease; }
.modal-dot.active { background: var(--accent-2); width: 20px; border-radius: 4px; }

/* ---------- Animations ---------- */
[data-animate] { animation-duration: .5s; animation-fill-mode: both; animation-timing-function: cubic-bezier(.16,1,.3,1); }
[data-animate="fade-in"] { animation-name: fadeIn; }
[data-animate="slide-up"] { animation-name: slideUp; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Print (dispute letters render as clean documents) ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .glass { background: #fff; border: none; box-shadow: none; backdrop-filter: none; }
}

footer { border-top: 1px solid var(--border); padding: 40px 0; text-align: center; color: var(--text-faint); font-size: 13.5px; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
