/* ══════════════════════════════════════════════════════════════════
   HEALTH CALCULATORS — Stylesheet
   Theme: Medical blue/teal (trust, clarity)
══════════════════════════════════════════════════════════════════ */

:root {
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --c-bg: #f4f8fa;
  --c-card: #ffffff;
  --c-border: rgba(20,40,60,0.08);
  --c-border-strong: rgba(20,40,60,0.15);
  --c-text: #0d1f2d;
  --c-text-muted: #5a6b7a;
  --c-text-light: #8a96a3;

  /* Brand — Medical teal */
  --c-primary: #0d7d8a;
  --c-primary-dark: #075a64;
  --c-primary-light: #e0f2f4;
  --c-accent: #4a90e2;
  --c-accent-light: #eaf2fc;

  --c-success: #0a7c4a;
  --c-warning: #d97706;
  --c-danger: #c0392b;
  --c-info: #1e5a8a;

  --grad-hero: linear-gradient(135deg, #0a3a45 0%, #0d6b78 50%, #14a7b8 100%);
  --grad-primary: linear-gradient(135deg, #0d7d8a 0%, #14a7b8 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-hover: 0 16px 40px rgba(13,125,138,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--c-text);
  line-height: 1.6;
  background: var(--c-bg);
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
}

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

/* ══════════════════════════════════════════
   TOP NAV (unified across all 5 sites)
══════════════════════════════════════════ */
.site-nav {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.03);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-hub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #f8f5e8, #fdf6e3);
  border: 1px solid #d4a017;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  color: #7a5a08;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-hub:hover {
  background: linear-gradient(135deg, #fdf6e3, #f4d47f);
  transform: translateY(-1px);
  text-decoration: none;
  color: #5a4006;
}

.nav-hub-icon { font-size: 16px; }

.nav-sites {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-site {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  background: transparent;
  text-decoration: none;
  transition: all 0.15s;
}

.nav-site:hover {
  background: var(--c-primary-light);
  color: var(--c-primary);
  text-decoration: none;
}

.nav-site.active {
  background: var(--c-primary);
  color: white;
}

.nav-site.active:hover {
  background: var(--c-primary-dark);
  color: white;
}

.nav-site-icon { font-size: 14px; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  background: var(--grad-hero);
  color: white;
  padding: 64px 20px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(74,144,226,0.2), transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(20,167,184,0.25), transparent 50%);
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(74,144,226,0.2);
  border: 1px solid rgba(74,144,226,0.4);
  color: #a8d4ff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: #a8d4ff;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* ══════════════════════════════════════════
   MAIN
══════════════════════════════════════════ */
.main { max-width: 1100px; margin: 0 auto; padding: 48px 20px; }

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

/* ══════════════════════════════════════════
   CALCULATOR GRID
══════════════════════════════════════════ */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.calc-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.calc-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.calc-icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

.calc-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--c-text);
}

.calc-card p {
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   CALCULATOR SECTIONS
══════════════════════════════════════════ */
.calculator {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 36px;
  margin: 32px 0;
  box-shadow: var(--shadow-md);
  scroll-margin-top: 80px;
}

.calc-header {
  margin-bottom: 28px;
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
}

.calc-tag {
  display: inline-block;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.calc-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.calc-header p {
  color: var(--c-text-muted);
  font-size: 15px;
}

.calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .calc-body { grid-template-columns: 1fr; gap: 24px; }
  .calculator { padding: 24px 18px; }
}

/* ── INPUTS ── */
.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(13,125,138,0.1);
}

.input-group select { font-family: var(--font-body); cursor: pointer; }

.inline-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Unit toggle */
.unit-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 10px;
  overflow: hidden;
}

.unit-btn {
  padding: 10px;
  background: white;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.unit-btn:hover { color: var(--c-primary); }

.unit-btn.active {
  background: var(--c-primary);
  color: white;
}

/* ── RESULTS ── */
.calc-results {
  background: linear-gradient(135deg, #fbfdfd 0%, #eef7f8 100%);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 28px 24px;
}

.result-main {
  text-align: center;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--c-border);
}

.result-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-bottom: 10px;
}

