/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #FCFCFB;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --accent: #8b5cf6;
  --accent-light: #ede9fe;

  --pink:#FFDCE7;
  --green:#DDF8E6;
  --blue:#DDEFFF;
  --yellow:#FFF5D9;
  
  --pastel-1: #fce7f3;
  --pastel-2: #dbeafe;
  --pastel-3: #dcfce7;
  --pastel-4: #fef3c7;
  --pastel-5: #f3e8ff;
  
  /* Couleurs des 3 formules */
  --lorentz: #0ea5e9;
  --broca: #10b981;
  --creff: #8b5cf6;
  
  /* Catégories poids */
  --cat-low: #06b6d4;
  --cat-moderate-low: #10b981;
  --cat-moderate: #84cc16;
  --cat-moderate-high: #f59e0b;
  --cat-high: #ef4444;
  --cat-very-high: #ad0707;

  --cat-under: #f59e0b;
  --cat-normal: #10b981;
  --cat-over: #f97316;
  --cat-obese: #ef4444;

    /* Catégories IMG */
  --cat-very-lean: #06b6d4;
  --cat-athlete: #10b981;
  --cat-fitness: #84cc16;
  --cat-acceptable: #f59e0b;
  --cat-overweight: #ef4444;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background:
       linear-gradient(
        180deg, 
        #FFFFFF, 
        #a0dbfb 25%, 
        #95b8e5 60%, 
        #FFFFFF
      );
}
body::before{
  content:'';
  position:fixed;
  inset:0;
  background:url(noise.svg) repeat;
  opacity:.3;
  pointer-events:none;
  z-index:-5;
}
a {
text-decoration: none;
color: var(--primary-dark);
}
a:hover {
color: var(--accent);
}
a.bmi-link {
  color: var(--blue);
}
a.bmi-link:hover {
  color: var(--accent-light);
}
#random-image {
  position: absolute;
  left: -1200px;
}
/* ---------- Blobs ---------- */
.background{
  position:fixed;
  inset:0;
  overflow:hidden;
  z-index:-10;
  pointer-events:none;
}
.blob{
  position:absolute;
  border-radius:50%;
  opacity:.55;
  background:
      radial-gradient(
          circle,
          currentColor 0%,
          rgba(255,255,255,.35) 55%,
          rgba(255,255,255,0) 100%
      );
  will-change:transform;
}
.blob1{
  color:var(--pink);
  width:700px;
  height:700px;
  top:-220px;
  left:-220px;
}

.blob2{
  color:var(--green);
  width:600px;
  height:600px;
  right:-150px;
  top:10%;
}

.blob3{
  color:var(--blue);
  width:650px;
  height:650px;
  bottom:-250px;
  left:15%;
}

.blob4{
  color:var(--yellow);
  width:500px;
  height:500px;
  bottom:10%;
  right:10%;
}

/* ---------- Hero Sections ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
  overflow: hidden;
}

.hero-main {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%230ea5e9" fill-opacity="0.3" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>'), 
              linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
  
  background-size: cover, cover;
  background-position: center;
  color: white;
}

.hero-secondary {
  background: linear-gradient(135deg, var(--pastel-1) 0%, var(--pastel-2) 100%);
  /* background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>'),
              linear-gradient(135deg, #f093fb 0%, #f5576c 100%); */
  color: white;
  min-height: 60vh;
  border-radius: var(--radius-lg);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  animation: fadeUp 1s ease;
}

.hero-badge {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 20px;
  border-radius: 999px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.hero h1.hero-bmi-value {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 160px;
}

.hero-secondary h2 {
  /* font-family: "Almendra SC", serif; */
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2rem, 6vw, 3rem);
  /* font-weight: 700; */
  /* letter-spacing: -0.02em; */
  line-height: 1.2;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.9);
}

