/* ============================================
   BMIDesk v2 - World-Class Health Dashboard
   Dark mode + Gauge + Body Silhouette + Health Score
   ============================================ */

:root {
    --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: #818cf8;
    --primary-50: #eef2ff; --primary-100: #e0e7ff; --primary-200: #c7d2fe;
    --success: #22c55e; --success-light: #dcfce7;
    --warning: #f59e0b; --warning-light: #fef3c7;
    --danger: #ef4444; --danger-light: #fee2e2;
    --info: #3b82f6;
    --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db;
    --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151;
    --gray-800: #1f2937; --gray-900: #111827;
    --bg: #f8fafc; --card-bg: #ffffff; --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --text: var(--gray-800); --text-secondary: var(--gray-500); --text-muted: var(--gray-400);
    --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 9999px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease; --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --bmi-underweight: #3b82f6; --bmi-normal: #22c55e; --bmi-overweight: #f59e0b; --bmi-obese: #ef4444;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg: #0f172a; --card-bg: #1e293b; --card-border: #334155;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3); --card-shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
    --gray-50: #1e293b; --gray-100: #334155; --gray-200: #475569; --gray-300: #64748b;
    --gray-400: #94a3b8; --gray-500: #cbd5e1; --gray-600: #e2e8f0; --gray-700: #f1f5f9;
    --gray-800: #f8fafc; --gray-900: #ffffff;
    --text: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b;
    --primary-50: rgba(99,102,241,0.15); --primary-100: rgba(99,102,241,0.2); --primary-200: rgba(99,102,241,0.3);
    --success-light: rgba(34,197,94,0.15); --warning-light: rgba(245,158,11,0.15); --danger-light: rgba(239,68,68,0.15);
}
[data-theme="dark"] body { color-scheme: dark; }
[data-theme="dark"] .navbar { background: rgba(15,23,42,0.85); border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .hero-gradient { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%); }
[data-theme="dark"] .hero-pattern { opacity: 0.15; }
[data-theme="dark"] .calculator-section { background: var(--bg); }
[data-theme="dark"] .dashboard-section { background: var(--bg); }
[data-theme="dark"] .faq-section { background: var(--bg); }
[data-theme="dark"] .cta-card { background: linear-gradient(135deg, #312e81, #4c1d95, #581c87); }
[data-theme="dark"] .footer { background: #020617; }
[data-theme="dark"] .bmi-row.underweight { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .bmi-row.normal { background: rgba(34,197,94,0.2); color: #86efac; }
[data-theme="dark"] .bmi-row.overweight { background: rgba(245,158,11,0.2); color: #fcd34d; }
[data-theme="dark"] .bmi-row.obese1 { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-theme="dark"] .bmi-row.obese2 { background: rgba(236,72,153,0.2); color: #f9a8d4; }
[data-theme="dark"] .bmi-row.obese3 { background: rgba(168,85,247,0.2); color: #d8b4fe; }

/* Skip Navigation */
.skip-nav { position: absolute; top: -100%; left: 16px; z-index: 10000; padding: 12px 20px; background: var(--primary); color: white; font-weight: 700; font-size: 0.875rem; border-radius: 0 0 var(--radius) var(--radius); transition: top 0.2s; }
.skip-nav:focus { top: 0; outline: none; color: white; }

/* Scroll Progress */
.scroll-progress { position: absolute; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--primary), #a855f7); width: 0%; transition: width 0.1s linear; z-index: 1; }

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background 0.3s, color 0.3s; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Toast */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow-lg); font-size: 0.875rem; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; max-width: 320px; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-20px); } }

/* Nav */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.06); transition: all var(--transition); }
.navbar.scrolled { box-shadow: 0 1px 10px rgba(0,0,0,0.06); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gray-900); }
.logo-icon { display: flex; align-items: center; }
.logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-accent { color: var(--primary); }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 14px; color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; border-radius: var(--radius-full); transition: all var(--transition); }
.nav-link:hover { color: var(--text); background: var(--gray-100); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-cta { display: flex; }
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; background: none; border: none; cursor: pointer; }
.mobile-menu-btn span { display: block; width: 20px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: all var(--transition); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-family: var(--font); font-size: 0.875rem; font-weight: 600; border: none; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); white-space: nowrap; color: var(--text); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 1px 2px rgba(99,102,241,0.3); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(99,102,241,0.4); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn-ghost { background: var(--gray-100); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--gray-200); }
.btn-white { background: white; color: var(--primary); font-weight: 700; }
.btn-white:hover { background: var(--primary-50); transform: translateY(-1px); }
.btn-icon { width: 36px; height: 36px; padding: 0; background: var(--gray-100); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.btn-icon:hover { background: var(--gray-200); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* Hero */
.hero { position: relative; padding: 140px 0 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-gradient { position: absolute; inset: 0; background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 30%, #f8fafc 60%, #faf5ff 100%); transition: background 0.3s; }
.hero-pattern { position: absolute; inset: 0; opacity: 0.4; background-image: radial-gradient(circle at 1px 1px, var(--gray-300) 1px, transparent 0); background-size: 40px 40px; transition: opacity 0.3s; }
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-full); font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 24px; }
.badge-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.hero-title { font-size: 3.5rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; color: var(--gray-900); margin-bottom: 20px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.125rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 32px; margin-bottom: 40px; }
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-stat-number { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); display: flex; align-items: center; gap: 4px; }
.hero-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.hero-stat-divider { width: 1px; height: 40px; background: var(--gray-200); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Hero Entrance Animations */
.hero-anim { opacity: 0; transform: translateY(24px); animation: heroEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; animation-delay: calc(var(--delay, 0) * 0.1s); }
@keyframes heroEntrance { to { opacity: 1; transform: translateY(0); } }

/* Sections */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag { display: inline-block; padding: 4px 12px; background: var(--primary-50); color: var(--primary); font-size: 0.8125rem; font-weight: 600; border-radius: var(--radius-full); margin-bottom: 12px; }
.section-title { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--gray-900); margin-bottom: 12px; }
.section-subtitle { font-size: 1.0625rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

/* Calculator */
.calculator-section { background: var(--card-bg); transition: background 0.3s; }
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.calc-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--card-shadow); transition: all 0.3s; }
.calc-input-card { position: sticky; top: 80px; }
.calc-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.calc-card-header h3 { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.result-header h3 { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.result-actions { display: flex; gap: 4px; }

/* Unit Toggle */
.unit-toggle { display: flex; background: var(--gray-100); border-radius: var(--radius-sm); padding: 3px; position: relative; }
.unit-btn { padding: 6px 16px; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); background: none; border: none; cursor: pointer; position: relative; z-index: 1; transition: color var(--transition); font-family: var(--font); }
.unit-btn.active { color: var(--gray-900); }
.unit-slider { position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: calc(100% - 6px); background: var(--card-bg); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform var(--transition-slow); }

/* Gender */
.gender-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gender-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: var(--radius); cursor: pointer; font-family: var(--font); font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); transition: all var(--transition); }
.gender-btn:hover { border-color: var(--primary-200); color: var(--text); }
.gender-btn.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.label-hint { display: inline-flex; color: var(--text-muted); cursor: help; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-with-slider { display: flex; flex-direction: column; gap: 4px; }
.form-input { width: 100%; padding: 10px 14px; padding-right: 42px; font-family: var(--font); font-size: 0.9375rem; font-weight: 500; color: var(--text); background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: var(--radius); transition: all var(--transition); -moz-appearance: textfield; }
.form-input::-webkit-outer-spin-button, .form-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-input:focus { outline: none; border-color: var(--primary); background: var(--card-bg); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.input-suffix { position: absolute; right: 14px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); pointer-events: none; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-select { width: 100%; padding: 10px 14px; font-family: var(--font); font-size: 0.875rem; font-weight: 500; color: var(--text); background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: var(--radius); cursor: pointer; transition: all var(--transition); appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.form-select:focus { outline: none; border-color: var(--primary); background-color: var(--card-bg); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-select-sm { padding: 6px 10px; font-size: 0.75rem; border-width: 1px; background-position: right 8px center; }
.form-slider { width: 100%; height: 4px; appearance: none; -webkit-appearance: none; background: var(--gray-200); border-radius: 2px; outline: none; cursor: pointer; }
.form-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(99,102,241,0.4); transition: transform var(--transition); }
.form-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.form-slider::-moz-range-thumb { width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; border: none; box-shadow: 0 2px 6px rgba(99,102,241,0.4); }

/* ============================================
   SPEEDOMETER GAUGE
   ============================================ */
.gauge-wrapper { text-align: center; margin-bottom: 20px; position: relative; }
.gauge-svg { width: 100%; max-width: 300px; margin: 0 auto; display: block; }
.gauge-segment { fill: none; stroke-width: 20; stroke-linecap: butt; }
.gauge-underweight { stroke: var(--bmi-underweight); }
.gauge-normal { stroke: var(--bmi-normal); }
.gauge-overweight { stroke: var(--bmi-overweight); }
.gauge-obese { stroke: var(--bmi-obese); }
.gauge-needle { stroke: var(--gray-900); stroke-width: 3; stroke-linecap: round; transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: 150px 155px; }
.gauge-needle-center { fill: var(--gray-900); transition: fill 0.3s; }
.gauge-needle-group { transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: 150px 155px; }
.gauge-label { fill: var(--text-muted); font-size: 12px; font-weight: 600; font-family: var(--font); }
.gauge-thresh-label { font-size: 10px; font-weight: 700; fill: var(--text-secondary); }
.gauge-center-text { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); text-align: center; }
.bmi-value { display: block; font-size: 2.5rem; font-weight: 900; line-height: 1; color: var(--gray-900); letter-spacing: -0.02em; transition: color 0.3s; }
.bmi-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.bmi-category-badge { display: inline-block; padding: 5px 16px; border-radius: var(--radius-full); font-size: 0.8125rem; font-weight: 700; transition: all 0.3s; margin-top: 8px; }

/* ============================================
   BODY SILHOUETTE + HEALTH SCORE ROW
   ============================================ */
.body-score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; padding: 16px 0; }
.body-silhouette-wrapper { display: flex; justify-content: center; align-items: center; }
.body-silhouette { width: 80px; height: 160px; transition: all 0.5s ease; }
.body-fill { transition: fill 0.5s ease, transform 0.5s ease; }
.body-outline { opacity: 0.3; }
[data-theme="light"] .body-fill { color: var(--gray-300); }
[data-theme="dark"] .body-fill { color: var(--gray-400); }
.health-score-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.health-score-ring { position: relative; width: 100px; height: 100px; }
.score-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--gray-200); stroke-width: 8; }
.score-ring-fill { fill: none; stroke: var(--success); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease; }
.score-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; }
.score-value { font-size: 1.75rem; font-weight: 900; color: var(--gray-900); }
.score-max { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); margin-top: 8px; }
.score-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.score-desc { font-size: 0.875rem; font-weight: 700; transition: color 0.3s; }

