/* FitBot — site vitrine fitbot.fr — même charte que la web app (thème sombre, accent orange) */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #f2f3f5;
  --muted: #9aa3b2;
  --accent: #ff6b35;
  --accent-2: #ff4500;
  --gold: #ffd700;
  --green: #57f287;
  --red: #ed4245;
  --blue: #5865f2;
  --purple: #a855f7;
  --strava: #fc4c02;
  --accent2: #ed4245;   /* barre calories (recipe-detail.js) */
  --warn: #ffd700;      /* barre glucides */
  --text-muted: #9aa3b2; --text-soft: #d8dbe2; --font-mono: ui-monospace, Menlo, Consolas, monospace;
  --radius: 18px;
  --radius-s: 12px;
  --max: 1120px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 7px; color: #ffd9c9; white-space: nowrap; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.3px; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 900; letter-spacing: -1.5px; }
h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.center { text-align: center; }
.center .lead { margin: 12px auto 0; }

/* ── Header ── */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--surface-2); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; color: var(--text); font-size: 20px; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: grid; place-content: center; }
  .nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--bg); border-bottom: 1px solid var(--border); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; font-size: 16px; }
  .nav .btn { margin: 8px 0 0; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 800; font-size: 15px; cursor: pointer;
  background: var(--surface-2); color: var(--text); transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 12px 30px -12px rgba(255,107,53,.8); }
