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

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-light: #dcfce7;
  --text: #0f172a;
  --muted: #64748b;
  --thin: #2563eb;
  --normal: #16a34a;
  --over: #d97706;
  --obese: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }

/* ── NAV ─────────────────────────────────────────────────────── */
.navbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; height: 60px; background: rgba(248,250,252,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-logo { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.nav-logo span { color: var(--accent); }

/* ── HERO ────────────────────────────────────────────────────── */
.hero { padding: 100px 20px 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%); width: 900px; height: 500px; background: radial-gradient(ellipse, rgba(22,163,74,0.10) 0%, transparent 65%); pointer-events: none; }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }

.hero-badge { display: inline-block; background: var(--accent-light); border: 1px solid rgba(22,163,74,0.3); color: var(--accent); font-size: 0.8rem; font-weight: 700; padding: 4px 14px; border-radius: 20px; margin-bottom: 24px; letter-spacing: 0.04em; text-transform: uppercase; }

h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 20px; color: var(--text); }

.gradient-text { background: linear-gradient(135deg, #16a34a, #059669, #0d9488); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 620px; margin: 0 auto 32px; line-height: 1.7; }
.hero-sub strong { color: var(--text); }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 48px; }
.hero-note { font-size: 0.8rem; color: var(--muted); }

.hero-stats { display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 32px; box-shadow: var(--shadow); }
.hstat { display: flex; flex-direction: column; align-items: center; padding: 0 28px; }
.hstat strong { font-size: 1.6rem; font-weight: 800; background: linear-gradient(135deg, #16a34a, #059669); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hstat span { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.hstat-div { width: 1px; height: 36px; background: var(--border); }

/* ── SECTIONS ────────────────────────────────────────────────── */
.section-inner { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.section-inner--narrow { max-width: 720px; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; text-align: center; margin-bottom: 48px; letter-spacing: -0.02em; color: var(--text); }

/* ── FEATURES ────────────────────────────────────────────────── */
.features { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { border-color: rgba(22,163,74,0.4); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feat-icon { font-size: 1.8rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ── TOOL SECTION ────────────────────────────────────────────── */
.tool-section { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow); }

/* BMI Form */
.bmi-form { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }

.input-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 140px; }
.input-group label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.input-with-unit { display: flex; align-items: stretch; background: var(--bg); border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.input-with-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }

.input-with-unit input { flex: 1; background: transparent; border: none; color: var(--text); padding: 11px 14px; font-size: 1.05rem; font-weight: 600; outline: none; min-width: 0; }
.input-with-unit input::placeholder { color: #cbd5e1; font-weight: 400; font-size: 0.9rem; }
.unit { display: flex; align-items: center; padding: 0 14px; font-size: 0.85rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-left: 1.5px solid var(--border); }

.btn-calc { align-self: flex-end; flex-shrink: 0; }

.form-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }

/* Result card */
.result-header { display: flex; align-items: center; gap: 32px; margin-bottom: 32px; flex-wrap: wrap; }

.bmi-number-wrap { display: flex; flex-direction: column; }
.bmi-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.bmi-number { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--accent); }

.bmi-category-wrap { display: flex; flex-direction: column; gap: 8px; }
.bmi-category-badge { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 700; }
.bmi-category-badge.cat-thin   { background: #dbeafe; border: 1.5px solid #bfdbfe; color: #1d4ed8; }
.bmi-category-badge.cat-normal { background: #dcfce7; border: 1.5px solid #bbf7d0; color: #15803d; }
.bmi-category-badge.cat-over   { background: #fef3c7; border: 1.5px solid #fde68a; color: #b45309; }
.bmi-category-badge.cat-obese  { background: #fee2e2; border: 1.5px solid #fecaca; color: #b91c1c; }
.bmi-category-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.5; max-width: 300px; }

/* Gauge */
.bmi-gauge-wrap { margin-bottom: 28px; }
.bmi-gauge { position: relative; padding-bottom: 22px; }

.gauge-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.gauge-seg { height: 100%; border-radius: 3px; }
.seg-thin   { flex: 0 0 25%; background: linear-gradient(90deg, #93c5fd, #60a5fa); }
.seg-normal { flex: 0 0 22%; background: linear-gradient(90deg, #4ade80, #22c55e); }
.seg-over   { flex: 0 0 17%; background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.seg-obese  { flex: 1; background: linear-gradient(90deg, #f87171, #ef4444); }

.gauge-pointer { position: absolute; top: -5px; width: 4px; height: 24px; background: var(--text); border-radius: 2px; transform: translateX(-50%); transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

.gauge-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.gauge-labels span { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* Result stats */
.result-stats { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 24px; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.rstat { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 4px 12px; }
.rstat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.rstat-value { font-size: 1rem; font-weight: 700; color: var(--text); }
.rstat-div { width: 1px; height: 36px; background: var(--border); }

.reset-btn { display: block; margin: 0 auto; }

/* ── CATEGORIES TABLE ────────────────────────────────────────── */
.categories-section { padding: 80px 20px; border-top: 1px solid var(--border); }
.bmi-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.bt-row { display: grid; grid-template-columns: 1.6fr 0.8fr 1.8fr; gap: 0; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.88rem; align-items: center; background: var(--surface); }
.bt-row:last-child { border-bottom: none; }
.bt-header { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.bt-range { font-weight: 700; font-size: 0.9rem; }
.bt-thin   strong, .bt-thin   .bt-range { color: #1d4ed8; }
.bt-normal strong, .bt-normal .bt-range { color: #15803d; }
.bt-over   strong, .bt-over   .bt-range { color: #b45309; }
.bt-obese  strong, .bt-obese  .bt-range { color: #b91c1c; }
.bt-thin, .bt-normal, .bt-over, .bt-obese { color: var(--muted); }
.table-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 9px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: background 0.15s, transform 0.1s, box-shadow 0.15s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: #94a3b8; background: var(--surface-2); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.hidden { display: none !important; }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-section { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color 0.15s; }
.faq-item:hover { border-color: rgba(22,163,74,0.3); }
.faq-item summary { padding: 18px 20px; font-weight: 600; font-size: 0.95rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; user-select: none; color: var(--text); }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s; font-weight: 700; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.faq-item strong { color: var(--text); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1000px; margin: 0 auto; padding: 60px 20px 40px; display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 220px; }
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin-top: 10px; line-height: 1.7; }
.footer-home-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 0.85rem; font-weight: 600; color: var(--accent); transition: color 0.15s; }
.footer-home-link:hover { color: var(--accent-hover); }
.footer-links { flex: 1; min-width: 120px; }
.footer-links h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; font-weight: 700; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.88rem; color: var(--muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 20px; font-size: 0.8rem; color: var(--muted); background: var(--surface-2); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar { padding: 0 20px; }
  .hero { padding: 70px 16px 60px; }
  .hero-stats { padding: 16px; flex-wrap: wrap; gap: 8px; }
  .hstat { padding: 0 10px; }
  .hstat-div { display: none; }
  .bmi-form { flex-direction: column; }
  .btn-calc { width: 100%; justify-content: center; }
  .result-header { flex-direction: column; gap: 20px; }
  .bmi-number { font-size: 3rem; }
  .result-stats { flex-direction: column; gap: 12px; }
  .rstat-div { display: none; }
  .rstat { padding: 0; }
  .bt-row { grid-template-columns: 1fr 0.6fr; font-size: 0.82rem; }
  .bt-row > span:last-child { display: none; }
  .bt-header > span:last-child { display: none; }
  .footer-inner { gap: 32px; }
}
