/* ============================================================
   Missed Call Money — styles.css
   Blue & white professional financial-calculator theme
   ============================================================ */

:root {
  --navy: #0f2a5c;
  --navy-2: #1e3a8a;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eaf1ff;
  --blue-panel: #eef4ff;
  --blue-panel-2: #dbe7ff;
  --text: #1f2937;
  --text-muted: #55617a;
  --white: #ffffff;
  --bg: #f5f8ff;
  --border: #d8e0f0;
  --border-strong: #c3d0ea;
  --success: #067647;
  --shadow-sm: 0 1px 2px rgba(15, 42, 92, 0.06), 0 1px 3px rgba(15, 42, 92, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 42, 92, 0.08), 0 2px 6px rgba(15, 42, 92, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 42, 92, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p { margin: 0 0 1rem; }

a { color: var(--blue-dark); }

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

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

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
  transition: top 0.15s ease;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-lg { padding: 15px 30px; font-size: 1.075rem; }
.btn-outline {
  background: #fff;
  color: var(--blue-dark);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--blue-light); border-color: var(--blue); }

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.faq-q:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 800;
  font-size: 1.15rem;
}
.brand-logo { border-radius: 8px; }
.brand-tld { color: var(--blue); }

.main-nav { display: flex; align-items: center; }
.nav-list {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}
.nav-list a:hover { background: var(--blue-light); color: var(--blue-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--navy);
  border-radius: 2px;
}

/* ---- Sections ---- */
/* scroll-margin keeps anchored headings clear of the sticky header */
.section { padding: 52px 0; scroll-margin-top: 84px; }
.alt-section { background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  text-align: center;
  margin-bottom: 32px;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(180deg, #eef4ff 0%, #f5f8ff 100%);
  padding: 60px 0 52px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  margin-bottom: 18px;
}
.hero-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text-muted);
  margin-bottom: 28px;
}
.hero-cta { margin-bottom: 16px; }
.trust-line {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

/* ---- Advertising slots ----
   Empty by design. Comments do not count as children for :empty, so an
   unused slot collapses entirely and leaves no blank gap in the layout.
   Slots live between sections only, never inside the calculator card. */
.ad-slot {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0;
  text-align: center;
}
/* An unused slot takes up no space at all. Padding is added back only once
   the slot actually contains an element, so there is never a blank gap.
   :empty covers browsers that ignore the comment node; :has(*) is the
   reliable check and degrades safely to zero padding if unsupported. */
.ad-slot:empty { display: none; }
.ad-slot:has(*) {
  padding: 20px;
  overflow: hidden;
}
.ad-slot img,
.ad-slot iframe { max-width: 100%; height: auto; }

/* ---- Prose (informational content) ---- */
.prose { color: var(--text); font-size: 1.02rem; }
.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--navy); }

/* ---- Card ---- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
}

/* ---- Calculator layout ---- */
/* Tighten the gap between the calculator and the section directly below it */
.calculator-section { padding-bottom: 38px; }
.calculator-section + .section { padding-top: 38px; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}

/* Presets */
.preset-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 24px;
  background: var(--blue-panel);
}
.preset-legend {
  font-weight: 700;
  color: var(--navy);
  padding: 0 6px;
}
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.preset-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.preset-btn:hover { border-color: var(--blue); background: var(--blue-light); }
.preset-btn.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.preset-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Fields */
.field { margin-bottom: 22px; }
.field:last-of-type { margin-bottom: 0; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.field-head label {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.98rem;
}
.field-num-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.field-num {
  width: 96px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 1rem;
  font-family: inherit;
  text-align: right;
  color: var(--navy);
  font-weight: 700;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}
.field-num-left { text-align: left; padding-left: 24px; width: 110px; }
.field-unit {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}
.field-unit-left { right: auto; left: 12px; }
.field-help {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Sliders */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--blue-panel-2);
  outline-offset: 4px;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 42, 92, 0.35);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 42, 92, 0.35);
  cursor: pointer;
}
.slider:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--navy); }
.slider:focus-visible::-moz-range-thumb { outline: 3px solid var(--navy); }

/* Calculator actions */
.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.calc-actions .btn { flex: 1 1 auto; }
.copy-status {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-weight: 600;
  color: var(--success);
  font-size: 0.92rem;
}

