/* ========================================
   PAGE TÉMOIGNAGES (/temoignages)
   Haut de page : styles de la page À propos (a-propos.css, classe about-page sur le body) ;
   fond de section, halo, bloc vide : page Blog (blog-list.css, classe blog-list-page).
   Ici : note moyenne et bouton du haut de page, grande citation (premier témoignage), mosaïque
   des autres, formulaire d'envoi avec étoiles cliquables. Réglages : admin « Page Témoignages ».
   ======================================== */

/* ---- Haut de page : note moyenne, bouton vers le formulaire ---- */
.tm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 28px;
}

.tm-score {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-family: var(--site-sans);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.tm-score strong {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.tm-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  font-family: var(--site-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-green-deep, #10201a);
  background: var(--site-lime);
  border-radius: 999px;
  text-shadow: none;
  transition: background-color 0.3s ease;
}

.tm-hero-btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--site-ease);
}

.tm-hero-btn:hover {
  color: var(--site-green-deep, #10201a);
  background: #b5d68c;
}

.tm-hero-btn:hover svg {
  transform: translateY(2px) rotate(90deg);
}

/* ---- Étoiles (note d'un avis) ---- */
.tm-stars {
  display: inline-flex;
  gap: 3px;
  margin: 0;
}

.tm-stars svg {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.2);
}

.tm-stars svg.is-on {
  color: #d6b545;
}

/* ---- Grande citation : le premier témoignage (ordre de l'admin) ---- */
.tm-featured {
  position: relative;
  max-width: 980px;
  margin: 0 auto clamp(48px, 5vw, 72px);
  padding: clamp(36px, 4vw, 56px) clamp(28px, 5vw, 72px);
  text-align: center;
  background: linear-gradient(160deg, rgba(31, 61, 43, 0.55), rgba(16, 32, 26, 0.3));
  border: 1px solid rgba(157, 198, 107, 0.18);
  border-radius: 24px;
}

.tm-quote-mark {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  color: var(--site-lime);
  opacity: 0.55;
}

.tm-featured .tm-stars {
  margin-bottom: 18px;
}

.tm-featured-text {
  margin: 0;
}

.tm-featured-text p {
  margin: 0;
  font-family: var(--site-serif);
  font-size: clamp(24px, 2.2vw, 32px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.38;
  color: #fff;
  text-wrap: balance;
}

.tm-featured .tm-author {
  justify-content: center;
  margin-top: 28px;
}

/* ---- Mosaïque : 3 cartes par rangée (2 sur tablette, 1 sur mobile), même hauteur dans une
   rangée, auteur aligné en bas ; une rangée incomplète est centrée ---- */
.tm-grid {
  --tm-cols: 3;
  --tm-gap: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--tm-gap);
}

.tm-card {
  display: flex;
  flex-direction: column;
  width: calc((100% - (var(--tm-cols) - 1) * var(--tm-gap)) / var(--tm-cols));
  margin: 0;
  padding: 28px 28px 24px;
  background: rgba(23, 44, 35, 0.72);
  border: 1px solid rgba(157, 198, 107, 0.14);
  border-radius: 20px;
  box-shadow: 0 30px 50px -40px rgba(0, 0, 0, 0.9);
  transition: border-color 0.3s ease, transform 0.45s var(--site-ease);
}

.tm-card:hover {
  border-color: rgba(157, 198, 107, 0.35);
  transform: translateY(-3px);
}

.tm-card .tm-stars {
  margin-bottom: 14px;
}

.tm-card-text {
  margin: 0;
}

