/* ============================================
   ANIMETRE — Styles partagés des pages outils (tool.css)
   Chargé après base.css. Utilise exclusivement les variables de base.css.
   Mobile-first : toutes les media queries en min-width.

   Session 8A — Ajouts :
   - Groupes d'espèces avec sous-titres (.especes-groupes, .especes-groupe, .especes-groupe-titre)
   - Différenciation visuelle cobaye vs hamster (.card-cobaye)
   - Note de contexte sous le résultat (.result-note-contexte)
   ============================================ */

/* ----- INTRO ----- */
.tool-intro {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 24px;
}

/* ----- TITRE H1 DE L'OUTIL ----- */
main h1 {
  font-size: 26px;
  color: var(--bg-dark);
  margin-bottom: 8px;
  line-height: 1.25;
}

@media (min-width: 600px) {
  main h1 { font-size: 32px; }
}

/* ----- FORMULAIRE ----- */
.tool-form {
  margin-bottom: 8px;
}

fieldset {
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

legend {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* Titres de section agrandis (Espèce, Âge) — surclasse les styles natifs de legend */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: var(--space-3);
  padding: 0;
  border: 0;
}

/* ----- GRILLE DES ESPÈCES ----- */
.species-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .species-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Cacher visuellement les radios tout en les gardant accessibles */
.species-grid input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Card cliquable (le label) */
.species-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.species-card .emoji {
  font-size: 28px;
  line-height: 1;
}

/* Tailles différenciées pour les 3 gabarits de chien */
.species-card .emoji.dog-sm { font-size: 22px; }
.species-card .emoji.dog-md { font-size: 28px; }
.species-card .emoji.dog-lg { font-size: 34px; }

.species-card .name {
  font-weight: 600;
  font-size: 14px;
}

.species-card .weight {
  font-size: 12px;
  color: var(--text-secondary);
}

/* État sélectionné */
input[type="radio"]:checked + .species-card {
  border-color: var(--bg-dark);
  background: #f0ebe0; /* tint chaleureux légèrement plus soutenu que --bg-main */
}

/* Focus clavier visible */
input[type="radio"]:focus-visible + .species-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----- INPUTS ÂGE ----- */
.age-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.age-inputs label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.age-inputs input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}

.age-inputs input[type="number"]:focus {
  outline: none;
  border-color: var(--bg-dark);
}

