/* =====================================================
   imc.css — Calculateur IMC (modèle calculator)
   ===================================================== */

/* --- Conteneur général --- */
#imc {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* --- Hero / intro --- */
.imc-hero {
  margin: 1.5rem 0 2rem;
  text-align: center;
}

.imc-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text, #161616);
  margin-bottom: 0.75rem;
}

.imc-hero__sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #555;
  max-width: 640px;
  margin: 0 auto;
}

/* =====================================================
   CALCULATEUR
   ===================================================== */
.imc-calc {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Ligne de champs */
.imc-calc__row {
  margin-bottom: 1.25rem;
}

.imc-calc__row--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* Champ */
.imc-calc__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.imc-calc__field label,
.imc-calc__field legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.imc-calc__field legend {
  padding: 0;
  border: 0;
}

.imc-calc__field--sex {
  border: 0;
  padding: 0;
  margin: 0;
}

/* Boutons sexe */
.imc-calc__sex-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.sex-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sex-btn:hover {
  border-color: var(--color-primary, #37ED4A);
  color: var(--color-text, #161616);
}

.sex-btn.active {
  border-color: var(--color-primary, #37ED4A);
  background: linear-gradient(135deg, rgba(55, 237, 74, 0.08), rgba(55, 237, 74, 0.02));
  color: var(--color-text, #161616);
  box-shadow: 0 0 0 3px rgba(55, 237, 74, 0.15);
}

.sex-btn svg {
  flex-shrink: 0;
}

/* Input wrap */
.imc-calc__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.imc-calc__input-wrap input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  color: var(--color-text, #161616);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -moz-appearance: textfield;
}

.imc-calc__input-wrap input::-webkit-inner-spin-button,
.imc-calc__input-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.imc-calc__input-wrap input:focus {
  border-color: var(--color-primary, #37ED4A);
  box-shadow: 0 0 0 3px rgba(55, 237, 74, 0.15);
}

.imc-calc__unit {
  position: absolute;
  right: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #999;
  pointer-events: none;
}

/* Bouton calculer */
.imc-calc__submit {
  display: block;
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--color-primary, #37ED4A);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.imc-calc__submit:hover {
  background: var(--color-primary-dark, #2EB83D);
}

.imc-calc__submit:active {
  transform: scale(0.98);
}

/* =====================================================
   RÉSULTAT
   ===================================================== */
.imc-result {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #f0f0f0;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.imc-result__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
}

.imc-result__value {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-text, #161616);
}

.imc-result__label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-top: 0.25rem;
}

.imc-result__category {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

.imc-result__detail {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  max-width: 540px;
  margin: 0 auto 1.5rem;
}

/* Couleurs par catégorie */
.cat--denutrition  { background: #f3e8ff; color: #7c3aed; }
.cat--maigreur     { background: #dbeafe; color: #2563eb; }
.cat--normal       { background: #dcfce7; color: #16a34a; }
.cat--surpoids     { background: #fef9c3; color: #ca8a04; }
.cat--obesite1     { background: #ffedd5; color: #ea580c; }
.cat--obesite2     { background: #fee2e2; color: #dc2626; }
.cat--obesite3     { background: #fce7f3; color: #be185d; }

/* =====================================================
   JAUGE VISUELLE
   ===================================================== */
.imc-gauge {
  position: relative;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  padding-bottom: 1.75rem;
}

.imc-gauge__bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
}

.imc-gauge__zone { flex: 1; }
.imc-gauge__zone--denutrition { background: #a78bfa; }
.imc-gauge__zone--maigreur    { background: #60a5fa; }
.imc-gauge__zone--normal      { background: #4ade80; }
.imc-gauge__zone--surpoids    { background: #facc15; }
.imc-gauge__zone--obesite1    { background: #fb923c; }
.imc-gauge__zone--obesite2    { background: #f87171; }
.imc-gauge__zone--obesite3    { background: #f472b6; }

.imc-gauge__cursor {
  position: absolute;
  top: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-text, #161616);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  left: 0;
}

.imc-gauge__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding: 0 2%;
  font-size: 0.7rem;
  color: #999;
  font-weight: 600;
}

/* Poids idéal */
.imc-result__ideal {
  font-size: 0.9rem;
  color: #666;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-radius: 8px;
  display: inline-block;
}

.imc-result__ideal strong {
  color: var(--color-text, #161616);
  font-weight: 700;
}

/* =====================================================
   TABLEAU OMS
   ===================================================== */
.imc-section {
  margin-bottom: 3rem;
}

.imc-section h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--color-text, #161616);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary, #37ED4A);
}

.imc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.imc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.imc-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  background: #f9fafb;
  border-bottom: 2px solid #e5e5e5;
}

.imc-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  color: var(--color-text, #161616);
}

.imc-table tbody tr:hover {
  background: #fafafa;
}

/* Pastilles couleur dans le tableau */
.imc-table__row--denutrition td:first-child { border-left: 4px solid #a78bfa; }
.imc-table__row--maigreur td:first-child    { border-left: 4px solid #60a5fa; }
.imc-table__row--normal td:first-child       { border-left: 4px solid #4ade80; }
.imc-table__row--surpoids td:first-child     { border-left: 4px solid #facc15; }
.imc-table__row--obesite1 td:first-child     { border-left: 4px solid #fb923c; }
.imc-table__row--obesite2 td:first-child     { border-left: 4px solid #f87171; }
.imc-table__row--obesite3 td:first-child     { border-left: 4px solid #f472b6; }

/* =====================================================
   CONTENU SEO
   ===================================================== */
.imc-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.imc-content section {
  border-top: 2px solid var(--color-primary, #37ED4A);
  padding-top: 1.25rem;
}

.imc-content h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text, #161616);
  margin: 0 0 1rem;
}

.imc-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text, #161616);
  margin: 0 0 0.85rem;
}

.imc-content p:last-child {
  margin-bottom: 0;
}

/* --- Images dans le contenu --- */
.imc-content picture {
  display: block;
  max-width: 480px;
  margin: 1.25rem auto 1.5rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.imc-content picture img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.imc-content a {
  color: var(--color-primary-dark, #2EB83D);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.imc-content a:hover {
  text-decoration: none;
}

/* Bloc formule */
.imc-formula {
  background: #f0fdf4;
  border-left: 4px solid var(--color-primary, #37ED4A);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  text-align: center;
}

.imc-formula p {
  font-size: 1.15rem;
  margin: 0;
}

/* =====================================================
   FAQ
   ===================================================== */
.imc-faq {
  border-top: 2px solid var(--color-primary, #37ED4A);
  padding-top: 1.25rem;
}

.imc-faq h2 {
  margin-bottom: 1.25rem;
}

.imc-faq__item {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.imc-faq__item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.imc-faq__item[open] {
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.imc-faq__question {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #161616);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.imc-faq__question::-webkit-details-marker {
  display: none;
}

.imc-faq__question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: #999;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.imc-faq__item[open] .imc-faq__question::after {
  content: '−';
  color: var(--color-primary-dark, #2EB83D);
}

.imc-faq__answer {
  padding: 0 1.25rem 1rem;
}

.imc-faq__answer p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
  #imc {
    padding: 0 1rem 2rem;
  }

  .imc-calc {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .imc-calc__row--3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .sex-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }

  .imc-table {
    font-size: 0.85rem;
  }

  .imc-table th,
  .imc-table td {
    padding: 0.65rem 0.75rem;
  }

  .imc-gauge {
    max-width: 100%;
  }
}