.gradient {
  background: linear-gradient(135deg, #fff 0%, #6b9fc2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-quote {
  font-size: 1.25rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 40px;
  font-weight: 300;
  text-shadow: 0 5px 10px rgba(255, 255, 255, 0.9);
}

.hero-quote-secondary {
  font-size: 1.125rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 12px;
  font-weight: 300;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  background: white;
  color: var(--primary);
  font-weight: 700;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  animation: bounce 2s ease-in;
}

.scroll-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8), transparent);
  border-radius: 2px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---------- Layout ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Sections ---------- */
.calculator-section,
.info-section,
.cta-section,
.img-table-section,
.bmi-table-section,
.tdee-table-section,
.pi-table-section {
  padding: 80px 0;
  margin: 10px;
  border-radius: var(--radius-lg);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-footer {
  text-align: center;
  margin-top: 48px;
}

.section-badge {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.section-title {
  display: inline-block;
  font-size: 1.15rem ;
  font-weight: 700;
  color: var(--primary) !important;
  background: var(--primary-light);
  padding: 6px 16px;
  border-radius: 999px;
  margin: 64px 14px 24px 14px;
}

.section-header h2 {
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 16px;
  border-radius: 999px;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 600px;
  margin: 0 auto;
}

.results {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .results-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .results-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Fields ---------- */
.field {
  border: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  margin-bottom: 4px;
}

.legend-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Value wrapper ---------- */
.value-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 90px;
  cursor: pointer;
}

.value-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px dashed transparent;
  transition: all 0.25s ease;
  display: inline-block;
  background: transparent;
}

.value-wrapper:hover .value-display,
.value-wrapper:focus-within .value-display {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.value-wrapper:hover .value-display::after {
  content: " ✎";
  font-size: 0.75em;
  opacity: 0.7;
}

.value-wrapper.editing .value-display {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.value-input {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) scale(0.85);
  width: 120px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 12px;
  outline: none;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2);
  text-align: right;
}

.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.value-wrapper.editing .value-input {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.value-input:focus {
  box-shadow:
    0 4px 16px rgba(14, 165, 233, 0.25),
    0 0 0 4px rgba(14, 165, 233, 0.15);
}

/* ---------- Segmented control ---------- */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg);
  padding: 6px;
  border-radius: var(--radius-md);
}

.seg-option {
  position: relative;
  text-align: center;
  padding: 14px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-muted);
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.seg-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-option.active {
  background: var(--primary);
  color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

/* ---------- Morphology selector ---------- */
.morpho-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .morpho-selector {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.morpho-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  text-align: center;
}

.morpho-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.morpho-option:hover {
  background: var(--primary-light);
}

.morpho-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.morpho-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.morpho-label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9375rem;
}

.morpho-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ---------- Range sliders ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 48px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(
    to right,
    var(--primary) 0%,
    var(--primary) var(--fill, 50%),
    var(--border) var(--fill, 50%),
    var(--border) 100%
  );
  border-radius: 999px;
}

input[type="range"]::-moz-range-track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
}

input[type="range"]::-moz-range-progress {
  height: 10px;
  background: var(--primary);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  margin-top: -10px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  transition: transform 0.15s ease;
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.15);
}

.range-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: -6px;
}

/* ---------- Results cards ---------- */
.result-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-top: 4px solid;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.result-lorentz { border-top-color: var(--lorentz); }
.result-broca { border-top-color: var(--broca); }
.result-creff { border-top-color: var(--creff); }
.result-imc { border-top-color: var(--lorentz); }
.result-pi { border-top-color: var(--broca); }
.result-img { border-top-color: var(--creff); }
.result-meta { border-top-color: var(--creff); }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.result-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.03em;
}

.result-badge.lorentz { background: var(--lorentz); }
.result-badge.broca { background: var(--broca); }
.result-badge.creff { background: var(--creff); }

.result-formula {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.pi-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 0;
}

.pi-number {
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.3s ease;
}

.result-lorentz .pi-number { color: var(--lorentz); }
.result-broca .pi-number { color: var(--broca); }
.result-creff .pi-number { color: var(--creff); }

.pi-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.result-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Average card ---------- */
.average-card {
  margin-top: 32px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, var(--lorentz) 0%, var(--broca) 50%, var(--creff) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.average-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.average-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.average-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.9;
}

