/* ─── GOOGLE FONTS ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --accent:      #00E5A0;
  --accent-dim:  rgba(0,229,160,.12);
  --accent-glow: rgba(0,229,160,.28);
  --accent2:     #FF6B35;
  --radius:      14px;
  --trans:       .25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:          #0D0F14;
  --surface:     #161A23;
  --surface2:    #1E2330;
  --border:      rgba(255,255,255,.07);
  --text:        #F0F2F8;
  --muted:       #7A8099;
  --shadow:      0 4px 32px rgba(0,0,0,.45);
}

[data-theme="light"] {
  --bg:          #F4F6FB;
  --surface:     #FFFFFF;
  --surface2:    #EEF1F8;
  --border:      rgba(0,0,0,.08);
  --text:        #111827;
  --muted:       #6B7280;
  --shadow:      0 4px 24px rgba(0,0,0,.08);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--trans), color var(--trans);
  line-height: 1.6;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ─── HEADER ─────────────────────────────────────────────── */
header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -.5px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--trans);
  white-space: nowrap;
}
nav a:hover { color: var(--text); }
nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── DROPDOWN MENU ──────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropbtn {
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--trans);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dropbtn:hover { color: var(--text); }
.dropbtn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.dropdown-content {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface);
  min-width: 190px;
  box-shadow: var(--shadow);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  z-index: 200;
  transition: all var(--trans);
}
.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px);
}
.dropdown-content a {
  display: block;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--trans);
  margin-bottom: 2px;
}
.dropdown-content a:last-child { margin-bottom: 0; }
.dropdown-content a:hover, .dropdown-content a.active {
  background: var(--surface2);
  color: var(--text);
}
.dropdown-content a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.theme-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .83rem;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--trans);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); }

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  font-size: .82rem;
  color: var(--muted);
  padding: 14px 0 0;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 52px 20px 36px;
  max-width: 900px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,160,.25);
  color: var(--accent);
  font-size: .78rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 50px;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 14px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px; margin: 0 auto;
}

/* ─── PAGE HERO (inner pages) ────────────────────────────── */
.page-hero {
  padding: 36px 0 28px;
}
.page-hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero p { color: var(--muted); max-width: 580px; font-size: .98rem; }

/* ─── CARD ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.card-title .icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

/* ─── FORM ───────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.field label {
  display: block;
  font-size: .8rem; font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .4px; text-transform: uppercase;
}
.field input, .field select {
  width: 100%; padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem; outline: none;
  transition: border-color var(--trans);
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8099' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px; cursor: pointer;
}

/* ─── TOGGLE GROUP ───────────────────────────────────────── */
.toggle-group {
  display: flex; background: var(--surface2);
  border-radius: 10px; padding: 4px; gap: 4px;
  margin-bottom: 20px; width: fit-content;
}
.toggle-btn {
  padding: 7px 18px; border-radius: 7px; border: none;
  background: transparent; color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem; font-weight: 500; cursor: pointer;
  transition: all var(--trans);
}
.toggle-btn.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 6px rgba(0,0,0,.2);
}

/* ─── BUTTON ─────────────────────────────────────────────── */
.btn-calc {
  width: 100%; padding: 13px;
  background: var(--accent); border: none;
  border-radius: 10px; color: #0D0F14;
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  letter-spacing: .3px; transition: all var(--trans);
}
.btn-calc:hover {
  background: #00fdb4;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-calc:active { transform: translateY(0); }

/* ─── RESULT BOX ─────────────────────────────────────────── */
.result-box {
  display: none; margin-top: 24px; padding: 24px;
  background: var(--surface2); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  animation: fadeUp .3s ease both;
}
.result-box.show { display: block; }
.result-main {
  font-family: 'Syne', sans-serif;
  font-size: 2.6rem; font-weight: 800;
  color: var(--accent); line-height: 1; margin-bottom: 4px;
}
.result-label { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.result-detail { font-size: .92rem; color: var(--text); line-height: 1.7; }

/* ─── IMC GAUGE ──────────────────────────────────────────── */
.imc-gauge { margin: 16px 0 8px; }
.gauge-bar {
  height: 10px; border-radius: 50px;
  background: linear-gradient(to right,
    #3B82F6 0%, #3B82F6 16.5%,
    #00E5A0 16.5%, #00E5A0 41.5%,
    #F59E0B 41.5%, #F59E0B 58.5%,
    #FF6B35 58.5%, #FF6B35 75%,
    #EF4444 75%);
  position: relative; margin-bottom: 8px;
}
.gauge-needle {
  position: absolute; top: -4px;
  width: 18px; height: 18px;
  background: white; border-radius: 50%;
  border: 2px solid #0D0F14;
  transform: translateX(-50%);
  transition: left .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.gauge-labels {
  display: flex; justify-content: space-between;
  font-size: .72rem; color: var(--muted);
}

/* ─── MACROS GRID ────────────────────────────────────────── */
.macros-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 12px; margin-top: 16px;
}
.macro-card {
  background: var(--surface); border-radius: 10px;
  padding: 16px 12px; text-align: center;
  border: 1px solid var(--border);
}
.macro-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem; font-weight: 700; margin-bottom: 2px;
}
.macro-name { font-size: .78rem; color: var(--muted); font-weight: 500; }
.macro-card.prot .macro-val { color: #60A5FA; }
.macro-card.gluc .macro-val { color: #F59E0B; }
.macro-card.lip  .macro-val { color: #FF6B35; }

/* ─── 1RM TABLE ──────────────────────────────────────────── */
.rm-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .9rem; }
.rm-table th {
  text-align: left; color: var(--muted);
  font-weight: 500; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.rm-table td { padding: 10px 0; border-bottom: 1px solid var(--border); }
.rm-table tr:last-child td { border-bottom: none; }
.rm-pct { color: var(--muted); font-size: .85rem; }
.rm-weight { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--accent); }

/* ─── TDEE GRID ──────────────────────────────────────────── */
.tdee-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 10px; margin-top: 16px;
}
.tdee-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 12px;
}
.tdee-card .val {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 2px;
}
.tdee-card .lbl { font-size: .75rem; color: var(--muted); line-height: 1.3; }
.tdee-card.highlight { border-color: var(--accent); background: var(--accent-dim); }
.tdee-card.highlight .val { color: var(--accent); }

/* ─── HOME CARDS ─────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin: 36px 0;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  transition: all var(--trans);
  display: flex; flex-direction: column; gap: 12px;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-glow);
}
.tool-card .tool-icon {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.tool-card .tool-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem; font-weight: 700;
}
.tool-card .tool-desc { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.tool-card .tool-cta {
  margin-top: auto;
  font-size: .82rem; font-weight: 600;
  color: var(--accent); letter-spacing: .3px;
}

/* ─── SEO CONTENT ────────────────────────────────────────── */
.seo-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px; margin-bottom: 20px;
}
.seo-block h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 12px;
}
.seo-block p { color: var(--muted); font-size: .93rem; line-height: 1.75; margin-bottom: 12px; }
.seo-block p:last-child { margin-bottom: 0; }