/* ----- STEPPERS +/− ----- */
.stepper {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.stepper:focus-within {
  border-color: var(--bg-dark);
}

.stepper-btn {
  width: 44px;
  background: transparent;
  border: none;
  font-size: 22px;
  font-weight: 600;
  color: var(--bg-dark);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover { background: var(--border-subtle); }
.stepper-btn:active { background: var(--accent); }
.stepper-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stepper input[type="number"] {
  flex: 1;
  width: auto;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  padding: 12px 4px;
  background: transparent;
  min-width: 0;
  font-family: inherit;
  color: var(--text-primary);
  -moz-appearance: textfield;
}

.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper input[type="number"]:focus { outline: none; }

/* ----- BLOC RÉSULTAT ----- */
.tool-result {
  margin-top: var(--space-6);
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  border-radius: 0;
  animation: fadeInUp 0.4s ease-out;
}

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

/* Badge vert : chiffre seul centré */
.result-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
  margin-bottom: var(--space-4);
}

.result-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.result-age {
  font-size: 64px;
  font-weight: 800;
  color: var(--text-on-dark);
  line-height: 1.1;
  text-align: center;
  /* Retour à la ligne propre sur mobile (ex. "1 an et 2 mois") */
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.result-age-suffix {
  font-size: 14px;
  color: var(--text-muted-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-2);
}

@media (min-width: 600px) {
  .result-age { font-size: 80px; }
}

/* Sur mobile étroit, réduire le font-size pour que les résultats textuels
   (ex. "1 an et 2 mois" en mode inverse) tiennent sans casser au milieu d'un mot */
@media (max-width: 380px) {
  .result-age {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }
}

/* Ligne stade de vie avec emoji */
.result-stage-line {
  text-align: center;
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.result-stage-line strong {
  color: var(--bg-dark);
  font-weight: 700;
  text-transform: capitalize;
}

.stage-icon {
  display: inline-block;
  font-size: 22px;
  vertical-align: middle;
  margin-right: 2px;
  line-height: 1;
}

/* ----- CONSEILS ----- */
.result-tips-wrapper {
  /* Teinte verte pale : se distingue a la fois du fond creme de la page
     et des cards blanches (chaine de calcul). Filet vert epais a gauche
     pour rattacher le bloc au badge de resultat. */
  background: #eaf2ed;
  border: 1px solid #cfe0d8;
  border-left: 4px solid var(--bg-dark);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.result-tips-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.result-tips {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-tips li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid #cfe0d8;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
}

.result-tips li:last-child { border-bottom: none; }

.result-tips li::before {
  content: "✓ ";
  color: var(--accent-strong);
  font-weight: 700;
  margin-right: var(--space-1);
}

/* ----- ACTIONS ----- */
.result-actions {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

/* ----- BOUTONS ----- */
.btn {
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { background: var(--accent-strong); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- DISCLAIMER ----- */
.disclaimer {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  border-left: 3px solid var(--accent);
  background: #fff8f5;
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: var(--space-4);
}

/* ----- SECTION EXPLICATIVE "COMMENT ÇA MARCHE ?" ----- */
.tool-explain {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.tool-explain h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: var(--space-4);
}

@media (min-width: 600px) {
  .tool-explain h2 { font-size: 26px; }
}

.tool-explain h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.tool-explain p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

/* Note de clôture avec bordure latérale discrète */
.tool-explain-note {
  border-left: 3px solid var(--border-subtle);
  padding-left: var(--space-4);
  font-style: italic;
}

/* ----- FAQ ----- */
.tool-faq {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  margin-bottom: var(--space-7);
}

.tool-faq h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: var(--space-5);
}

@media (min-width: 600px) {
  .tool-faq h2 { font-size: 26px; }
}

.tool-faq details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.tool-faq summary {
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  user-select: none;
}

/* Supprimer le marqueur natif (Chrome/Safari) */
.tool-faq summary::-webkit-details-marker { display: none; }

/* Indicateur +/− en corail */
.tool-faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 300;
  color: var(--accent-strong);
  flex-shrink: 0;
  line-height: 1;
}

.tool-faq details[open] summary::after { content: "−"; }

.tool-faq summary:hover { background: var(--bg-main); }

.faq-answer {
  padding: 0 var(--space-5) var(--space-4);
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.faq-answer p:last-child { margin-bottom: 0; }

.faq-answer ul {
  margin: var(--space-3) 0;
  padding-left: var(--space-5);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

/* ----- TOAST DE PARTAGE ----- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ----- GROUPES D'ESPÈCES AVEC SOUS-TITRES ----- */
.especes-groupes {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.especes-groupe {
  border: none;
  padding: 0;
  margin: 0; /* annule le margin-bottom: 24px du fieldset global */
}

.especes-groupe-titre {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ----- DIFFÉRENCIATION VISUELLE COBAYE VS HAMSTER ----- */
/* Le cobaye et le hamster partagent le même emoji 🐹 ;
   une légère rotation de teinte les rend visuellement distincts */
.card-cobaye {
  filter: hue-rotate(15deg) saturate(1.1);
  display: inline-block;
}

/* ----- NOTE DE CONTEXTE SOUS LE RÉSULTAT ----- */
.result-note-contexte {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  margin-top: var(--space-2);
  margin-bottom: 0;
}

/* ============================================
   SESSION 8B — Bouton switch mode direct ⇄ inverse
   ============================================ */

/* Forcer display:none sur l'attribut hidden (protection contre les resets CSS) */
.btn-mode-switch[hidden] { display: none; }

/* Bouton mode inverse — version "envie de cliquer" */
.btn-mode-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 52px;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(
    135deg,
    rgba(255, 155, 122, 0.12) 0%,
    rgba(255, 155, 122, 0.20) 100%
  );
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 8px rgba(232, 123, 88, 0.12);
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease 0.15s both;
}

.btn-mode-switch:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 155, 122, 0.20) 0%,
    var(--accent) 100%
  );
  color: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 123, 88, 0.30);
}

.btn-mode-switch:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(232, 123, 88, 0.20);
}

.btn-mode-switch:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.btn-mode-switch-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  display: inline-block;
  animation: wiggle 2.5s ease-in-out 0.5s infinite;
}

.btn-mode-switch-label {
  flex: 0 1 auto;
}

/* État pressé (mode inverse actif, bouton "Revenir") */
.btn-mode-switch[aria-pressed="true"] {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-color: var(--bg-dark);
}

.btn-mode-switch[aria-pressed="true"]:hover {
  background: #2a5d49;
  color: var(--text-on-dark);
}

/* Pas de wiggle en mode inverse actif */
.btn-mode-switch[aria-pressed="true"] .btn-mode-switch-icon {
  animation: none;
}

/* Animation wiggle douce sur l'emoji */
@keyframes wiggle {
  0%, 90%, 100% { transform: rotate(0deg); }
  93%           { transform: rotate(-8deg); }
  96%           { transform: rotate(8deg); }
}

/* Respect du paramètre "prefers-reduced-motion" */
@media (prefers-reduced-motion: reduce) {
  .btn-mode-switch,
  .btn-mode-switch-icon {
    animation: none;
  }
  .btn-mode-switch:hover {
    transform: none;
  }
}

/* Affichage conditionnel des blocs inputs selon le mode */
.bloc-inputs.mode-direct .bloc-input-inverse {
  display: none;
}

.bloc-inputs.mode-inverse .bloc-input-direct {
  display: none;
}

.bloc-input-inverse {
  margin: var(--space-4) 0;
}

.bloc-input-inverse .input-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.bloc-input-inverse input[type="number"] {
  width: 100%;
  padding: var(--space-3);
  font-size: 1.1rem;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  box-sizing: border-box;
}

.bloc-input-inverse input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.input-help {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Message hors-plage (anecdote Bluey, Creme Puff, etc.) */
.message-hors-bornes {
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
  background: rgba(255, 155, 122, 0.1);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============================================
   SESSION 8B-FIX-TER — Disclaimers mode inverse
   ============================================ */

/* Socle commun */
.disclaimer-mode-inverse {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Jeune utilisateur — ton doux, fond crème discret */
.disclaimer-jeune {
  background: rgba(232, 223, 200, 0.4);
  border-left: 4px solid var(--border-subtle);
}

/* Chien sous 14 ans — plus marqué, fond corail léger */
.disclaimer-chien-jeune {
  background: rgba(255, 155, 122, 0.10);
  border-left: 4px solid var(--accent);
  font-weight: 500;
}

/* ============================================
   SESSION 8B-FIX-QUATER — Hero ludique mode inverse
   ============================================ */

/* Protection contre les resets CSS */
.hero-inverse[hidden] { display: none; }

.hero-inverse {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-5) var(--space-4);
  margin: var(--space-4) 0;
  background: linear-gradient(
    180deg,
    rgba(255, 155, 122, 0.06) 0%,
    rgba(255, 155, 122, 0.02) 100%
  );
  border-radius: var(--radius-lg);
  animation: heroFadeIn 0.4s ease both;
}

.hero-inverse-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-3);
  animation: heroBounce 2.5s ease-in-out infinite;
}

.hero-inverse-titre {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
  line-height: 1.3;
  max-width: 28ch;
}

.hero-inverse-soustitre {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
  animation: heroPulse 2s ease-in-out infinite;
}

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

@keyframes heroBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes heroPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-inverse,
  .hero-inverse-emoji,
  .hero-inverse-soustitre {
    animation: none;
  }
}

@media (max-width: 480px) {
  .hero-inverse {
    padding: var(--space-4) var(--space-3);
  }
  .hero-inverse-emoji {
    font-size: 3.2rem;
  }
  .hero-inverse-titre {
    font-size: 1.2rem;
  }
}

/* ============================================
   SESSION 9 — Outil ration croquettes chien
   ============================================ */

/* Suffixe d'unité sans mise en capitales (ex. "g/jour") */
.result-age-suffix--unit {
  text-transform: none;
  letter-spacing: normal;
}

/* Message d'erreur sous un champ (hors bornes) */
.field-error {
  font-size: 13px;
  color: #c0392b;
  margin-top: var(--space-1);
  padding: 4px var(--space-2);
  background: rgba(192, 57, 43, 0.06);
  border-radius: var(--radius-sm);
}

/* ============================================
   SESSION 13 — Outil ration croquettes chat
   ============================================ */

/* Variante 3 colonnes pour .age-inputs (poids + âge années + âge mois) */
.age-inputs--triple {
  grid-template-columns: repeat(3, 1fr);
}

/* Variante 1 colonne (poids de forme : un seul champ) */
.age-inputs--single {
  grid-template-columns: 1fr;
  max-width: 280px;
}

/* ============================================
   Outil poids de forme chat/chien
   ============================================ */

/* Le badge porte display:flex, qui l'emporte sur l'attribut hidden.
   Sans cette règle, le bloc reste affiché et montre un « kg » orphelin. */
.result-badge[hidden] { display: none; }

.result-age-prefix {
  font-size: 14px;
  color: var(--text-muted-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.result-zone-line {
  text-align: center;
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* Chaîne de calcul : une ligne par étape, refaisable à la main */
.result-chaine {
  list-style: decimal;
  margin: 0 0 var(--space-5);
  padding: var(--space-5) var(--space-5) var(--space-5) 2.2em;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.result-chaine li {
  padding: var(--space-2) 0;
  font-size: 15px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.result-chaine li[hidden] { display: none; }

.result-precision {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 var(--space-5);
}

.field-help {
  font-size: 14px;
  color: var(--text-secondary);
  margin: var(--space-3) 0 0;
}

.tool-illu {
  margin: 0 0 var(--space-5);
  max-width: 300px;
}

.tool-illu img {
  display: block;
  width: 100%;
  height: auto;
}

/* Grille d'activité : 2×2 sur mobile, 4×1 à partir de 600px */
.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .activity-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Masquer les radios dans la grille d'activité (même règle que .species-grid) */
.activity-grid input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ============================================
   SESSION 11 — Outil coût mensuel chien/chat
   ============================================ */

/* Encart sobre proposant une mutuelle quand l'utilisateur n'en a pas.
   Emplacement réservé pour un futur CTA d'affiliation (actuellement inactif). */
.encart-mutuelle {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.encart-mutuelle p {
  margin: 0;
}

/* ============================================
   SESSION 14 — Mode mixte croquettes + pâtée (ration-chat)
   ============================================ */

/* Toggle switch */
.mixte-toggle-wrapper {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-5);
  transition: border-color 0.15s;
}

.mixte-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.mixte-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  gap: var(--space-3);
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  background: var(--border-subtle);
  border-radius: 14px;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.mixte-toggle-input:checked + .mixte-toggle-label .toggle-switch {
  background: var(--bg-dark);
}

.mixte-toggle-input:checked + .mixte-toggle-label .toggle-switch::after {
  transform: translateX(20px);
}

.mixte-toggle-input:focus-visible + .mixte-toggle-label .toggle-switch {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Section pâtée — animation de dépliage (grid-template-rows) */
.patee-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms ease;
  margin-top: var(--space-3);
}
.patee-collapse > .patee-collapse-inner {
  overflow: hidden;
  min-height: 0;
}
.patee-collapse.is-open {
  grid-template-rows: 1fr;
}
@media (prefers-reduced-motion: reduce) {
  .patee-collapse { transition: none; }
}

.section-patee {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.patee-encart-info {
  background: rgba(255, 155, 122, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Input sachet */
.patee-input-single {
  max-width: 180px;
}

.patee-input-single label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.patee-input-single input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-family: inherit;
  background: var(--bg-main);
  color: var(--text-primary);
}

.patee-input-single input[type="number"]:focus {
  outline: none;
  border-color: var(--bg-dark);
}

/* Réglages avancés */
.patee-avances {
  margin-top: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.patee-avances > summary {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.patee-avances > summary::-webkit-details-marker { display: none; }

.patee-avances > summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 300;
  color: var(--accent-strong);
  flex-shrink: 0;
}

.patee-avances[open] > summary::after { content: "−"; }
.patee-avances > summary:hover { background: var(--bg-main); }

/* Réglages avancés — animation de dépliage */
.patee-avances-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms ease;
}
.patee-avances-body > .patee-avances-body-inner {
  overflow: hidden;
  min-height: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.patee-avances.is-open .patee-avances-body {
  grid-template-rows: 1fr;
}
@media (prefers-reduced-motion: reduce) {
  .patee-avances-body { transition: none; }
}

/* Résultat mixte */
.result-mixte[hidden] { display: none; }

.result-mixte {
  margin-bottom: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeInUp 0.25s ease-out;
}

.result-mixte-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
}

.result-mixte-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.result-mixte-val {
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
}

.result-mixte-val strong {
  color: var(--bg-dark);
  font-size: 17px;
}

.result-mixte-pct {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-main);
  margin: 0;
  letter-spacing: 0.02em;
}

.result-mixte-message[hidden] { display: none; }

.result-mixte-message {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 155, 122, 0.1);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ============================================
   SESSION 23 — Tableau de correspondances statique (age-animal)
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-table {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.tool-table h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: var(--space-4);
}

@media (min-width: 600px) {
  .tool-table h2 { font-size: 26px; }
}

.tool-table p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.tool-table-scroll {
  overflow-x: auto;
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.age-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

.age-table th,
.age-table td {
  padding: var(--space-3) var(--space-4);
  text-align: right;
}

.age-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}

.age-table thead th {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-weight: 700;
  text-align: right;
}

.age-table thead th:first-child {
  text-align: left;
}

.age-table tbody tr:nth-child(even) {
  background: var(--bg-card);
}

.age-table td {
  color: var(--text-secondary);
}

/* ----- REGISTRE FUN (.page-fun) — page age-humain-en-animal uniquement ----- */
.page-fun .fun-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--corail-deep);
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 11px;
  margin: 0 0 12px;
}

.page-fun h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  background: var(--corail-deep);
  border-radius: 3px;
  margin-top: 8px;
}

.page-fun .result-badge {
  background: var(--corail-deep);
}

.page-fun .result-badge .result-age,
.page-fun .result-badge .result-age-suffix {
  color: var(--text-on-dark);
}

.page-fun .result-age-suffix {
  font-weight: 700;
}

.page-fun .tool-result:not([hidden]) .result-badge {
  animation: funBadgeIn 180ms ease-out;
}

@keyframes funBadgeIn {
  from { transform: scale(.96); }
  to   { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .page-fun .tool-result:not([hidden]) .result-badge {
    animation: none;
  }
}

.page-fun .result-anecdote {
  font-style: italic;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 var(--space-5);
}

.page-fun .result-actions .btn-primary {
  background: var(--corail-deep);
  color: var(--text-on-dark);
}

.page-fun .result-actions .btn-primary:hover {
  background: var(--accent-strong);
  color: var(--text-on-dark);
}

/* Tableaux de barème sur petits écrans : réduire le pas de la grille
   plutôt que de forcer un défilement horizontal dès 375 px. */
@media (max-width: 560px) {
  .age-table { font-size: 13px; }
  .age-table th,
  .age-table td { padding: 10px 8px; }
  .age-table th[scope="row"] { white-space: normal; }
}