/* Insights */
.result-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.insight-card { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--gray-50); border-radius: var(--radius); transition: all var(--transition); }
.insight-card:hover { background: var(--gray-100); }
.insight-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex-shrink: 0; }
.healthy-icon { background: var(--success-light); color: var(--success); }
.target-icon { background: var(--primary-100); color: var(--primary); }
.weight-icon { background: var(--warning-light); color: var(--warning); }
.bmi-prime-icon { background: rgba(168,85,247,0.15); color: #a855f7; }
.insight-label { display: block; font-size: 0.625rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.insight-value { display: block; font-size: 0.875rem; font-weight: 700; color: var(--gray-900); }

/* ============================================
   HEALTH RISKS PANEL
   ============================================ */
.health-risks { padding: 16px; background: var(--gray-50); border-radius: var(--radius); margin-bottom: 16px; transition: all 0.3s; }
.risks-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.risks-header svg { color: var(--primary); flex-shrink: 0; }
.risks-title { font-size: 0.8125rem; font-weight: 700; color: var(--gray-900); }
.risks-text { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.risks-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.risk-tip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); transition: all 0.2s; }
.risk-tip:hover { border-color: var(--primary-200); color: var(--primary); }
.risk-tip-icon { font-size: 0.75rem; }

/* ============================================
   COUNTRY COMPARISON
   ============================================ */
.country-compare { padding: 16px; background: var(--gray-50); border-radius: var(--radius); }
.country-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.country-title { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.compare-bar-wrapper { margin-bottom: 8px; }
.compare-bar { height: 8px; background: linear-gradient(to right, var(--bmi-underweight), var(--bmi-normal), var(--bmi-overweight), var(--bmi-obese)); border-radius: 4px; position: relative; margin: 24px 0 20px; }
.compare-you, .compare-avg { position: absolute; top: -6px; transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.compare-marker { width: 20px; height: 20px; border-radius: 50%; border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.you-marker { background: var(--primary); }
.avg-marker { background: var(--gray-500); }
.compare-label { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: 0.625rem; font-weight: 700; white-space: nowrap; color: var(--text-secondary); }
.compare-scale-labels { display: flex; justify-content: space-between; font-size: 0.625rem; color: var(--text-muted); font-weight: 600; }
.compare-note { font-size: 0.75rem; color: var(--text-secondary); text-align: center; margin-top: 4px; }

/* Tools Grid */
.calculators-section { background: var(--bg); }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--transition); }
.tool-card:hover { box-shadow: var(--card-shadow-lg); transform: translateY(-2px); }
.tool-card-header { padding: 20px 20px 12px; }
.tool-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); margin-bottom: 12px; }
.tdee-icon { background: #fef3c7; color: #d97706; }
.bodyfat-icon { background: #fce7f3; color: #ec4899; }
.idealw-icon { background: #dbeafe; color: #3b82f6; }
.whr-icon { background: #d1fae5; color: #059669; }
.macro-icon { background: #ede9fe; color: #7c3aed; }
.calorie-icon { background: #fee2e2; color: #ef4444; }
.tool-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.tool-desc { font-size: 0.75rem; color: var(--text-secondary); }
.tool-card-body { padding: 0 20px 20px; }
.tool-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--card-border); animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.tool-result-main { text-align: center; margin-bottom: 12px; }
.tool-result-number { font-size: 2.25rem; font-weight: 900; color: var(--gray-900); letter-spacing: -0.02em; }
.tool-result-unit { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.tool-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool-result-item { text-align: center; padding: 8px 6px; background: var(--gray-50); border-radius: var(--radius-sm); }
.tool-result-item .item-label { display: block; font-size: 0.625rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.tool-result-item .item-value { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--gray-900); }
.tool-result-note { font-size: 0.75rem; color: var(--text-secondary); text-align: center; margin-top: 8px; line-height: 1.5; }
.bodyfat-bar { height: 8px; background: linear-gradient(to right, #22c55e, #eab308, #ef4444); border-radius: 4px; position: relative; margin: 12px 0; }
.bodyfat-pointer { position: absolute; top: -4px; width: 16px; height: 16px; background: var(--card-bg); border: 3px solid var(--gray-800); border-radius: 50%; transform: translateX(-50%); transition: left 0.6s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.ideal-weight-list { display: flex; flex-direction: column; gap: 6px; }
.iw-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--gray-50); border-radius: var(--radius-sm); }
.iw-item.highlight { background: var(--primary-50); border: 1px solid var(--primary-200); }
.iw-formula { font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.iw-value { font-size: 0.8125rem; font-weight: 700; color: var(--gray-900); }
.macro-circles { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; }
.macro-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.macro-circle-mini { position: relative; width: 56px; height: 56px; }
.macro-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.macro-bg { fill: none; stroke: var(--gray-200); stroke-width: 3; }
.macro-fill { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset 0.6s ease; }
.protein-fill { stroke: #ef4444; } .carbs-fill { stroke: #3b82f6; } .fats-fill { stroke: #f59e0b; }
.macro-percent { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; color: var(--text); }
.macro-name { font-size: 0.625rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.macro-grams { font-size: 0.8125rem; font-weight: 700; color: var(--gray-900); }
.macro-total { display: flex; justify-content: center; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); padding-top: 10px; border-top: 1px solid var(--card-border); }
.macro-total strong { color: var(--gray-900); }

/* Dashboard */
.dashboard-section { background: var(--card-bg); transition: background 0.3s; }
.dashboard-grid { display: grid; gap: 20px; }
.dash-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash-stat-card { background: var(--gray-50); border-radius: var(--radius); padding: 16px; text-align: center; }
.dash-stat-label { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.dash-stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; }
.dash-stat-change { display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); margin-top: 4px; }
.dash-stat-change.positive { background: var(--success-light); color: var(--success); }
.dash-stat-change.negative { background: var(--danger-light); color: var(--danger); }
.dash-chart-card { background: var(--gray-50); border-radius: var(--radius-lg); padding: 20px; }
.dash-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.dash-chart-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.chart-legend { display: flex; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.bmi-dot { background: var(--primary); } .weight-dot { background: var(--success); }
.healthy-zone-dot { background: rgba(34,197,94,0.25); border: 1px solid var(--success); }
.chart-container { position: relative; height: 280px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }
.chart-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; gap: 10px; }
.chart-empty p { font-size: 0.8125rem; }
.chart-tooltip { position: absolute; padding: 8px 12px; background: var(--gray-900); color: white; border-radius: var(--radius-sm); font-size: 0.75rem; pointer-events: none; z-index: 10; white-space: nowrap; }
.tooltip-date { font-weight: 600; margin-bottom: 2px; }
.tooltip-bmi, .tooltip-weight { opacity: 0.8; }
.dash-history-card { background: var(--gray-50); border-radius: var(--radius-lg); padding: 20px; }
.dash-history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dash-history-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.history-table-wrapper { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { text-align: left; padding: 8px 12px; font-size: 0.625rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--card-border); }
.history-table td { padding: 10px 12px; font-size: 0.8125rem; color: var(--text); border-bottom: 1px solid var(--gray-100); }
.history-table tbody tr:hover { background: var(--primary-50); }
.history-empty td { text-align: center; color: var(--text-muted); padding: 32px 12px; }
.history-delete { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; transition: all var(--transition); display: flex; align-items: center; }
.history-delete:hover { color: var(--danger); background: var(--danger-light); }
.category-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6875rem; font-weight: 600; }
.cat-underweight { background: rgba(59,130,246,0.15); color: #3b82f6; }
.cat-normal { background: rgba(34,197,94,0.15); color: #22c55e; }
.cat-overweight { background: rgba(245,158,11,0.15); color: #f59e0b; }
.cat-obese { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Learn */
.learn-section { background: var(--bg); }
.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.learn-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 24px; transition: all var(--transition); }
.learn-card:hover { box-shadow: var(--card-shadow-lg); transform: translateY(-2px); }
.learn-card-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); border-radius: var(--radius); margin-bottom: 14px; }
.learn-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.learn-card p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.learn-formula { padding: 10px 14px; background: var(--gray-50); border-radius: var(--radius-sm); font-size: 0.8125rem; color: var(--text); font-family: 'SF Mono', 'Fira Code', monospace; }
.learn-list { list-style: none; padding: 0; margin-bottom: 10px; }
.learn-list li { position: relative; padding-left: 16px; margin-bottom: 4px; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; }
.learn-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; background: var(--primary); border-radius: 50%; }
.learn-note { font-size: 0.75rem !important; color: var(--text-muted) !important; font-style: italic; }
.bmi-table-mini { display: flex; flex-direction: column; gap: 3px; }
.bmi-row { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500; transition: background 0.3s, color 0.3s; }
.bmi-row span:last-child { font-weight: 700; }
.bmi-row.underweight { background: #dbeafe; color: #1e40af; }
.bmi-row.normal { background: #dcfce7; color: #166534; }
.bmi-row.overweight { background: #fef3c7; color: #92400e; }
.bmi-row.obese1 { background: #fee2e2; color: #991b1b; }
.bmi-row.obese2 { background: #fce7f3; color: #9d174d; }
.bmi-row.obese3 { background: #f3e8ff; color: #6b21a8; }

/* FAQ */
.faq-section { background: var(--card-bg); transition: background 0.3s; }
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.faq-item { background: var(--gray-50); border-radius: var(--radius); overflow: hidden; }
.faq-item[open] { background: var(--card-bg); box-shadow: var(--card-shadow); border: 1px solid var(--card-border); }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; font-size: 0.9375rem; font-weight: 600; color: var(--text); list-style: none; transition: color var(--transition); }
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { color: var(--primary); }
.faq-chevron { transition: transform var(--transition); flex-shrink: 0; color: var(--text-muted); }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 20px 14px; }
.faq-answer p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.7; }

/* CTA */
.cta-section { padding: 40px 0 80px; }
.cta-card { background: linear-gradient(135deg, var(--primary), #8b5cf6, #a855f7); border-radius: var(--radius-xl); padding: 56px 40px; text-align: center; position: relative; overflow: hidden; transition: background 0.3s; }
.cta-card::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.1) 1px, transparent 0); background-size: 32px 32px; }
.cta-content { position: relative; z-index: 1; }
.cta-content h2 { font-size: 1.875rem; font-weight: 800; color: white; margin-bottom: 12px; letter-spacing: -0.02em; }
.cta-content p { font-size: 1rem; color: rgba(255,255,255,0.8); margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* Footer */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 56px 0 28px; transition: background 0.3s; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand .logo-text { color: white; }
.footer-desc { font-size: 0.8125rem; line-height: 1.7; max-width: 280px; }
.footer-links-group h4 { font-size: 0.75rem; font-weight: 700; color: white; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.footer-links-group a { display: block; font-size: 0.8125rem; color: var(--gray-400); padding: 3px 0; transition: color var(--transition); }
.footer-links-group a:hover { color: white; }
.footer-bottom { padding-top: 28px; border-top: 1px solid rgba(255,255,255,0.08); text-align: center; }
.footer-bottom p { font-size: 0.75rem; margin-bottom: 6px; }
.footer-disclaimer { font-size: 0.6875rem; color: rgba(255,255,255,0.3); max-width: 600px; margin: 0 auto; line-height: 1.6; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .calculator-grid { grid-template-columns: 1fr; }
    .calc-input-card { position: static; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .learn-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--card-bg); flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--card-border); box-shadow: var(--card-shadow-lg); }
    .nav-links.open { display: flex; }
    .nav-cta { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: 120px 0 60px; }
    .hero-title { font-size: 2.25rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .section { padding: 60px 0; }
    .section-title { font-size: 1.75rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .learn-grid { grid-template-columns: 1fr; }
    .dash-summary { grid-template-columns: 1fr 1fr; }
    .result-insights { grid-template-columns: 1fr; }
    .body-score-row { grid-template-columns: 1fr 1fr; gap: 12px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .cta-card { padding: 40px 20px; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-title { font-size: 1.875rem; }
    .hero-stats { flex-direction: column; gap: 10px; }
    .hero-stat-divider { width: 40px; height: 1px; }
    .calc-card { padding: 20px; }
    .dash-summary { grid-template-columns: 1fr; }
    .bmi-value { font-size: 2rem; }
}

/* Staggered Card Animations */
.tool-card, .learn-card, .dash-stat-card { opacity: 0; transform: translateY(20px); }
.animate-in { animation: slideUp 0.5s ease forwards; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Input Focus Glow */
.form-input:focus, .form-select:focus { animation: inputGlow 0.3s ease; }
@keyframes inputGlow { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); } 100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.1); } }

/* Button Press Effect */
.btn:active { transform: scale(0.97); }
.btn-primary:active { box-shadow: 0 1px 2px rgba(99,102,241,0.3); }

/* Smooth Card Hover Lift */
.tool-card { transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.tool-card:hover { box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04); transform: translateY(-4px); }
.learn-card { transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.learn-card:hover { box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04); transform: translateY(-4px); }

/* Insight Card Hover */
.insight-card { transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.insight-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }

/* Navbar Link Hover Underline */
.nav-link { position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: 2px; left: 50%; width: 0; height: 2px; background: var(--primary); border-radius: 1px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); transform: translateX(-50%); }
.nav-link:hover::after { width: 60%; }

/* Section Tag Pulse */
.section-tag { position: relative; overflow: hidden; }
.section-tag::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transition: left 0.5s; }
.section-tag:hover::before { left: 100%; }

/* Gauge Needle Bounce */
.gauge-needle-group { transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Score Ring Pulse on Excellent */
.health-score-ring.excellent .score-ring-fill { animation: scorePulse 2s ease infinite; }
@keyframes scorePulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.2); } }

/* Confetti Particles */
.confetti { position: fixed; z-index: 9998; pointer-events: none; }
.confetti-piece { position: absolute; width: 8px; height: 8px; border-radius: 2px; animation: confettiFall 2.5s ease-in forwards; }
@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.3); }
}

/* Smooth selection color */
::selection { background: rgba(99,102,241,0.2); color: var(--text); }

/* Print */
@media print {
    .navbar, .hero, .cta-section, .footer, .nav-actions, #saveBtn, #shareBtn, .country-compare { display: none !important; }
    .section { padding: 20px 0; }
    body { background: white; }
    .calc-card { box-shadow: none; border: 1px solid #ddd; }
}
