/* ============================================
   PreventCalculator.com — Shared Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0a1628;
  --navy2:     #112040;
  --blue:      #1558b0;
  --blue2:     #1e72d4;
  --blue3:     #5aabff;
  --teal:      #0e9f8e;
  --red:       #c0392b;
  --red-l:     #fdf0ef;
  --amber:     #d97706;
  --amber-l:   #fef9ee;
  --green:     #15803d;
  --green-l:   #f0fdf4;
  --white:     #ffffff;
  --off:       #f8fafc;
  --border:    #e2eaf4;
  --text:      #0f1f38;
  --muted:     #5c7291;
  --light:     #8ba3c0;
  --shadow-s:  0 2px 12px rgba(10,22,40,0.08);
  --shadow-m:  0 6px 32px rgba(10,22,40,0.12);
  --shadow-l:  0 16px 64px rgba(10,22,40,0.16);
  --radius:    14px;
  --radius-s:  8px;
  --radius-l:  20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(10,22,40,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: 64px;
  display: flex; align-items: center;
  padding: 0 clamp(16px, 5%, 60px);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem; font-weight: 800;
  color: #fff; text-decoration: none;
  letter-spacing: -0.5px; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--blue2), var(--teal));
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.logo span { color: var(--blue3); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.nav-links a {
  color: #94afc8; text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,0.08); }

.nav-cta {
  background: var(--blue2); color: #fff !important;
  padding: 7px 16px !important; border-radius: 8px !important;
}
.nav-cta:hover { background: var(--blue) !important; opacity: 1 !important; }

/* hamburger */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: #94afc8; border-radius: 2px; transition: all .3s;
}
.nav-mobile {
  display: none; position: fixed; inset: 64px 0 0 0;
  background: rgba(10,22,40,0.98); backdrop-filter: blur(16px);
  flex-direction: column; padding: 24px;
  z-index: 199; gap: 4px;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  color: #94afc8; text-decoration: none;
  font-size: 1rem; font-weight: 500;
  padding: 12px 16px; border-radius: 10px;
  transition: all .2s;
}
.nav-mobile a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-mobile-section {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: #3d5a7a;
  padding: 16px 16px 6px; margin-top: 8px;
}

/* ── HERO VARIANTS ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 55%, #0e2a5c 100%);
  padding: clamp(48px, 8vw, 80px) clamp(16px, 5%, 60px);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(30,114,212,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(14,159,142,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(90,171,255,0.12);
  border: 1px solid rgba(90,171,255,0.22);
  color: var(--blue3); padding: 5px 14px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800; color: #fff;
  line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--blue3); }
.hero h1 .accent2 { color: #5affd8; }
.hero-sub {
  color: #8aadc8; font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 1.7; max-width: 580px; margin-bottom: 32px;
}
.hero-stats {
  display: flex; gap: clamp(20px, 4vw, 40px);
  flex-wrap: wrap; margin-top: 32px;
}
.hero-stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem; font-weight: 800;
  color: var(--blue3); line-height: 1;
}
.hero-stat-label { font-size: 0.75rem; color: #5a7a99; margin-top: 3px; }

/* ── LAYOUT ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 5%, 60px) 80px; }
.calc-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }

/* ── CARDS ── */
.card {
  background: var(--white); border-radius: var(--radius-l);
  border: 1px solid var(--border); box-shadow: var(--shadow-s);
  overflow: hidden;
}
.card-head {
  padding: 20px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
}
.card-head h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
}
.card-head p { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.card-body { padding: 24px 28px; }

/* ── FORM ELEMENTS ── */
.sec-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--blue2);
  margin: 24px 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sec-label:first-child { margin-top: 0; }

