/* style.css – spécifique Guide Harnais */
/* Le layout général (html, body, .container, header-top, .top-nav, boutons généraux, etc.)
   vient de ../css/style.css à la racine. */

/* Titre du guide : aligné à gauche spécifiquement pour cette page */
h1 {
  text-align: left;
  color: #1f4d4d;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

/* Intro */
#guide-intro {
  font-size: 0.9rem;
  line-height: 1.4;
  background: #f2fbfb;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

/* Form / blocs */
form {
  margin: 0;
}

.blocs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bloc {
  border-radius: 10px;
  padding: 8px 14px 10px 14px;
  margin-bottom: 4px;
  border: 1px solid rgba(0,0,0,0.05);
}

.bloc legend {
  font-weight: 600;
  padding: 0 6px;
}

.bloc-chiens {
  background: #e8f5e9;
}

.bloc-harnais {
  background: #e3f2fd;
}

.bloc-resultats {
  background: #fff3e0;
}

/* Conteneurs flex génériques */
.form-flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Bloc chiens : 2 lignes indépendantes */
/* Remonter légèrement le label "Sexe" au-dessus des radios */
.ligne1-chiens .xsmall-field:first-child > label {
  margin-bottom: 0;      /* au lieu de 2px via la règle générale */
}

.ligne2-chiens {
  margin-top: 4px;
  align-items: flex-end;
}

.compact-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 110px;
  flex: 1;
}

/* tailles relatives des champs */
.xsmall-field {      /* Sexe + champs numériques */
  flex: 0.7;
  max-width: 80px;
}

.large-field {       /* Race */
  flex: 3;
}

/* Valeur par défaut des champs moyens */
.medium-field {
  flex: 1.6;
}

/* Ligne 2 : Morphologie plus étroite, Infos sup plus large */
.ligne2-chiens .compact-field:nth-child(2) {
  /* Morphologie */
  flex: 0.8;
}

.ligne2-chiens .compact-field:nth-child(3) {
  /* Informations supplémentaires */
  flex: 2.1;
}

/* Bloc harnais : petites colonnes pour les boutons, etc. */
.small-field {
  flex: 1;
  max-width: 150px;          /* au lieu de 130px */
}

/* Bloc harnais : 2 lignes comme pour le bloc chiens */
.ligne1-harnais {
  align-items: flex-end;
}

.ligne2-harnais {
  margin-top: 4px;
  align-items: flex-end;
}

/* Sur écrans étroits, laisser les éléments du bloc harnais passer plus facilement à la ligne */
@media (max-width: 750px) {
  .bloc-harnais .compact-field {
    flex: 1 0 45%;           /* 2 colonnes par ligne max, puis wrap */
    max-width: none;
  }
}

/* Bloc harnais plus compact (comme bloc chiens) */
.bloc-harnais .compact-field {
  min-height: 0;             /* au lieu de 90px, supprime la hauteur forcée */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .bloc-harnais .form-flex-wrap {
    align-items: stretch;
  }
  .bloc-harnais .compact-field > *:last-child {
    margin-top: auto;
  }
}

label {
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* Harmoniser visuellement inputs, selects et boutons */
input,
select,
button {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1.6px solid #b4d2d2;
  line-height: 1.3;
  transition: border-color 0.3s ease;
}

select {
  min-width: 130px;
  max-width: 100%;
}

input:focus,
select:focus {
  border-color: #4db8b8;
  outline: none;
}

/* Select des races : un peu plus large si possible */
#raceChien {
  min-width: 230px;
}

/* Style spécifique boutons du guide */
button {
  background: #199a9a;
  color: #fff;
  font-weight: 700;
  border: none;
  box-shadow: 0 8px 10px -6px #159292;
  margin-top: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #137a7a;
}

/* Bouton principal "Calculer" */
.btn-principal {
  font-size: 0.9rem;
  padding: 9.5px 10px;
  line-height: 1.36;
}

/* Boutons secondaires plus bas visuellement */
.btn-secondaire {
  background: #ffffff;
  color: #199a9a;
  border: 1px solid #199a9a;
  box-shadow: none;
  padding: 3px 8px;
  line-height: 1.0;
}

/* Radio sexe */
.radio-sexe {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.radio-sexe input[type="radio"] {
  width: auto;
}

/* Zone résultat + historique (spécifique guide) */
#resultat {
  background: #dff6f6;
  padding: 8px 10px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.25em;
  box-shadow: inset 3px 3px 7px #b5dede,
              inset -3px -3px 7px #f0ffff;
  min-height: 30px;
}

#resultat p {
  margin: 4px 0;
}

#historique {
  background: #f7f8fa;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: inset 2px 2px 5px #dde2e7,
              inset -3px -3px 5px #ffffff;
}

.ligne-historique {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  border-bottom: 1px solid #e1e4ea;
  padding: 3px 0;
}

.ligne-historique:last-child {
  border-bottom: none;
}

.historique-race {
  font-weight: 600;
}

.historique-mesures {
  font-size: 0.8rem;
  color: #355;
}

.historique-harnais {
  font-size: 0.8rem;
}

/* Tableau du modèle sélectionné */
#tableauxTailles {
  margin-top: 10px;
  background: #f4fbff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

#tableauxTailles h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #215c7a;
}

#tableau-modele table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#tableau-modele th,
#tableau-modele td {
  border: 1px solid #c9dfea;
  padding: 4px 6px;
  text-align: center;
}

#tableau-modele th {
  background: #e0f0fb;
}

/* Triple encart partenaires (clubs, fabricants, ressources) */
#partenaires {
  margin-top: 12px;
  background: #edf9fa;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 0.8rem;
  box-shadow: 0 1px 6px #bde6e6;
}

.partenaire-box {
  flex: 1;
  text-align: center;
  padding: 4px 6px;
  box-sizing: border-box;
}

.partenaire-box h4 {
  margin: 2px 0 4px 0;
  font-size: 0.85rem;
  color: #215c7a;
}

.logo-partenaire {
  max-width: 100%;
  max-height: 60px;
  height: auto;
  display: block;
  margin: 0 auto 4px auto;
}

/* Sur mobile, les encarts passent en colonne */
@media (max-width: 650px) {
  #partenaires {
    flex-direction: column;
  }
}

/* Footer (si tu veux un ton un peu différent) */
#site-footer {
  max-width: 90%;
  margin: 10px auto 0 auto;
  padding: 6px 8px;
  font-size: 0.75rem;
  text-align: center;
  color: #456;
}

/* Impression spécifique guide */
@media print {
  body {
    background: none;
    padding: 0;
  }
  .header-top,
  #btn-install-pwa,
  #btn-clear-hist,
  #btn-export,
  .top-nav {
    display: none !important;
  }
  .container {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
  }
}

/* Responsive spécifique guide */
@media (max-width: 650px) {
  .container {
    padding: 10px 3vw;
  }
  .header-top {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .top-nav {
    order: 3;
  }

  /* Sur petits écrans : la race peut prendre toute la ligne si besoin */
  .ligne1-chiens .large-field {
    flex: 1 0 100%;
  }
}