.result-value {
  font-family: var(--font-mono);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.result-item {
  background: white;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
}

.result-sublabel {
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.result-subvalue {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}

.result-subvalue.earnings { color: var(--c-success); }
.result-subvalue.warning { color: var(--c-warning); }
.result-subvalue.danger { color: var(--c-danger); }

.result-message {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--c-primary-light);
  border-left: 3px solid var(--c-primary);
  border-radius: 8px;
  font-size: 14px;
  color: var(--c-primary-dark);
}

.result-message.warning-box {
  background: #fff4e6;
  border-left-color: var(--c-warning);
  color: var(--c-warning);
}

.result-message.danger-box {
  background: #fef0ee;
  border-left-color: var(--c-danger);
  color: var(--c-danger);
}

.result-message:empty { display: none; }

/* BMI scale */
.bmi-scale {
  margin-top: 18px;
  position: relative;
}

.bmi-scale-bar {
  display: flex;
  height: 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--c-border);
}

.bmi-scale-segment {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bmi-scale-segment.under { background: #4a90e2; }
.bmi-scale-segment.normal { background: #0a7c4a; }
.bmi-scale-segment.over { background: #d97706; }
.bmi-scale-segment.obese { background: #c0392b; }

.bmi-indicator {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 36px;
  background: #0d1f2d;
  border-radius: 2px;
  transition: left 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bmi-indicator::before {
  content: '▼';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  color: #0d1f2d;
  font-size: 10px;
}

/* Heart rate zones */
.zones {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.zone {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid;
  background: white;
}

.zone-1 { border-color: #94a3b8; }
.zone-2 { border-color: #4a90e2; }
.zone-3 { border-color: #0a7c4a; }
.zone-4 { border-color: #d97706; }
.zone-5 { border-color: #c0392b; }

.zone-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}

.zone-range {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary);
}

.zone-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-muted);
  background: rgba(0,0,0,0.04);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── CALC INFO ── */
.calc-info {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}

.calc-info summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-primary);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-info summary::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.2s;
  font-size: 11px;
}

.calc-info[open] summary::before { transform: rotate(90deg); }
.calc-info summary::-webkit-details-marker { display: none; }

.calc-info p, .calc-info ul {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-muted);
}

.calc-info ul { padding-left: 20px; }
.calc-info li { margin-bottom: 4px; }
.calc-info strong { color: var(--c-text); }

/* ══════════════════════════════════════════
   AD SLOTS
══════════════════════════════════════════ */
.ad-slot {
  background: rgba(244,248,250,0.6);
  border: 1px dashed var(--c-border-strong);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  margin: 32px 0;
  color: var(--c-text-light);
  font-size: 13px;
}

.ad-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  color: var(--c-text-light);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   BOTTOM CTA
══════════════════════════════════════════ */
.bottom-cta {
  text-align: center;
  padding: 48px 20px;
  margin: 48px 0 0;
}

.bottom-cta h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.bottom-cta > p {
  color: var(--c-text-muted);
  margin-bottom: 28px;
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
}

.cta-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: all 0.2s;
}

.cta-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--c-primary);
  text-decoration: none;
}

.cta-icon { font-size: 32px; flex-shrink: 0; }

.cta-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.cta-card p { font-size: 12px; color: var(--c-text-muted); line-height: 1.4; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  background: #0d1f2d;
  color: rgba(255,255,255,0.7);
  padding: 48px 20px 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}

.footer-section p {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.6);
}

.footer-section a {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  display: inline-block;
  margin: 2px 0;
}

.footer-section a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.footer-bottom a { color: rgba(255,255,255,0.7); text-decoration: underline; }
.footer-bottom a:hover { color: white; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 600px) {
  .hero { padding: 48px 20px 60px; }
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 20px; }
  .stat-num { font-size: 24px; }
  .calc-card { padding: 18px 16px; }
  .result-grid { grid-template-columns: 1fr; }
  .calc-results { padding: 20px 18px; }
  .calc-header h2 { font-size: 22px; }
  .nav-inner { padding: 10px 14px; flex-direction: column; align-items: stretch; gap: 10px; }
  .nav-hub { justify-content: center; }
  .nav-sites { justify-content: center; gap: 2px; }
  .nav-site { padding: 6px 9px; font-size: 12px; }
  .nav-site-icon { font-size: 13px; }
  .zone { grid-template-columns: 1fr; gap: 4px; }
}
