/* ==========================================================================
   FreeHealthTool.com — Design System
   Source of truth for the brand kit. Use these variables/classes in every
   new page rather than hardcoding colors or one-off styles.
   ========================================================================== */

:root {
  /* Brand colors */
  --color-navy: #0D1B2A;
  --color-teal: #10B981;
  --color-blue: #2563EB;
  --color-aqua: #E0F7F5;
  --color-light-gray: #F4F6F8;
  --color-slate: #64748B;

  --color-white: #FFFFFF;
  --color-border: #E2E5EA;
  --color-text: var(--color-navy);
  --color-text-muted: var(--color-slate);

  /* Type */
  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --h1-size: 32px;
  --h2-size: 24px;
  --h3-size: 18px;
  --body-size: 16px;

  /* Spacing / shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 2px 10px rgba(13, 27, 42, 0.06);
  --shadow-card-hover: 0 6px 20px rgba(13, 27, 42, 0.10);
  --max-width: 1120px;
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                           */
/* ---------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-white);
}

img, svg { max-width: 100%; display: block; }

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

h1, h2, h3, h4 { font-family: var(--font-body); color: var(--color-navy); margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: var(--h1-size); font-weight: 700; }
h2 { font-size: var(--h2-size); font-weight: 600; }
h3 { font-size: var(--h3-size); font-weight: 600; }
p { margin: 0 0 16px; }

ul, ol { padding-left: 22px; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-blue);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------------- */
/* Header / nav                                                          */
/* ---------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-navy);
  white-space: nowrap;
}
.logo .logo-mark { width: 34px; height: 34px; flex: none; }
.logo .brand-free { color: var(--color-navy); }
.logo .brand-health { color: var(--color-teal); }
.logo .brand-tool { color: var(--color-teal); }
.logo .brand-dotcom { color: var(--color-navy); font-weight: 700; }
.logo:hover { text-decoration: none; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--color-navy);
  font-weight: 500;
  font-size: 15px;
}
.main-nav a:hover { color: var(--color-blue); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 0 4px; }
  .main-nav a { display: block; padding: 8px 0; }
  .site-header .container { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
}

/* ---------------------------------------------------------------------- */
/* Breadcrumbs                                                           */
/* ---------------------------------------------------------------------- */

.breadcrumbs {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 18px 0 6px;
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-blue); }
.breadcrumbs .sep { margin: 0 6px; color: var(--color-border); }
.breadcrumbs [aria-current="page"] { color: var(--color-navy); font-weight: 500; }

/* ---------------------------------------------------------------------- */
/* Buttons / inputs                                                      */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-blue);
  color: #fff;
}
.btn-primary:hover { background: #1d4fd1; text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}
.btn-secondary:hover { background: rgba(16, 185, 129, 0.08); text-decoration: none; }

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--color-navy);
}
.field .field-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.input-field,
.select-field {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-navy);
}
.input-field:focus, .select-field:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.input-with-unit {
  display: flex;
  align-items: stretch;
}
.input-with-unit .input-field { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-unit {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--color-light-gray);
  border: 1.5px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-pill {
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-navy);
  background: var(--color-white);
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill:has(input:checked) {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Tool card / result card                                              */
/* ---------------------------------------------------------------------- */

.tool-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin: 20px 0 28px;
}

.result-card {
  background: var(--color-aqua);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-top: 22px;
  display: none;
}
.result-card.is-visible { display: block; }
.result-card .result-label {
  color: var(--color-teal);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.result-card .result-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.1;
}
.result-card .result-unit {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 6px;
}
.result-card .result-range {
  margin-top: 10px;
  font-size: 14px;
  color: var(--color-text-muted);
  display: none;
}
.result-card .result-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Berberine CTA — do not restyle away from "clearly visible blue link"   */
/* ---------------------------------------------------------------------- */

.berberine-cta-wrap {
  margin: 18px 0 26px;
  padding: 16px 20px;
  background: var(--color-light-gray);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.berberine-cta {
  color: var(--color-blue);
  font-weight: 600;
  font-size: 16px;
  text-decoration: underline;
}
.berberine-cta:hover { color: #1d4fd1; }

/* ---------------------------------------------------------------------- */
/* Assumptions / disclaimer                                              */
/* ---------------------------------------------------------------------- */

.assumptions {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 18px 0;
}
.assumptions ul { margin: 6px 0 0; padding-left: 18px; }

.disclaimer {
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-light-gray);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 18px 0;
}

/* ---------------------------------------------------------------------- */
/* Related tools / grids                                                 */
/* ---------------------------------------------------------------------- */

.related-tools {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}
.related-tools ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
@media (max-width: 640px) {
  .related-tools ul { grid-template-columns: 1fr; }
}
.related-tools li a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-navy);
  font-size: 15px;
}
.related-tools li a:hover { color: var(--color-blue); text-decoration: none; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0 8px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.link-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.05s ease;
}
.link-card:hover { box-shadow: var(--shadow-card-hover); text-decoration: none; transform: translateY(-1px); }
.link-card .link-card-icon { width: 30px; height: 30px; margin-bottom: 10px; color: var(--color-teal); }
.link-card h3 { margin-bottom: 6px; font-size: 16px; }
.link-card p { margin: 0; font-size: 13px; color: var(--color-text-muted); }

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-list li { margin-bottom: 6px; }

/* ---------------------------------------------------------------------- */
/* Hero / homepage                                                       */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 56px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-aqua) 0%, rgba(224,247,245,0) 100%);
}
.hero h1 { font-size: 38px; }
.hero p.lede {
  max-width: 640px;
  margin: 0 auto 26px;
  color: var(--color-text-muted);
  font-size: 17px;
}
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.section { padding: 40px 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.section-heading a { font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                */
/* ---------------------------------------------------------------------- */

.site-footer {
  background: var(--color-navy);
  color: #C9D2DC;
  margin-top: 40px;
  padding: 40px 0 24px;
  font-size: 14px;
}
.site-footer a { color: #E6EEF6; }
.site-footer a:hover { color: var(--color-teal); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  font-size: 12.5px;
  color: #9AA7B4;
}
.footer-disclaimer { margin-bottom: 10px; line-height: 1.6; }

/* ---------------------------------------------------------------------- */
/* Static / legal pages                                                  */
/* ---------------------------------------------------------------------- */

.legal-page h2 { margin-top: 32px; }
.legal-page .updated { color: var(--color-text-muted); font-size: 14px; margin-top: -6px; }