/* ─── FAQ ────────────────────────────────────────────────── */
.faq-block { margin-bottom: 20px; }
.faq-block h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 14px;
}
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 8px;
}
.faq-q {
  padding: 14px 18px; font-weight: 500; font-size: .93rem;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  user-select: none; transition: color var(--trans);
}
.faq-q:hover { color: var(--accent); }
.faq-q .arrow { transition: transform var(--trans); font-size: .8rem; color: var(--muted); }
.faq-q.open .arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding var(--trans);
  font-size: .9rem; color: var(--muted); line-height: 1.7;
  padding: 0 18px;
}
.faq-a.open { max-height: 300px; padding: 0 18px 16px; }

/* ─── AD SLOT ────────────────────────────────────────────── */
.ad-slot {
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: var(--radius); height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .78rem;
  letter-spacing: .5px; text-transform: uppercase;
  margin: 24px 0;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  text-align: center; padding: 15px 20px;
  color: var(--muted); font-size: .82rem;
  border-top: 1px solid var(--border); margin-top: 10px;
}
footer a { color: var(--accent); text-decoration: none; }
footer .footer-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HAMBURGER ──────────────────────────────────────────── */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: border-color var(--trans);
}
.burger:hover { border-color: var(--accent); }
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}

/* Burger → Croix */
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 70px;
  padding-bottom: 30px;
  overflow-y: auto;
  gap: 12px;
  animation: fadeUp .25s ease both;
}
.mobile-nav.open { display: flex; }

.nav-group-title {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: -4px;
}

.mobile-nav a {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  padding: 12px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 260px;
  text-align: center;
  transition: all var(--trans);
  background: var(--surface);
  margin: 0 auto;
}
.mobile-nav a:hover,
.mobile-nav a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.mobile-nav .close-btn {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  transition: all var(--trans);
}
.mobile-nav .close-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { display: none; }
  .burger { display: flex; }
  .header-right { display: flex; align-items: center; gap: 8px; }
  .card { padding: 22px 16px; }
  .macros-grid { gap: 8px; }
  .macro-val { font-size: 1.3rem; }
  .result-main { font-size: 2rem; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .tools-grid { grid-template-columns: 1fr; }
}

/* ─── PUBLICITÉS ─────────────────────────────────────────── */
/* Cacher les pubs "au milieu du texte" sur Desktop */
@media (min-width: 1250px) {
  .ad-inline {
    display: none !important;
  }
}

/* Format Rails sur les côtés Desktop */
.ad-rail {
  display: none !important;
  position: fixed;
  top: 100px;
  width: 160px;
  height: calc(100vh - 210px); /* Plus court pour ne pas toucher le footer */
  z-index: 90;
}
.ad-rail-left { left: 5px; }
.ad-rail-right { right: 5px; }

@media (min-width: 1250px) {
  .ad-rail { display: flex !important; }
  .ad-rail-left { left: calc(25% - 305px); }
  .ad-rail-right { right: calc(25% - 305px); }
}
@media (min-width: 1550px) {
  .ad-rail { width: 300px; }
  .ad-rail-left { left: calc(25% - 375px); }
  .ad-rail-right { right: calc(25% - 375px); }
}

/* ─── DÉLIMITATION DES PUBS (ADBLOCK OU EN ATTENTE) ────── */
.ad-inline, .ad-rail {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-inline {
  position: relative;
}
.ad-rail {
  position: fixed;
}

/* Texte fantôme qui apparaît quand la pub ne charge pas */
.ad-inline::before, .ad-rail::before {
  content: "Espace publicitaire";
  position: absolute;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

/* S'assurer que la pub (Si elle charge) couvre le texte */
.ad-inline ins.adsbygoogle, .ad-rail ins.adsbygoogle {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}