.tm-card-text p {
  margin: 0;
  font-family: var(--site-serif);
  font-size: 20px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.tm-card .tm-card-text {
  margin-bottom: 22px;
}

/* Auteur en bas de la carte, aligné d'une carte à l'autre dans une rangée */
.tm-card .tm-author {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Auteur (partials/testimonial-author.ejs) ---- */
.tm-author {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.tm-author img,
.tm-initial {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.tm-author img {
  object-fit: cover;
  border: 2px solid rgba(157, 198, 107, 0.5);
}

.tm-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--site-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--site-green-deep, #10201a);
  background: var(--site-lime);
}

.tm-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tm-who strong {
  font-family: var(--site-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.tm-who small {
  font-family: var(--site-sans);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
}

.tm-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-family: var(--site-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-lime);
}

.tm-project svg {
  width: 13px;
  height: 13px;
  transition: transform 0.35s var(--site-ease);
}

.tm-project:hover {
  color: #fff;
}

.tm-project:hover svg {
  transform: translateX(4px);
}

/* ========================================
   FORMULAIRE
   ======================================== */
.tm-form-section {
  position: relative;
  padding: clamp(64px, 7vw, 112px) 0 clamp(72px, 8vw, 120px);
  background: var(--site-green, #172c23);
  border-top: 1px solid rgba(157, 198, 107, 0.12);
  scroll-margin-top: var(--site-header-h, 76px);
}

.tm-form-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.tm-form-intro {
  position: sticky;
  top: calc(var(--site-header-h, 76px) + 32px);
}

.tm-eyebrow {
  margin: 0 0 14px;
  font-family: var(--site-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--site-lime);
}

.tm-form-title {
  margin: 0;
  font-family: var(--site-serif);
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  color: #fff;
}

.tm-form-text {
  margin: 16px 0 0;
  font-family: var(--site-sans);
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
}

.tm-form-points {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.tm-form-points li {
  position: relative;
  padding-left: 28px;
  font-family: var(--site-sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

/* Petite feuille devant chaque point */
.tm-form-points li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--site-lime);
  border-radius: 0 70% 0 70%;
  opacity: 0.85;
}

.tm-form {
  padding: clamp(28px, 3vw, 44px);
  background: rgba(16, 32, 26, 0.6);
  border: 1px solid rgba(157, 198, 107, 0.16);
  border-radius: 24px;
}

/* Champ piège hors de l'écran (rempli par les robots seulement) */
.tm-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Note : 5 étoiles cliquables (radios) ---- */
.tm-rating {
  margin: 0 0 26px;
  padding: 0;
  border: 0;
}

.tm-rating legend,
.tm-field label,
.tm-label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--site-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}

.tm-req {
  color: var(--site-lime);
}

.tm-field label small,
.tm-label small {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

/* Ordre inversé dans le code (5 → 1) : « ~ » allume les étoiles de gauche */
.tm-rating-stars {
  position: relative;
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.tm-rating-stars input {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tm-rating-stars label {
  display: flex;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.22);
  transition: color 0.2s ease, transform 0.25s var(--site-ease);
}

.tm-rating-stars label svg {
  width: 32px;
  height: 32px;
}

.tm-rating-stars label:hover {
  transform: scale(1.12);
}

.tm-rating-stars input:checked ~ label,
.tm-rating-stars label:hover,
.tm-rating-stars label:hover ~ label {
  color: #d6b545;
}

.tm-rating-stars:hover input:checked ~ label:not(:hover):not(:hover ~ label) {
  color: rgba(214, 181, 69, 0.45);
}

.tm-rating-stars input:focus-visible + label {
  outline: 2px solid var(--site-lime);
  outline-offset: 2px;
}

.tm-rating-label {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--site-sans);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  vertical-align: 14px;
}

/* ---- Champs ---- */
.tm-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tm-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tm-field.is-wide {
  grid-column: 1 / -1;
}

.tm-field input,
.tm-field textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--site-sans);
  font-size: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tm-field input {
  height: 48px;
}

.tm-field textarea {
  min-height: 150px;
  line-height: 1.6;
  resize: vertical;
}

.tm-field input::placeholder,
.tm-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.tm-field input:hover,
.tm-field textarea:hover {
  border-color: rgba(157, 198, 107, 0.4);
}

.tm-field input:focus,
.tm-field textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--site-lime);
}

.tm-field.has-error input,
.tm-field.has-error textarea {
  border-color: #e98b7d;
}

.tm-counter {
  align-self: flex-end;
  margin-top: 6px;
  font-family: var(--site-sans);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.tm-counter.is-short {
  color: #e9c37d;
}

.tm-error {
  margin-top: 6px;
  font-family: var(--site-sans);
  font-size: 13px;
  color: #f0a597;
}

.tm-rating .tm-error {
  display: block;
}

/* ---- Photo : zone cliquable, puis aperçu ---- */
/* .tm-field .tm-photo-drop : passe devant le style des étiquettes (.tm-field label) */
.tm-field .tm-photo-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tm-field .tm-photo-drop[hidden] {
  display: none;
}

.tm-photo-drop svg {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--site-lime);
}

.tm-photo-drop span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--site-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: #fff;
}

.tm-photo-drop small {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.tm-photo-drop:hover,
.tm-photo input:focus-visible + .tm-photo-preview,
.tm-photo:focus-within .tm-photo-drop {
  background: rgba(157, 198, 107, 0.06);
  border-color: var(--site-lime);
}

.tm-photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(157, 198, 107, 0.3);
  border-radius: 14px;
}

.tm-photo-preview[hidden] {
  display: none;
}

.tm-photo-preview img {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
}

.tm-photo-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--site-sans);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-photo-remove {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  font-family: var(--site-sans);
  font-size: 13px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tm-photo-remove:hover {
  color: #f0a597;
  border-color: #f0a597;
}

/* ---- Envoi ---- */
.tm-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 28px;
}

.tm-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 26px;
  font-family: var(--site-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-green-deep, #10201a);
  background: var(--site-lime);
  border: 0;
  border-radius: 999px;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

/* Une règle générale du site met les span des formulaires en blanc */
.tm-submit-text {
  color: inherit;
}

.tm-submit svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--site-ease);
}

