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

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-light: #fff7ed;
  --text: #0f172a;
  --muted: #64748b;
  --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(234,88,12,0.09) 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(234,88,12,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, #ea580c, #f97316, #fb923c); -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, #ea580c, #f97316); -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(234,88,12,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); }

/* Form */
.form-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.form-row .input-group { flex: 1; min-width: 140px; }
.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.form-card .input-group:not(.form-row .input-group) { margin-bottom: 20px; }
.input-group label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Gender toggle */
.gender-toggle { display: flex; gap: 8px; }
.gender-btn { display: flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--bg); color: var(--muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.15s; flex: 1; justify-content: center; }
.gender-btn:hover { border-color: var(--accent); color: var(--accent); }
.gender-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.gender-icon { font-size: 1.1rem; }

/* Inputs */
.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(234,88,12,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); }

/* Activity select */
.activity-select { width: 100%; padding: 11px 40px 11px 14px; border: 1.5px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font-size: 0.9rem; font-weight: 500; cursor: pointer; outline: none; transition: border-color 0.15s, box-shadow 0.15s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-color: var(--bg); }
.activity-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234,88,12,0.12); }

.btn-calc { width: 100%; margin-top: 8px; justify-content: center; }
.form-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* BMR + TDEE */
.bmr-tdee-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bmr-card, .tdee-card { text-align: center; }
.bmr-card { border-top: 3px solid #94a3b8; }
.tdee-card { border-top: 3px solid var(--accent); }
.metric-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.metric-value { font-size: 2.8rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.tdee-card .metric-value { color: var(--accent); }
.metric-unit { font-size: 0.8rem; color: var(--muted); margin-top: 4px; margin-bottom: 10px; }
.metric-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* Goal cards */
.goals-title { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-align: center; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.goals-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.goal-card { text-align: center; padding: 24px 16px; }
.goal-card.goal-loss     { border-top: 3px solid #3b82f6; }
.goal-card.goal-maintain { border-top: 3px solid var(--accent); }
.goal-card.goal-gain     { border-top: 3px solid #10b981; }
.goal-icon { font-size: 1.6rem; margin-bottom: 8px; }
.goal-name { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.goal-kcal { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.goal-loss .goal-kcal     { color: #3b82f6; }
.goal-maintain .goal-kcal { color: var(--accent); }
.goal-gain .goal-kcal     { color: #10b981; }
.goal-unit { font-size: 0.78rem; color: var(--muted); margin-top: 4px; margin-bottom: 10px; }
.goal-note { font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

/* Macros */
.macro-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.macro-subtitle { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.macro-list { display: flex; flex-direction: column; gap: 18px; }
.macro-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.macro-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.macro-gram { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.macro-bar-wrap { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.macro-bar { height: 100%; border-radius: 4px; width: 0; transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
.macro-bar-protein { background: linear-gradient(90deg, #f97316, #ea580c); }
.macro-bar-fat     { background: linear-gradient(90deg, #f59e0b, #d97706); }
.macro-bar-carb    { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.macro-pct { font-size: 0.75rem; color: var(--muted); }

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

/* ── ACTIVITY TABLE ── */
.info-section { padding: 80px 20px; border-top: 1px solid var(--border); }
.activity-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.at-row { display: grid; grid-template-columns: 1.2fr 0.6fr 2fr; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.88rem; align-items: center; background: var(--surface); }
.at-row:last-child { border-bottom: none; }
.at-header { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.at-factor { font-weight: 700; color: var(--accent); }
.at-row strong { color: var(--text); }
.at-row > span:last-child { color: var(--muted); }

/* ── 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(234,88,12,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(234,88,12,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; }
  .bmr-tdee-row { grid-template-columns: 1fr; }
  .goals-row { grid-template-columns: 1fr; }
  .at-row { grid-template-columns: 1.2fr 0.6fr; }
  .at-row > span:last-child { display: none; }
  .at-header > span:last-child { display: none; }
  .footer-inner { gap: 32px; }
}

@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.shake { animation: shake 0.4s ease; }