.average-value {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.average-range {
  font-size: 0.9375rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ---------- Results IMC ---------- */

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.result-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.result-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.img-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.img-number {
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.3s ease;
}

.img-unit {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 600;
}

.img-gauge {
  margin-top: 8px;
}

.img-gauge-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--cat-very-lean) 0%,
    var(--cat-very-lean) 12%,
    var(--cat-athlete) 12%,
    var(--cat-athlete) 26%,
    var(--cat-fitness) 26%,
    var(--cat-fitness) 40%,
    var(--cat-acceptable) 40%,
    var(--cat-acceptable) 60%,
    var(--cat-overweight) 60%,
    var(--cat-overweight) 100%
  );
  overflow: visible;
}

.bmi-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bmi-number {
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.3s ease;
}

.bmi-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bmi-gauge {
  margin-top: 8px;
}

.gauge-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--cat-under) 0%,
    var(--cat-under) 10.41%,
    var(--cat-normal) 10.41%,
    var(--cat-normal) 37.5%,
    var(--cat-over) 37.5%,
    var(--cat-over) 58.33%,
    var(--cat-obese) 58.33%,
    var(--cat-obese) 100%
  );
  overflow: visible;
}

.gauge-fill {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.gauge-marker {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border: 3px solid var(--text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gauge-labels {
  /* display: flex;
  justify-content: space-between; */
  position: relative;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  /* font-variant-numeric: tabular-nums; */
  font-weight: 600;
}
.gauge-labels span {
  position: absolute;
}
.gauge-labels span:nth-child(1) {
  left: 0;
  color: var(--cat-under);
}
.gauge-labels span:nth-child(2) {
  left: 10%;
  color: var(--cat-normal);
}
.gauge-labels span:nth-child(3) {
  color: var(--cat-over);
  left: 37.5%;
}
.gauge-labels span:nth-child(4) {
  left: 58.33%;
  color: var(--cat-obese);
}
.gauge-labels span:nth-child(5) {
  right: 0;
  color:var(--cat-obese);
}

.img-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg);
  align-self: flex-start;
  font-size: 0.9375rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.bmi-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg);
  align-self: flex-start;
  font-size: 0.9375rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.category-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cat-normal);
  transition: background 0.3s ease;
}

.ideal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ideal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ideal-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ideal-name {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ideal-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 1.0625rem;
}

.composition-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composition-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.composition-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.composition-name {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 600;
}

.composition-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 1.0625rem;
}

/* ---------- Activity selector ---------- */
.activity-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .activity-selector {
    grid-template-columns: 1fr 1fr;
  }
}

.activity-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.activity-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.activity-option:hover {
  background: var(--primary-light);
}

.activity-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.activity-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.activity-label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9375rem;
}

.activity-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mb-display,
.tdee-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mb-number,
.tdee-number {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--primary);
}

.mb-unit,
.tdee-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mb-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.mb-description p {
  margin: 0;
}

.mb-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.method-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.method-name {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.method-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 1rem;
}

/* Goals */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid;
}

.goal-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.goal-item.lose {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--cat-low);
}

.goal-item.maintain {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--cat-moderate);
}

.goal-item.gain {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--cat-high);
}

.goal-label {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 600;
}

.goal-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 1.0625rem;
}

.disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

/* ---------- Info Sections ---------- */
.info-section {
  position: relative;
}
.info-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(noise.svg) repeat;
  opacity: 0.3;
  z-index: 0;
}
.info-text p {
  text-align: justify;
}
.tip-card p {
  text-align: left;
}
.info-pi {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
}

.info-forme {
  background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%);;
}

.info-age {
  background: linear-gradient(135deg, #dcfce7 0%, #dbeafe 100%);
}

.info-imc {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
}

.info-img {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
}

.info-poids {
  background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%);
}

.info-nutrition {
  background: linear-gradient(135deg, #dcfce7 0%, #dbeafe 100%);
}

.info-mb {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
}
.info-content {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .info-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .info-content.reverse {
    direction: rtl;
  }
  
  .info-content.reverse > * {
    direction: ltr;
  }
}

.info-text .section-badge {
  margin-bottom: 16px;
}

.info-text h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.info-text p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}