.tm-submit:hover {
  background: #b5d68c;
}

.tm-submit:hover svg {
  transform: translateX(4px);
}

.tm-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.tm-status {
  flex: 1;
  min-width: 220px;
  margin: 0;
  font-family: var(--site-sans);
  font-size: 14px;
  line-height: 1.5;
}

.tm-status.is-success {
  color: var(--site-lime);
}

.tm-status.is-error {
  color: #f0a597;
}

.tm-hero-btn:focus-visible,
.tm-project:focus-visible,
.tm-submit:focus-visible,
.tm-photo-remove:focus-visible {
  outline: 2px solid var(--site-lime);
  outline-offset: 3px;
}

/* ========================================
   TABLETTE ET MOBILE
   ======================================== */
@media (max-width: 1199px) {
  .tm-grid {
    --tm-cols: 2;
  }

  .tm-form-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-form-intro {
    position: static;
    max-width: 640px;
  }
}

@media (max-width: 767px) {
  .tm-grid {
    --tm-cols: 1;
    --tm-gap: 16px;
  }

  .tm-card {
    padding: 24px 22px 20px;
  }

  .tm-card-text p {
    font-size: 19px;
  }

  .tm-featured {
    margin-bottom: 32px;
    padding: 32px 22px;
    border-radius: 20px;
  }

  .tm-featured-text p {
    font-size: 22px;
  }

  .tm-quote-mark {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 575px) {
  .tm-hero-actions {
    gap: 14px;
    margin-top: 22px;
  }

  .tm-form {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .tm-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  /* 16 px : pas de zoom automatique de la page sur iPhone en touchant un champ */
  .tm-field input,
  .tm-field textarea {
    font-size: 16px;
  }

  .tm-rating-stars label svg {
    width: 30px;
    height: 30px;
  }

  .tm-rating-label {
    display: block;
    margin: 4px 0 0;
    vertical-align: 0;
  }

  .tm-submit {
    justify-content: center;
    width: 100%;
  }

  .tm-form-title {
    font-size: 28px;
  }

  .tm-form-text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-card,
  .tm-rating-stars label,
  .tm-hero-btn svg,
  .tm-submit svg,
  .tm-project svg {
    transition: none;
  }

  .tm-card:hover,
  .tm-rating-stars label:hover {
    transform: none;
  }
}