/* ---- Results ---- */
.results-card {
  background: var(--blue-panel);
  border-color: var(--border-strong);
}
.results-heading {
  font-size: 1.25rem;
  margin-bottom: 18px;
}
/* Empty state shown before the visitor interacts */
.results-empty {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 34px 22px;
  text-align: center;
}
.results-empty-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}
.results-empty-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.result-item-wide { grid-column: 1 / -1; }
.result-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.result-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.result-annual {
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.result-annual-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #cfe0ff;
  margin-bottom: 4px;
}
.result-annual-value {
  display: block;
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.result-formula {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #d5e2ff;
  line-height: 1.5;
}
.results-disclaimer {
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Recovery scenarios ---- */
.recovery {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-strong);
}
.recovery-title { font-size: 1.05rem; margin-bottom: 16px; }
.recovery-list { list-style: none; margin: 0; padding: 0; }
.recovery-row { margin-bottom: 16px; }
.recovery-row:last-child { margin-bottom: 0; }
.recovery-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.recovery-label { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.recovery-amount {
  font-weight: 800;
  color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
}
.recovery-track {
  width: 100%;
  height: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.recovery-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--navy-2));
  transition: width 0.4s ease;
}
.recovery-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---- Steps ---- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step { position: relative; padding-top: 30px; }
.step-num {
  position: absolute;
  top: -22px;
  left: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.step-title { font-size: 1.1rem; }
.step p { margin: 0; color: var(--text-muted); }
.how-note {
  text-align: center;
  margin: 28px auto 0;
  max-width: 620px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---- Privacy ---- */
.privacy-card { max-width: 720px; margin: 0 auto; }
.privacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.privacy-list li {
  position: relative;
  padding-left: 34px;
  font-weight: 600;
  color: var(--text);
}
.privacy-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px solid var(--blue);
}
.privacy-caveat {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}
.privacy-list li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 6px;
  height: 11px;
  border: solid var(--blue-dark);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ---- FAQ ---- */
.faq { display: grid; gap: 12px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-q-heading { margin: 0; font-size: 1rem; }
.faq-q {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
  text-align: left;
}
.faq-q:hover { background: var(--blue-light); }
.faq-icon {
  flex: 0 0 auto;
  position: relative;
  width: 18px;
  height: 18px;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--blue);
  border-radius: 2px;
}
.faq-icon::before { top: 8px; left: 0; width: 18px; height: 2.5px; }
.faq-icon::after { left: 8px; top: 0; width: 2.5px; height: 18px; transition: transform 0.2s ease; }
.faq-q[aria-expanded="true"] .faq-icon::after { transform: scaleY(0); }
.faq-a {
  padding: 0 18px 18px;
}
.faq-a p { margin: 0; color: var(--text-muted); }

/* ---- Bottom CTA ---- */
.bottom-cta {
  text-align: center;
  background: linear-gradient(180deg, #f5f8ff 0%, #eaf1ff 100%);
}
.bottom-cta .section-title { margin-bottom: 24px; }

/* ---- Footer ---- */
.site-footer {
  background: var(--navy);
  color: #cdd9f0;
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
}
.footer-nav a {
  color: #cdd9f0;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.footer-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.footer-copy { margin: 0; font-size: 0.9rem; color: #9fb2d6; }

/* ---- Legal pages ---- */
.legal-main { padding: 48px 0 72px; }
.legal-content {
  max-width: 780px;
  margin: 0 auto;
}
.legal-content h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 8px; }
.legal-updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.legal-content h2 { font-size: 1.25rem; margin-top: 32px; }
.legal-content ul { padding-left: 20px; }
.legal-content li { margin-bottom: 8px; }
.legal-back { margin-top: 40px; }

/* ---- 404 ---- */
.error-main {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 0;
}
.error-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .step { padding-top: 34px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav { position: relative; }
  .nav-list {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { width: 100%; }
  .section { padding: 42px 0; }
  .hero { padding: 44px 0 38px; }
}

@media (max-width: 560px) {
  .card { padding: 18px; }
  .results-grid { grid-template-columns: 1fr; }
  .field-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .field-num, .field-num-wrap, .field-num-left { width: 100%; }
  .field-num { text-align: left; }
  .calc-actions .btn { flex: 1 1 100%; }
  /* Long recovery labels stack above their amount on narrow screens */
  .recovery-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .recovery-amount { font-size: 1.05rem; }
}

@media (max-width: 360px) {
  .container { padding: 0 14px; }
  .preset-btn { font-size: 0.85rem; padding: 8px 11px; }
}

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

/* ============================================================
   Print styles
   ============================================================ */
@media print {
  :root { --shadow-sm: none; --shadow-md: none; --shadow-lg: none; }
  body { background: #fff; color: #000; }
  .site-header,
  .nav-toggle,
  .hero-cta,
  .trust-line,
  .calc-actions,
  .copy-status,
  .preset-group,
  .results-empty,
  .ad-slot,
  #about-calculator,
  #how-it-works,
  .privacy-section,
  #faq,
  .bottom-cta,
  .site-footer,
  .skip-link,
  .field-help,
  .slider {
    display: none !important;
  }
  .hero { padding: 0 0 12px; background: none; border: none; }
  .section { padding: 8px 0; }
  .calc-grid { display: block; }
  .card {
    box-shadow: none;
    border: 1px solid #999;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 12px;
  }
  .inputs-card .field {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
  }
  .field-num { border: none; padding: 0; }
  /* Let the tall results card flow across pages, but keep each block intact */
  .results-card { break-inside: auto; page-break-inside: auto; }
  .result-item,
  .result-annual,
  .recovery,
  .recovery-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .result-annual { background: none !important; color: #000; border: 2px solid #000; }
  .result-annual-label, .result-formula { color: #000; }
  .recovery-bar { background: #666 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]:after { content: ""; }
}