.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.f-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block; font-size: 0.82rem; font-weight: 500;
  color: var(--text); margin-bottom: 7px;
}
.field label .unit {
  color: var(--muted); font-weight: 400; font-size: 0.76rem;
}
.field input[type="number"], .field select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-s);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  color: var(--text); background: var(--white);
  transition: border-color .2s, box-shadow .2s; outline: none;
  -moz-appearance: textfield;
}
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.field input:focus, .field select:focus {
  border-color: var(--blue2);
  box-shadow: 0 0 0 3px rgba(30,114,212,0.1);
}
.field input::placeholder { color: #c0cfe0; }

.tog-group { display: flex; gap: 8px; flex-wrap: wrap; }
.tog {
  padding: 8px 18px; border: 1.5px solid var(--border);
  border-radius: var(--radius-s); background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .15s; line-height: 1;
}
.tog.on { background: #eaf3ff; border-color: var(--blue2); color: var(--blue); font-weight: 600; }
.tog:hover:not(.on) { border-color: #aac4e0; color: var(--text); }

.btn-calc {
  width: 100%; padding: 14px 20px; margin-top: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
  color: #fff; border: none; border-radius: var(--radius-s);
  font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.3px; cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(21,88,176,0.35);
}
.btn-calc:hover { opacity: 0.92; box-shadow: 0 6px 28px rgba(21,88,176,0.45); }
.btn-calc:active { transform: scale(0.99); }

.err-box {
  display: none; padding: 11px 14px;
  background: var(--red-l); border: 1px solid #f5c4bf;
  border-radius: var(--radius-s); margin-bottom: 12px;
  font-size: 0.8rem; color: var(--red); line-height: 1.5;
}

/* ── RESULTS ── */
.result-card { display: none; margin-top: 24px; }

.res-gauge {
  text-align: center; padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}
.res-label-sm {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.res-pct {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 800; color: var(--navy); line-height: 1;
}
.res-sub { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.risk-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; margin-top: 14px;
}
.risk-chip.low          { background: var(--green-l); color: var(--green); }
.risk-chip.borderline   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.risk-chip.intermediate { background: var(--amber-l); color: var(--amber); }
.risk-chip.high         { background: var(--red-l); color: var(--red); }

/* gauge bar */
.gauge-wrap { padding: 0 24px 4px; margin-top: 18px; }
.gauge-track {
  height: 10px; border-radius: 10px;
  background: linear-gradient(to right,
    #16a34a 0%, #84cc16 30%,
    #eab308 50%, #f97316 70%,
    #dc2626 100%);
  position: relative;
}
.gauge-needle {
  position: absolute; top: 50%;
  width: 18px; height: 18px;
  background: var(--navy); border: 2.5px solid #fff;
  border-radius: 50%; transform: translate(-50%,-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: left .7s cubic-bezier(.34,1.56,.64,1);
}
.gauge-ticks {
  display: flex; justify-content: space-between;
  font-size: 0.66rem; color: var(--light); margin-top: 6px;
}

.res-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
}
.res-cell {
  background: var(--white);
  padding: 16px 20px;
}
.res-cell-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.res-cell-val { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--navy); }

.res-section { padding: 18px 24px; border-top: 1px solid var(--border); }
.res-section h4 {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.factor-item {
  font-size: 0.82rem; color: var(--text);
  padding: 5px 0; line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.factor-item:last-child { border-bottom: none; }

.med-disclaimer {
  margin: 16px 24px 20px;
  background: var(--off); border-radius: var(--radius-s);
  padding: 14px 16px; border-left: 3px solid #fbbf24;
  font-size: 0.74rem; color: var(--muted); line-height: 1.55;
}
.med-disclaimer strong { color: var(--text); }

/* ── SIDEBAR WIDGETS ── */
.widget {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-s);
}
.widget-head {
  padding: 13px 18px; background: var(--navy);
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.widget-body { padding: 16px 18px; }

.cat-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.cat-item { display: flex; align-items: flex-start; gap: 10px; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.cat-dot.low          { background: var(--green); }
.cat-dot.borderline   { background: #eab308; }
.cat-dot.intermediate { background: #f97316; }
.cat-dot.high         { background: var(--red); }
.cat-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.cat-desc { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

.check-list { list-style: none; display: flex; flex-direction: column; }
.check-list li {
  font-size: 0.8rem; color: var(--muted);
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #f0f5fb;
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before { content: '✓'; color: var(--blue2); font-weight: 700; font-size: 0.72rem; margin-top: 2px; flex-shrink: 0; }

.ext-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--blue2); text-decoration: none; margin-top: 10px;
  font-weight: 500;
}
.ext-link:hover { text-decoration: underline; }

/* ── ABOUT SECTION ── */
.about-section { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--border); }
.about-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800;
  color: var(--navy); margin-bottom: 16px; letter-spacing: -0.5px;
}
.about-section p { font-size: 0.9rem; color: #344e6a; line-height: 1.8; margin-bottom: 14px; }
.feature-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 28px; }
.feat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 22px;
  transition: box-shadow .2s, transform .2s;
}
.feat-card:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); }
.feat-icon { font-size: 1.6rem; margin-bottom: 12px; }
.feat-card h3 { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.feat-card p { font-size: 0.78rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* ── FOOTER ── */
.footer {
  background: var(--navy);
  padding: clamp(32px,5vw,48px) clamp(16px,5%,60px);
  margin-top: 64px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .logo { margin-bottom: 12px; display: inline-flex; }
.footer-brand p { font-size: 0.8rem; color: #4a6a8a; line-height: 1.6; max-width: 280px; margin-top: 8px; }
.footer-col h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.5px;
  color: #6a8aaa; text-transform: uppercase; margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { font-size: 0.82rem; color: #4a6a8a; text-decoration: none; transition: color .2s; }
.footer-col ul a:hover { color: #94afc8; }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.75rem; color: #3a5a7a;
}
.footer-bottom a { color: #4a7a9a; text-decoration: none; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; color: var(--muted);
  padding: 14px 0 0; flex-wrap: wrap;
}
.breadcrumb a { color: var(--blue2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--light); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .res-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .f-row, .f-row-3 { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .res-grid { grid-template-columns: 1fr; }
  .hero h1 { letter-spacing: -0.5px; }
}
@media (max-width: 420px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-up { animation: fadeUp .5s ease both; }
.fade-up-1 { animation: fadeUp .5s .1s ease both; }
.fade-up-2 { animation: fadeUp .5s .2s ease both; }
.fade-up-3 { animation: fadeUp .5s .3s ease both; }
.result-card.show { display: block; animation: fadeUp .4s ease; }

/* ── UTILITY ── */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.text-sm { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }