/* InsuranceCalculator.io - global stylesheet
   Pure CSS, no framework, no build step. */

:root {
  --color-bg: #ffffff;
  --color-surface: #f5f8fc;
  --color-surface-2: #eef3fa;
  --color-border: #d9e2ec;
  --color-text: #1f2a37;
  --color-text-muted: #566172;
  --color-primary: #0b5fff;
  --color-primary-dark: #0846c4;
  --color-primary-soft: #e6efff;
  --color-accent: #0f9d78;
  --color-accent-soft: #e2f5ee;
  --color-warning: #b7791f;
  --color-danger: #c0392b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 64, 0.06), 0 1px 3px rgba(16, 33, 64, 0.10);
  --shadow-md: 0 4px 14px rgba(16, 33, 64, 0.10);
  --shadow-lg: 0 18px 40px rgba(16, 33, 64, 0.16);
  --maxw: 1120px;
  --font-sans: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--color-text); margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }

p { margin: 0 0 1rem; }

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

.container-narrow { max-width: 760px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--color-primary); }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.site-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:hover { background: var(--color-surface); text-decoration: none; }

.has-dropdown { position: relative; }
.has-dropdown > .dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown { display: flex; }
.dropdown a { font-weight: 500; font-size: 0.95rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    display: none;
    padding: 12px 20px 20px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .has-dropdown > .dropdown {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 14px;
    min-width: 0;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-ghost { background: #fff; border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { background: var(--color-surface); }
.btn-block { display: block; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #0b5fff 0%, #0846c4 55%, #06308c 100%);
  color: #fff;
  padding: 64px 0 72px;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: rgba(255, 255, 255, 0.9); font-size: 1.15rem; max-width: 60ch; }
.hero .btn-ghost { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); color:#fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-trust { margin-top: 26px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.95rem; color: rgba(255,255,255,0.85); }
.hero-trust span::before { content: "\2713  "; color: #8ff0cf; font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--color-surface); }
.section-head { max-width: 60ch; margin-bottom: 8px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* ---------- Calculator card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.calc-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.calc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #b9cdec;
  text-decoration: none;
}
.calc-card .icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.calc-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.calc-card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }
.calc-card .go { margin-top: 14px; font-weight: 700; color: var(--color-primary); font-size: 0.95rem; }

/* ---------- Calculator page layout ---------- */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 8px;
}
@media (max-width: 880px) {
  .calc-layout { grid-template-columns: 1fr; }
}

.panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel h2 { margin-top: 0; }

.results-panel {
  position: sticky;
  top: 86px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.input-wrap { position: relative; }
.input-wrap.has-prefix input { padding-left: 30px; }
.input-wrap .prefix {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-weight: 600;
}
input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 18px;
}
legend { font-weight: 700; font-size: 0.95rem; padding: 0 6px; }

/* ---------- Results ---------- */
.result-headline {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin: 4px 0 2px;
  letter-spacing: -0.02em;
}
.result-sub { color: var(--color-text-muted); margin-bottom: 16px; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.98rem;
}
.result-list li:last-child { border-bottom: none; }
.result-list .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.result-list li.total {
  border-top: 2px solid var(--color-text);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 1.05rem;
}
.result-list li.subtract .val { color: var(--color-danger); }
.result-list li.muted { color: var(--color-text-muted); font-size: 0.9rem; }
.result-list li.muted .val { font-weight: 600; }
.result-list li.add .val { color: var(--color-accent); }

.result-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  margin-bottom: 8px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--color-surface-2);
  overflow: hidden;
  margin: 10px 0 4px;
}
.bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; }

/* ---------- Content / prose ---------- */
.prose { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}
.prose th, .prose td {
  border: 1px solid var(--color-border);
  padding: 9px 12px;
  text-align: left;
}
.prose th { background: var(--color-surface); }

.callout {
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-soft);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 1.2rem 0;
}
.callout.privacy { border-color: var(--color-accent); background: var(--color-accent-soft); }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--color-primary); font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--color-border); margin-bottom: 8px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.88rem; color: var(--color-text-muted); padding: 16px 0 0; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb span { margin: 0 6px; }

/* ---------- Related ---------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.related-grid a {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-weight: 600;
  color: var(--color-text);
  background: #fff;
}
.related-grid a:hover { background: var(--color-surface); text-decoration: none; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 28px auto;
  max-width: 970px;
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--color-surface);
}
.ad-slot.in-content { max-width: 728px; min-height: 120px; }
.ad-slot.sidebar { max-width: 100%; min-height: 250px; margin: 18px 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: #0c1524;
  color: #c7d2e0;
  padding: 48px 0 28px;
  margin-top: 64px;
  font-size: 0.95rem;
}
.site-footer .footer-h { color: #fff; font-size: 1rem; font-weight: 700; line-height: 1.25; margin: 0 0 12px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer a { color: #c7d2e0; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid #223049;
  margin-top: 32px;
  padding-top: 20px;
  color: #8a99ad;
  font-size: 0.85rem;
}
.footer-disclosure { color: #8a99ad; font-size: 0.85rem; margin-top: 10px; }

/* ---------- Utilities ---------- */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
