/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; color: #334155; background: #fff; }

/* ── Component Classes ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #D4A847; color: #0d1f3c;
  font-weight: 700; font-size: .9rem; border-radius: .75rem;
  padding: .75rem 1.75rem; border: none; cursor: pointer;
  transition: background .2s, transform .1s;
  text-decoration: none;
}
.btn-primary:hover { background: #c49a35; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: #0d1f3c;
  font-weight: 600; font-size: .9rem; border-radius: .75rem;
  padding: .75rem 1.75rem; border: 2px solid #0d1f3c; cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.btn-secondary:hover { background: #0d1f3c; color: #fff; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: #475569;
  font-weight: 500; font-size: .9rem; border-radius: .5rem;
  padding: .5rem 1rem; border: none; cursor: pointer;
  transition: background .2s; text-decoration: none;
}
.btn-ghost:hover { background: #f1f5f9; color: #0d1f3c; }

.card {
  background: #fff; border-radius: 1rem;
  border: 2px solid #b8c7d9;
  box-shadow: 0 1px 4px 0 rgb(0 0 0/.09), 0 1px 2px -1px rgb(0 0 0/.06);
}
.card-hover {
  background: #fff; border-radius: 1rem;
  border: 2px solid #b8c7d9;
  box-shadow: 0 1px 4px 0 rgb(0 0 0/.09);
  transition: box-shadow .2s, border-color .2s, transform .2s;
  text-decoration: none; display: block;
}
.card-hover:hover {
  box-shadow: 0 8px 24px 0 rgb(0 0 0/.12);
  border-color: #7c9fd4; transform: translateY(-2px);
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem; font-weight: 700; color: #0d1f3c; line-height: 1.25;
}
.section-subtitle { color: #64748b; font-size: 1.1rem; line-height: 1.7; }

.badge {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: .2rem .6rem; border-radius: 9999px;
}

.gold-line { width: 4rem; height: 4px; background: #D4A847; display: block; }

.input-base {
  width: 100%; border: 2px solid #e2e8f0; border-radius: .75rem;
  padding: .75rem 1rem; font-size: .9rem; font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color .2s;
}
.input-base:focus { border-color: #D4A847; }

textarea.input-base { resize: vertical; min-height: 160px; }

/* ── Navy Gradient ── */
.bg-navy-gradient {
  background: linear-gradient(135deg, #0d1f3c 0%, #1a3160 60%, #1e3a6e 100%);
}

/* ── Text Gradient Gold ── */
.text-gradient-gold {
  background: linear-gradient(135deg, #D4A847, #f0c96a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgb(0 0 0/.05);
}
.nav-link {
  font-size: .9rem; font-weight: 500; color: #475569;
  text-decoration: none; padding: .5rem .75rem; border-radius: .5rem;
  transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active { color: #0d1f3c; background: #f1f5f9; }

/* ── Dropdown ── */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 200px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: .75rem;
  box-shadow: 0 8px 24px rgb(0 0 0/.12);
  padding: .5rem; margin-top: .5rem; z-index: 100;
}
.dropdown:hover .dropdown-menu, .dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: .5rem;
  font-size: .875rem; color: #334155; text-decoration: none;
  transition: background .15s;
}
.dropdown-item:hover { background: #f1f5f9; color: #0d1f3c; }

/* ── Hero frosted pill buttons ── */
.tool-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem 1rem; border-radius: 9999px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: #cbd5e1; font-size: .8rem; font-weight: 500;
  text-decoration: none; backdrop-filter: blur(4px);
  transition: all .2s;
}
.tool-pill:hover { background: rgba(255,255,255,.14); border-color: rgba(212,168,71,.5); color: #fff; }
.tool-pill-icon { color: #D4A847; width: 14px; height: 14px; }

/* ── Callout boxes ── */
.callout-tip    { background:#f0fdf4; border:2px solid #86efac; border-radius:.75rem; padding:1rem; }
.callout-warning{ background:#fffbeb; border:2px solid #fcd34d; border-radius:.75rem; padding:1rem; }
.callout-info   { background:#eff6ff; border:2px solid #93c5fd; border-radius:.75rem; padding:1rem; }

/* ── Footer ── */
.footer { background: #0d1f3c; color: #94a3b8; }
.footer a { color: #94a3b8; text-decoration: none; transition: color .15s; }
.footer a:hover { color: #D4A847; }

/* ── Result box ── */
.result-box {
  background: #f8fafc; border: 2px solid #b8c7d9; border-radius: 1rem;
  padding: 1.5rem; margin-top: 1.5rem; min-height: 120px;
  white-space: pre-wrap; line-height: 1.7; font-size: .9rem;
}

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(212,168,71,.3);
  border-top-color: #D4A847;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Risk flag ── */
.risk-flag { background:#fff7ed; border:2px solid #fdba74; border-radius:.75rem; padding:1rem; margin-bottom:.75rem; }
.risk-flag.high   { background:#fef2f2; border-color:#fca5a5; }
.risk-flag.medium { background:#fffbeb; border-color:#fcd34d; }
.risk-flag.low    { background:#f0fdf4; border-color:#86efac; }

/* ── Responsive ── */
@media (max-width:768px) {
  .section-title { font-size: 1.75rem; }
  .mobile-hidden { display: none; }
  .mobile-nav { display: flex; flex-direction: column; gap: .5rem; }
}

/* ── Dark Mode ── */
html.dark body { background: #0f172a; color: #cbd5e1; }

/* Navbar */
html.dark .navbar { background: rgba(15,23,42,.97); border-color: #1e293b; }
html.dark .nav-link { color: #94a3b8; }
html.dark .nav-link:hover, html.dark .nav-link.active { color: #e2e8f0; background: #1e293b; }
html.dark .dropdown-menu { background: #1e293b; border-color: #334155; box-shadow: 0 8px 24px rgb(0 0 0/.4); }
html.dark .dropdown-item { color: #cbd5e1; }
html.dark .dropdown-item:hover { background: #334155; color: #f1f5f9; }

/* Cards */
html.dark .card, html.dark .card-hover { background: #1e293b; border-color: #334155; }
html.dark .card-hover:hover { border-color: #7c9fd4; }

/* Inputs & result box */
html.dark .input-base { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.dark .input-base:focus { border-color: #D4A847; }
html.dark textarea.input-base { background: #1e293b; color: #e2e8f0; }
html.dark select.input-base option { background: #1e293b; }
html.dark .result-box { background: #1e293b; border-color: #334155; color: #e2e8f0; }

/* Buttons */
html.dark .btn-ghost { color: #94a3b8; }
html.dark .btn-ghost:hover { background: #1e293b; color: #f1f5f9; }
html.dark .btn-secondary { color: #e2e8f0; border-color: #94a3b8; }
html.dark .btn-secondary:hover { background: #e2e8f0; color: #0d1f3c; }

/* Callouts */
html.dark .callout-tip     { background: #0a1f12; border-color: #166534; }
html.dark .callout-warning { background: #1c1507; border-color: #854d0e; }
html.dark .callout-info    { background: #0c1a2e; border-color: #1d4ed8; }

/* Risk flags */
html.dark .risk-flag        { background: #1c1107; border-color: #92400e; }
html.dark .risk-flag.high   { background: #1c0505; border-color: #991b1b; }
html.dark .risk-flag.medium { background: #1c1507; border-color: #92400e; }
html.dark .risk-flag.low    { background: #0a1f12; border-color: #166534; }

/* Component class overrides - MUST come before utility overrides */
html.dark .section-title    { color: #f1f5f9 !important; }
html.dark .section-subtitle { color: #94a3b8 !important; }

/* Background utility overrides */
html.dark .bg-white   { background: #1e293b !important; }
html.dark .bg-slate-50, html.dark .bg-slate-100 { background: #162032 !important; }
html.dark .bg-amber-50 { background: #1c1507 !important; }
html.dark .bg-blue-50  { background: #0c1a2e !important; }
html.dark .bg-green-50 { background: #0a1f12 !important; }
html.dark .bg-red-50   { background: #1c0505 !important; }
html.dark .bg-navy-50  { background: #1e3a5f !important; }
html.dark .bg-navy-100 { background: #1e3a5f !important; }

/* Text - go LIGHTER in dark mode (higher perceived brightness) */
html.dark .text-navy-900, html.dark .text-navy-800 { color: #f1f5f9 !important; }
html.dark .text-navy-700 { color: #93c5fd !important; }
html.dark .text-navy-600 { color: #60a5fa !important; }
html.dark .text-slate-700 { color: #e2e8f0 !important; }
html.dark .text-slate-600 { color: #cbd5e1 !important; }
html.dark .text-slate-500 { color: #94a3b8 !important; }
html.dark .text-slate-400 { color: #94a3b8 !important; }
html.dark .text-amber-800 { color: #fcd34d !important; }
html.dark .text-amber-700 { color: #fbbf24 !important; }
html.dark .text-red-700   { color: #f87171 !important; }
html.dark .text-red-600   { color: #f87171 !important; }
html.dark .text-green-700 { color: #4ade80 !important; }
html.dark .text-blue-700  { color: #60a5fa !important; }
html.dark .text-blue-800  { color: #93c5fd !important; }
html.dark .text-emerald-600 { color: #34d399 !important; }

/* Border utility overrides */
html.dark .border-slate-100 { border-color: #1e293b !important; }
html.dark .border-slate-200 { border-color: #334155 !important; }
html.dark .border-amber-200, html.dark .border-amber-300 { border-color: #92400e !important; }
html.dark .border-navy-200  { border-color: #334155 !important; }
html.dark .border-green-200 { border-color: #166534 !important; }

/* Mobile menu */
html.dark #mobile-menu { border-color: #1e293b; background: #0f172a; }
html.dark #mobile-menu a { color: #94a3b8; }
html.dark #mobile-menu a:hover { color: #f1f5f9; }

/* Blog / card hover borders on dark */
html.dark .border-t { border-color: #334155 !important; }