.btn.discord { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.lg { padding: 16px 26px; font-size: 17px; border-radius: 16px; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 11px; }
.btn.strava { background: var(--strava); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Sections ── */
.section { padding: 84px 0; }
.section.tight { padding: 56px 0; }
.section-head { margin-bottom: 36px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.accent { background: linear-gradient(145deg, #2a1a12, #171a21 60%); border-color: #4a2c1e; }
.card.gold { background: linear-gradient(145deg, #2a2412, #171a21 60%); border-color: #4a4020; }
.card .ic { font-size: 30px; line-height: 1; margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip.ok { color: var(--green); border-color: rgba(87,242,135,.35); background: rgba(87,242,135,.08); }
.chip.warn { color: var(--accent); border-color: rgba(255,107,53,.4); background: rgba(255,107,53,.1); }
.chip.gold { color: var(--gold); border-color: rgba(255,215,0,.4); background: rgba(255,215,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 120%; background: radial-gradient(60% 50% at 30% 20%, rgba(255,107,53,.22), transparent 60%), radial-gradient(40% 40% at 80% 30%, rgba(255,215,0,.10), transparent 60%); pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } .hero { padding: 48px 0 40px; } }
.hero h1 .hl { background: linear-gradient(90deg, var(--accent), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin: 18px 0 26px; }
.hero .trust { margin-top: 22px; }

/* Phone mockup */
.phone { width: 300px; margin: 0 auto; background: #0b0d11; border: 1px solid #2c313c; border-radius: 40px; padding: 12px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03) inset; }
.phone .screen { background: var(--bg); border-radius: 30px; padding: 22px 16px 18px; min-height: 520px; display: flex; flex-direction: column; gap: 12px; }
.phone .notch { width: 110px; height: 26px; background: #0b0d11; border-radius: 0 0 16px 16px; margin: -22px auto 4px; }
.phone .streak-hero { text-align: center; padding: 18px 12px 14px; border-radius: 18px; }
.phone .flame { font-size: 34px; filter: drop-shadow(0 0 16px rgba(255,107,53,.5)); }
.phone .num { font-size: 52px; font-weight: 900; line-height: 1; letter-spacing: -2px; margin-top: 4px; }
.phone .lbl { color: var(--muted); font-weight: 600; font-size: 13px; }
.phone .progress { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.phone .progress i { display: block; height: 100%; width: 68%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; }
.phone .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.phone .stat { text-align: center; padding: 10px 4px; background: var(--surface-2); border-radius: 12px; }
.phone .stat b { display: block; font-size: 18px; }
.phone .stat small { color: var(--muted); font-size: 11px; }
.phone .cta { text-align: center; padding: 13px; border-radius: 14px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.phone .heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.phone .heat i { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); }
.phone .heat i.l1 { background: #5a2a14 } .phone .heat i.l2 { background: #a3431f } .phone .heat i.l3 { background: var(--accent) }
.phone .tabs { display: flex; justify-content: space-around; color: var(--muted); font-size: 10px; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--border); margin-top: auto; }
.phone .tabs span.on { color: var(--accent); }

/* ── Steps ── */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 58px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-content: center; font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); }

/* ── Commands ── */
.cmd-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table td { padding: 11px 10px; border-top: 1px solid var(--border); vertical-align: top; font-size: 15px; }
.cmd-table td:first-child { white-space: nowrap; width: 1%; }
.cmd-table tr:first-child td { border-top: 0; }
.cmd-table .sub { color: var(--muted); font-size: 13px; display: block; margin-top: 3px; }

/* ── Milestones ── */
.milestones { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
@media (max-width: 900px) { .milestones { grid-template-columns: repeat(4, 1fr); } }
.ms { text-align: center; padding: 14px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.ms b { display: block; font-size: 22px; font-weight: 900; }
.ms small { color: var(--muted); font-size: 12px; }
.ms.g1 { border-color: rgba(255,215,0,.35) } .ms.g2 { border-color: rgba(255,107,53,.5) } .ms.g3 { border-color: rgba(168,85,247,.5) }

/* ── Rarity ── */
.rar { font-size: 11px; font-weight: 800; letter-spacing: .5px; }
.rar.COMMUN { color: #99aab5 } .rar.RARE { color: #3498db } .rar.ÉPIQUE { color: var(--purple) } .rar.LÉGENDAIRE { color: var(--gold) }

/* ── Recipes ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.input { padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; outline: none; min-width: 240px; flex: 1; }
.input:focus { border-color: var(--accent); }
.filter-chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.filter-chip.active { background: rgba(255,107,53,.12); border-color: var(--accent); color: var(--accent); }
#recipes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { #recipes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { #recipes-grid { grid-template-columns: 1fr; } }
.recipe-card { display: block; overflow: hidden; padding: 0; color: var(--text); transition: transform .15s ease, border-color .15s ease; }
.recipe-card:hover { transform: translateY(-3px); border-color: rgba(255,107,53,.5); }
.recipe-card-image-wrapper { aspect-ratio: 16/10; background: var(--surface-2); }
.recipe-card-image { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-body { padding: 16px; }
.recipe-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag, .tag-small { display: inline-block; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); }
.recipe-card-title { font-size: 17px; margin-bottom: 6px; }
.recipe-card-desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card-macros { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.section-subtitle { color: var(--muted); }

/* Recipe detail */
.recipe-detail-main { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-bottom: 28px; }
@media (max-width: 900px) { .recipe-detail-main { grid-template-columns: 1fr; } }
.recipe-detail-image-wrapper { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.recipe-detail-image { width: 100%; height: 100%; object-fit: cover; }
.recipe-detail-info h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -1px; }
.recipe-detail-desc { color: var(--muted); font-size: 17px; margin: 10px 0 14px; }
.recipe-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.recipe-detail-macros { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.macro-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.macro-label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.macro-value { display: block; font-size: 24px; font-weight: 900; margin: 2px 0 8px; }
.macro-value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.macro-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.macro-bar-fill { height: 100%; border-radius: 99px; transition: width .8s ease; }
.recipe-detail-bot-tip { margin-top: 16px; color: var(--muted); font-size: 14px; }
.recipe-detail-columns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
@media (max-width: 900px) { .recipe-detail-columns { grid-template-columns: 1fr; } }
.recipe-detail-column h2 { font-size: 20px; margin-bottom: 12px; }
.recipe-detail-column h3 { margin: 16px 0 8px; font-size: 15px; color: var(--muted); }
.recipe-list { margin: 0; padding-left: 20px; color: #d8dbe2; }
.recipe-list li { margin-bottom: 8px; }
.recipe-tip { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255,215,0,.08); border: 1px solid rgba(255,215,0,.3); color: #ffe9a8; font-size: 14px; }
.btn-primary, .btn-outline { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 11px; font-weight: 800; font-size: 14px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }

/* ── Legal ── */
.legal { max-width: 800px; }
.legal h2 { font-size: 22px; margin: 34px 0 10px; }
.legal h3 { font-size: 16px; margin: 18px 0 6px; }
.legal p, .legal li { color: #d8dbe2; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal .meta { color: var(--muted); font-size: 14px; }

/* ── Strava ── */
.strava-card { max-width: 480px; margin: 0 auto; text-align: center; }
.strava-card .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 1px; background: #0b0d11; border: 1px solid var(--border); border-radius: 14px; padding: 16px; word-break: break-all; user-select: all; margin: 18px 0 12px; }
.strava-card .code.err { color: var(--red); }
.strava-card .ok { color: var(--green); font-size: 13px; height: 18px; margin-top: 8px; }
.strava-card ol { text-align: left; color: var(--muted); padding-left: 20px; margin: 20px 0 0; }
.strava-card ol li { margin-bottom: 6px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.footer a { color: var(--muted); font-weight: 600; }
.footer a:hover { color: var(--text); }
.footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ── Print (fiche recette) ── */
@media print {
  .header, .footer, .btn, .btn-primary, .btn-outline, nav { display: none !important; }
  body { background: #fff; color: #111; }
  .card, .macro-item { border-color: #ddd; background: #fff; }
}

/* Installation de l'app */
.install ol { margin: 12px 0 0 20px; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.install ol b { color: var(--text); }
.install .tip { margin-top: 14px; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }

/* Sélecteur de langue */
.lang-switch { position: relative; margin-left: 12px; order: 2; }
.header-inner > .nav { order: 1; margin-left: auto; }
.header-inner > .nav-toggle { order: 3; }
.lang-btn { height: 42px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.lang-btn:hover { border-color: var(--muted); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 6px; z-index: 60; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.lang-menu a, .lang-menu button { display: block; text-decoration: none; box-sizing: border-box; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; border-radius: 8px; cursor: pointer; }
.lang-menu a:hover, .lang-menu a.on, .lang-menu button:hover, .lang-menu button.on { background: var(--surface-2); }
@media (max-width: 860px) { .lang-switch { margin-left: auto; margin-right: 8px; } }
html.i18n-pending body { visibility: hidden; }