.info-text strong {
  color: var(--text);
}

.info-highlights {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.highlight {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.highlight-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.highlight strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 1rem;
}

.highlight span {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.info-visual {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.formulas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.formula-card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  border-left: 4px solid;
}

.formula-card:nth-child(1) { border-left-color: var(--lorentz); }
.formula-card:nth-child(2) { border-left-color: var(--broca); }
.formula-card:nth-child(3) { border-left-color: var(--creff); }

.formula-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.formula-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.formula-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.formula-badge.lorentz { background: var(--lorentz); }
.formula-badge.broca { background: var(--broca); }
.formula-badge.creff { background: var(--creff); }

.visual-card {
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 300px;
}

.visual-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1;
}

.visual-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}

.visual-sublabel {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.visual-bar {
  height: 12px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.visual-bar-fill {
  position: absolute;
  left: 16.5%;
  right: 25%;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--cat-normal), var(--primary));
  border-radius: 999px;
}

.visual-img-bar-fill {
  position: absolute;
  left: 16.5%;
  right: 25%;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--cat-athlete), var(--cat-fitness));
  border-radius: 999px;
}

.visual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.visual-card-mb {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 280px;
  width: 100%;
}

.visual-number-mb {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1;
}

.visual-label-mb {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.visual-sublabel-mb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.visual-bar-mb {
  height: 12px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.visual-bar-fill-mb {
  position: absolute;
  left: 20%;
  right: 30%;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}

.grid-card {
  background: var(--surface);
  padding: 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.grid-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.grid-card h3 {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

.grid-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-list {
  list-style: none;
  margin-top: 24px;
}

.info-list li {
  padding: 12px 0;
  font-size: 1.0625rem;
  color: var(--text);
  font-weight: 500;
}

.age-tips {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.age-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.age-icon {
  font-size: 2rem;
  line-height: 1;
}

.age-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 1rem;
}

.age-card span {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.nutrition-tips {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
}

.nutrition-tips-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}

@media (min-width: 640px) {
  .nutrition-tips-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.tip-card {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  padding-left: 80px;
}

.tip-number {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
}

.tip-number-mb {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  background: var(--primary-light);
  padding: 8px 10px;
  border-radius: 10px;
}


.tip-card h4 {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

.tip-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
/* ---------- CTA Section ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--lorentz) 0%, var(--broca) 50%, var(--creff) 100%);
  border-radius: var(--radius-xl);
  margin: 40px 20px;
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-hero {
  background: linear-gradient(135deg, var(--cat-moderate) 0%, var(--cat-low) 50%, var(--cat-moderate-high) 100%);
}
.cta-short {
  background: linear-gradient(135deg, #3fedd5 0%, #9eaed9 50%, #33e10f 100%);
}
.cta-hero h2{
  font-size: clamp(1rem, 3vw, 1.5rem)!important;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.cta-hero::before {
  right: 25%;
}
.cta-short::before {
  right: 60%;
  width: 400px;
  height: 400px;
}
.cta-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: white;
  margin-bottom: 16px;
  font-weight: 700;
}

.cta-content p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
}

.cta-button {
  display: inline-block;
  background: white;
  color: var(--primary);
  font-weight: 700;
  padding: 18px 36px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  font-size: 1.0625rem;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

/* ----------  Tables Section ---------- */

.tdee-table-section, 
.bmi-table-section,
.pi-table-section,
.img-table-section
{
  padding: 100px 0;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
  position: relative;
  overflow: hidden;
}

.tdee-table-section::before,
.bmi-table-section::before,
.pi-table-section::before,
.img-table-section::before
{
  content: '';
  position: absolute;
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 50%;
  filter: blur(60px);
}

.tdee-table-container,
.bmi-table-container,
.pi-table-container,
.img-table-container,
.pi-age-table-container
{
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 40px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--surface);
  border: 1px solid var(--border);
  max-height: 600px;
}

.tdee-table,
.bmi-table,
.pi-table,
.img-table  
{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  min-width: 700px;
}

.tdee-table th,
.tdee-table td,
.bmi-table th,
.bmi-table td,
.pi-table th,
.pi-table td,
.img-table th,
.img-table td 
{
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tdee-table th:last-child,
.tdee-table td:last-child,
.bmi-table th:last-child,
.bmi-table td:last-child,
.pi-table th:last-child,
.pi-table td:last-child,
.img-table th:last-child,
.img-table td:last-child 
{
  border-right: none;
}

.tdee-table tr:last-child td,
.bmi-table tr:last-child td ,
.pi-table tr:last-child td,
.img-table tr:last-child td 
{
  border-bottom: none;
}

.tdee-table thead th,
.bmi-table thead th,
.pi-table thead th,
.img-table thead th 
{
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tdee-table .weight-header,
.bmi-table .weight-header,
.pi-table .height-header,
.img-table .neck-header
{
  position: sticky;
  top: 0;
  left: 0;
  background: var(--bg);
  z-index: 30;
  min-width: 120px;
  text-align: left;
  padding-left: 16px;
  border-right: 2px solid var(--border);
}

.tdee-table tbody th,
.bmi-table tbody th,
.pi-table tbody th,
.img-table tbody th 
{
  background: var(--bg);
  text-align: left;
  padding-left: 16px;
  position: sticky;
  left: 0;
  z-index: 5;
  font-weight: 700;
  color: var(--text);
  border-right: 2px solid var(--border);
}

.tdee-table td,
.bmi-table td,
.pi-table td,
.img-table td 
{
  cursor: pointer;
  position: relative;
}

.tdee-table td:hover,
.bmi-table td:hover,
.pi-table td:hover,
.img-table td:hover
{
  transform: scale(1.08);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tdee-table td.active,
.bmi-table td.active,
.pi-table td.active,
.img-table td.active 
{
  border: 3px solid var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transform: scale(1.12);
  z-index: 3;
  font-weight: 800;
}

/* Couleurs TDEE */
.tdee-low {
  background: var(--cat-low);
  color: white;
}

.tdee-moderate {
  background: var(--cat-moderate);
  color: white;
}

.tdee-high {
  background: var(--cat-high);
  color: white;
}

.tdee-very-high {
  background: var(--cat-very-high);
  color: white;
}

.tdee-legend,
.bmi-legend,
.pi-legend,
.img-legend 
{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.legend-color.low {
  background: var(--cat-low);
}

.legend-color.moderate {
  background: var(--cat-moderate);
}

.legend-color.high {
  background: var(--cat-high);
}

.legend-color.very-high {
  background: var(--cat-very-high);
}

.gender-toggle-table {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 12px 24px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.9375rem;
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


.pi-table-container,
.img-table-container,
.pi-age-table-container
{
  overflow-x: hidden; 
  overflow-y: hidden;
  text-align: center;
}
.pi-age-table-container {
  overflow-y: auto;
}
.pi-age-table-container h3{
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
  padding: 16px;
}

.pi-table .height-header,
.img-table .neck-header
{
  text-align: center;
}

/* Couleurs poids */
.pi-low { background: var(--cat-low); color: white; }
.pi-moderate-low { background: var(--cat-moderate-low); color: white; }
.pi-moderate { background: var(--cat-moderate); color: white; }
.pi-moderate-high { background: var(--cat-moderate-high); color: white; }
.pi-high { background: var(--cat-high); color: white; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.legend-color.low { background: var(--cat-low); }
.legend-color.moderate-low { background: var(--cat-moderate-low); }
.legend-color.moderate { background: var(--cat-moderate); }
.legend-color.moderate-high { background: var(--cat-moderate-high); }
.legend-color.high { background: var(--cat-high); }

.table-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 24px;
  font-style: italic;
}

.bmi-table-container {
  overflow-x: hidden;
}

/* Couleurs IMC */
.bmi-under {
  background: var(--cat-under);
  color: white;
}

.bmi-normal {
  background: var(--cat-normal);
  color: white;
}

.bmi-over {
  background: var(--cat-over);
  color: white;
}

.bmi-obese {
  background: var(--cat-obese);
  color: white;
}

.bmi-title {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin: 16px;
}

.legend-color.under {
  background: var(--cat-under);
}

.legend-color.normal {
  background: var(--cat-normal);
}

.legend-color.over {
  background: var(--cat-over);
}

.legend-color.obese {
  background: var(--cat-obese);
}

/* Responsive */
@media (max-width: 640px) {
  .bmi-table {
    font-size: 0.75rem;
  }
  
  .bmi-table th,
  .bmi-table td {
    padding: 8px 4px;
  }
  
  .bmi-legend {
    gap: 16px;
    padding: 16px;
  }
  
  .legend-item {
    font-size: 0.8125rem;
  }
}

@media (min-width: 640px) {
  .bmi-table th,
  .bmi-table td {
    padding: 14px 10px;
  }
}

.img-table-container {
  overflow-x: auto;
  overflow-y: auto;
}

/* Couleurs IMG */
.img-very-lean {
  background: var(--cat-very-lean);
  color: white;
}

.img-athlete {
  background: var(--cat-athlete);
  color: white;
}

.img-fitness {
  background: var(--cat-fitness);
  color: white;
}

.img-acceptable {
  background: var(--cat-acceptable);
  color: white;
}

.img-overweight {
  background: var(--cat-overweight);
  color: white;
}

.legend-color.very-lean {
  background: var(--cat-very-lean);
}

.legend-color.athlete {
  background: var(--cat-athlete);
}

.legend-color.fitness {
  background: var(--cat-fitness);
}

.legend-color.acceptable {
  background: var(--cat-acceptable);
}

.legend-color.overweight {
  background: var(--cat-overweight);
}



/* ---------- Footer ---------- */
.footer {
  background: var(--text);
  color: white;
  padding: 60px 20px 40px;
  margin-top: 80px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer p {
  margin-bottom: 12px;
  opacity: 0.9;
}

.footer li{
  display: inline-block;
  margin: 10px;
}

.footer a {
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.footer a:hover {
  text-decoration: underline;
  transform: translateY(2px);
}

.footer-disclaimer {
  font-size: 0.875rem;
  opacity: 0.6;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeUp 0.6s ease both;
}

.results .card:nth-child(2) { animation-delay: 0.1s; }
.results .card:nth-child(3) { animation-delay: 0.2s; }

/* ---------- Desktop / tablette ---------- */
@media (min-width: 640px) {
  .card { padding: 40px; }
  .form-card { gap: 32px; }
  .hero { padding: 160px 40px 100px; }
  .calculator-section,
  .info-section,
  .cta-section,
  .pi-table-section { padding: 40px 0; }
}

/* ---------- Mode sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary-light: rgba(14, 165, 233, 0.15);
    --accent-light: rgba(139, 92, 246, 0.15);
  }

  .seg-option.active { background: #334155; }

  .morpho-option.active {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--primary);
  }

  .morpho-option:hover {
    background: rgba(14, 165, 233, 0.1);
  }

  .highlight,
  .formula-card,
  .grid-card,
  .age-card {
    background: #1e293b;
  }

  .value-input {
    background: var(--surface);
    color: var(--text);
  }
  
  .info-pi,
  .info-forme,
  .info-age,
  .pi-table-section {
    opacity: 0.9;
  }
}

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--primary-light) 100%);
  position: relative;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-item.open {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question span:first-child {
  flex: 1;
  line-height: 1.4;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--primary);
  color: white;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-answer p {
  padding: 0 24px 20px;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-answer strong {
  color: var(--text);
  font-weight: 600;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

@media (min-width: 640px) {
  .faq-section {
    padding: 120px 0;
  }
  
  .faq-question {
    font-size: 1.0625rem;
    padding: 24px 28px;
  }
  
  .faq-answer p {
    padding: 0 28px 24px;
    font-size: 1rem;
  }
}

@media (prefers-color-scheme: dark) {
  .faq-section {
    opacity: 0.95;
  }
  
  .faq-item.open {
    border-color: var(--primary);
    background: #1e293b;
  }
}

/* ---------- Shorts Section ---------- */
details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

details[open] {
  border-color: var(--accent);
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.3rem;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: self-end;
  gap: 0.6rem;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  content: "–";
}


.cta-content details > p {
  padding: 0 1.3rem 1.2rem 3.1rem;
  color: var(--text);
  font-size: 0.97rem;
  text-align: left;
}

/* ---------- Section Vidéo ---------- */
.video-section {
  padding: 100px 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%);
  position: relative;
  overflow: hidden;
}

.video-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: rgba(236, 72, 153, 0.1);
  border-radius: 50%;
  filter: blur(80px);
}

.video-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.video-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--text);
}

/* Thumbnail cliquable (Desktop) */
.video-thumbnail {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.video-thumbnail:hover img {
  transform: scale(1.05);
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: background 0.3s ease;
}

.video-thumbnail:hover .video-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.play-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.video-thumbnail:hover .play-button {
  transform: scale(1.15);
  background: white;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.play-button svg {
  margin-left: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.video-duration {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Short Mobile */
.video-short-wrapper {
  aspect-ratio: 9/16;
  max-height: 70vh;
  margin: 0 auto;
}

.video-short-wrapper iframe {
  width: 100%;
  height: 100%;
}

/* Modal Popup (Desktop) */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.video-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.video-modal-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

.video-modal-player {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

/* Gestion responsive : afficher/cacher selon device */
@media (max-width: 1024px) {
  .video-desktop {
    display: none;
  }
  
  .video-modal {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .video-mobile {
    display: none;
  }
}

@media (max-width: 640px) {
  .video-section {
    padding: 60px 0;
  }
  
  .video-short-wrapper {
    max-height: 60vh;
  }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .video-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    opacity: 0.95;
  }
}

/* ---------- Bouton retour en haut ---------- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px rgba(102, 126, 234, 0.4),
    0 2px 8px rgba(118, 75, 162, 0.3);
  z-index: 100;
  
  /* État initial : caché */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: 
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 
    0 12px 32px rgba(102, 126, 234, 0.5),
    0 4px 12px rgba(118, 75, 162, 0.4);
  background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
}

.back-to-top:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 6px 18px rgba(102, 126, 234, 0.4),
    0 2px 6px rgba(118, 75, 162, 0.3);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.5);
  outline-offset: 4px;
}

.back-to-top svg {
  transition: transform 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

@keyframes pulse-once {
  0% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0.5); }
  70% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 15px rgba(102, 126, 234, 0); }
  100% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0); }
}

.back-to-top.visible {
  animation: pulse-once 1.2s ease-out;
}

/* Responsive mobile */
@media (max-width: 640px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }
  
  .back-to-top svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-color-scheme: dark) {
  .back-to-top {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    box-shadow: 
      0 8px 24px rgba(139, 92, 246, 0.4),
      0 2px 8px rgba(236, 72, 153, 0.3);
  }
  
  .back-to-top:hover {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    box-shadow: 
      0 12px 32px rgba(139, 92, 246, 0.5),
      0 4px 12px rgba(236, 72, 153, 0.4);
  }
}

/* ---------- Accessibilité ---------- */
input[type="range"]:focus-visible { outline: none; }

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25), 0 4px 12px rgba(14, 165, 233, 0.3);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25), 0 4px 12px rgba(14, 165, 233, 0.3);
}

.seg-option:focus-within,
.morpho-option:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.value-wrapper:focus-within .value-display { outline: none; }

/* Responsive */
@media (max-width: 640px) {
  .pi-table { font-size: 0.75rem; }
  .pi-table th, .pi-table td { padding: 8px 4px; }
  .pi-legend { gap: 16px; padding: 16px; }
  .legend-item { font-size: 0.8125rem; }
}

@media (min-width: 640px) {
  .pi-table th, .pi-table td { padding: 14px 10px; }
}