/* ============================================================
   KUBAHOME — Page de qualification (Étape 1)
   Mobile-first, typeform-style, une question à la fois
   ============================================================ */

/* --- Structure globale ------------------------------------ */
.qual-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* --- Header minimal --------------------------------------- */
.qual-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

.qual-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
}

.qual-logo span {
  color: var(--accent);
}

/* --- Barre de progression --------------------------------- */
.progress-bar {
  height: 2px;
  background: var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

/* --- Bouton retour ---------------------------------------- */
.btn-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0.4rem 0;
  transition: color var(--transition);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-back:hover { color: var(--text); }

.btn-back svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.btn-back:hover svg { transform: translateX(-3px); }

.btn-back.hidden { visibility: hidden; }

/* --- Compteur d'étapes + langue ---------------------------- */
.qual-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-counter {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text-light);
}

/* --- Panneau question ------------------------------------- */
.qual-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.q-panel {
  width: 100%;
  max-width: 600px;
  animation: fadeInUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.q-panel.hidden {
  display: none;
}

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

/* --- Texte question --------------------------------------- */
.q-label {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.q-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.q-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 300;
  margin-bottom: 2rem;
  max-width: 50ch;
}

/* --- Options (choix) -------------------------------------- */
.q-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.q-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text);
  text-align: left;
  transition: border-color var(--transition), background var(--transition), transform 0.15s ease;
  cursor: pointer;
  min-height: 56px; /* Touch target mobile */
  gap: 0.75rem;
}

.q-option:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.q-option:active {
  transform: scale(0.99);
}

.q-option.selected {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.q-option__indicator {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}

.q-option:hover .q-option__indicator,
.q-option.selected .q-option__indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.q-option__indicator svg {
  display: none;
  width: 10px;
  height: 10px;
  stroke: white;
  fill: none;
}

.q-option.selected .q-option__indicator svg { display: block; }

.q-option__label { flex: 1; }

/* Sur desktop : grille 2 colonnes pour Q1 et Q5 */
@media (min-width: 640px) {
  .q-options--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Formulaire coordonnées ------------------------------- */
.q-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.form-field-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 480px) {
  .form-field-row {
    flex-direction: row;
  }

  .form-field-row .form-field {
    flex: 1;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
}

.form-field input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 300;
  color: var(--text);
  transition: border-color var(--transition);
  min-height: 52px;
  appearance: none;
  -webkit-appearance: none;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-field input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.form-field input.error {
  border-color: #c0392b;
}

/* --- Choix "Format du rendez-vous" (réutilise .q-options) -- */
.form-field .q-options {
  margin-top: 0.15rem;
}

.form-field .q-option {
  min-height: 48px;
  padding: 0.85rem 1.1rem;
}

/* --- Téléphone (intl-tel-input) ---------------------------- */
.form-field .iti {
  width: 100%;
}

.form-field .iti input {
  padding-left: 84px;
}

.form-field .iti__selected-flag {
  border-radius: var(--radius) 0 0 var(--radius);
}

.field-error {
  font-size: 0.78rem;
  color: #c0392b;
  display: none;
}

.field-error.visible { display: block; }

.form-consent {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* --- Bouton de soumission --------------------------------- */
.btn-submit {
  margin-top: 0.5rem;
  width: 100%;
  padding: 1.1rem;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition);
  min-height: 52px;
}

.btn-submit:hover { background: var(--bg-dark); }

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-submit--loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 0.6rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Écrans de résultat ----------------------------------- */
.result-screen {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-screen.hidden { display: none; }

.result-screen__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-screen__icon--neutral {
  background: var(--bg-warm);
  color: var(--text-light);
}

.result-screen__icon--success {
  background: var(--bg-warm);
  color: var(--accent);
}

/* Créneau rappelé sur l'écran de confirmation */
.result-screen .result-slot {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--accent);
}

.result-screen__cta {
  display: inline-block;
  margin-top: 2rem;
}

.result-screen__icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.result-screen h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 400;
  margin-bottom: 1rem;
}

.result-screen p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 48ch;
  margin: 0 auto;
}

.result-screen .result-email-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-screen .result-email-form input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--white);
}

.result-screen .result-email-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   ÉCRAN FINAL — preuve sociale + calendrier (une seule étape)
   Mobile-first, colonne centrée. Les bandes scrollables (avis,
   jours) défilent à l'intérieur, jamais la page.
   ============================================================ */
.q-panel--final {
  max-width: 920px;
  margin: 0 auto;
}

/* Le panneau est un conteneur flex : sans min-width:0, son enfant prend
   la largeur intrinsèque (énorme) des bandes scrollables et fait déborder
   la page horizontalement sur mobile. */
.q-panel--final > .final-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0 1.25rem;
  text-align: center;
}

/* Paragraphes longs : centrés mais gardés à une largeur lisible */
.final-wrap p {
  margin-left: auto;
  margin-right: auto;
}

.proof-title {
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.proof-subtitle {
  max-width: 54ch;
  margin-bottom: 2rem;
}

/* --- Bandeau Google --------------------------------------- */
.proof-google {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.proof-google__g {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.proof-google__main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.proof-google__stars {
  color: var(--accent);
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

.proof-google__rating {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
}

.proof-google__count,
.proof-google__verified {
  font-size: 0.78rem;
  color: var(--text-light);
}

.proof-google__verified {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  background: var(--bg-warm);
  border-radius: var(--radius);
}

/* --- Photo héro ------------------------------------------- */
.proof-hero {
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: var(--radius);
}

.proof-hero img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.proof-hero figcaption {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

@media (min-width: 640px) {
  .proof-hero img { aspect-ratio: 16 / 9; }
}

/* --- Blocs internes --------------------------------------- */
.proof-block {
  margin-top: 3rem;
}

.proof-heading {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 1.7rem);
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.proof-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  max-width: 52ch;
  margin-bottom: 1.25rem;
}

/* --- Les 4 engagements (repris de la landing) -------------- */
.proof-pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.proof-pillar {
  background: var(--white);
  padding: 1.5rem 1.25rem;
}

.proof-pillar__icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.85rem;
  color: var(--accent);
}

.proof-pillar__icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.25;
}

.proof-pillar h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.proof-pillar p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-light);
  max-width: 34ch;
}

@media (min-width: 640px) {
  .proof-pillars { grid-template-columns: 1fr 1fr; }
}

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

/* --- Carrousel d'avis Google ------------------------------ */
.proof-reviews {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  padding-bottom: 0.75rem;
  /* Déborde du conteneur pour un vrai plein écran sur mobile */
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  justify-content: flex-start;
  justify-content: safe center;
}

.proof-review {
  flex: 0 0 auto;
  width: min(78vw, 320px);
  scroll-snap-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.proof-review img {
  width: 100%;
  height: auto;
}

/* Sur écran large, plus de défilement : tous les avis sont posés en
   colonnes (hauteurs inégales absorbées par le flux multi-colonnes). */
@media (min-width: 900px) {
  .proof-reviews {
    display: block;
    columns: 2;
    column-gap: 0.85rem;
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .proof-review {
    width: auto;
    margin-bottom: 0.85rem;
    break-inside: avoid;
  }

  /* L'invite « faites défiler » n'a plus de sens ici */
  .proof-hint--scroll { display: none; }
}

/* --- Galerie de réalisations ------------------------------ */
.proof-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.proof-gallery__item {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-warm);
}

.proof-gallery__item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform var(--transition);
}

.proof-gallery__item:hover img {
  transform: scale(1.03);
}

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

/* --- Chiffres clés ---------------------------------------- */
.proof-stats {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.proof-stat {
  background: var(--white);
  padding: 1.1rem 0.75rem;
}

.proof-stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1.2;
}

.proof-stat__label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

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

/* --- Zone couverte ---------------------------------------- */
.proof-zone {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-warm);
  border-radius: var(--radius);
}

.proof-zone__label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.proof-zone__value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
}

/* --- Marques partenaires ---------------------------------- */
.proof-brands {
  margin-top: 2rem;
}

.proof-brands__label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.proof-brands__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.proof-brand {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-light);
  opacity: 0.8;
}

/* --- Séparateur preuve → calendrier ----------------------- */
.final-divider {
  width: 60px;
  height: 1px;
  margin: 3.5rem auto;
  background: var(--accent);
  opacity: 0.5;
}

/* ============================================================
   PARTIE CALENDRIER DE L'ÉCRAN FINAL
   ============================================================ */
.rdv-section .q-label {
  margin-bottom: 0.75rem;
}

.rdv-title {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  margin-bottom: 0.75rem;
}

.rdv-format-note {
  max-width: 46ch;
  margin-bottom: 2rem;
}

.rdv-body {
  margin-top: 1.5rem;
}

.rdv-label {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

/* --- Bande de jours scrollable ---------------------------- */
.rdv-days {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 0.6rem;
  margin-bottom: 1.75rem;
  /* `safe` évite que le début de la bande devienne inatteignable
     quand les jours débordent. */
  justify-content: flex-start;
  justify-content: safe center;
}

.rdv-day {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 72px;
  padding: 0.7rem 0.6rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.rdv-day:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.rdv-day.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.rdv-day__weekday,
.rdv-day__month {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--text-light);
}

.rdv-day.selected .rdv-day__weekday,
.rdv-day.selected .rdv-day__month {
  color: rgba(255, 255, 255, 0.85);
}

.rdv-day__num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.1;
}

/* --- Créneaux horaires (chips) ---------------------------- */
.rdv-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.rdv-slot {
  padding: 0.7rem 1.1rem;
  min-height: 46px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.rdv-slot:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.rdv-slot.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.rdv-hint {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Récapitulatif ---------------------------------------- */
.rdv-recap {
  display: none;
  margin-top: 1.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-warm);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text);
  max-width: 48ch;
}

.rdv-recap.visible { display: block; }

.rdv-reassurance {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

/* --- États chargement / erreur ---------------------------- */
.rdv-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 2.5rem 1rem;
}

.rdv-state__text {
  font-size: 0.92rem;
  color: var(--text-light);
  max-width: 42ch;
}

.rdv-state--error .rdv-state__text {
  color: var(--text);
}

.rdv-phone {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

.rdv-phone:hover {
  color: var(--accent-dark);
}

.rdv-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-retry {
  padding: 0.7rem 1.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.btn-retry:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

/* --- Footer minimal --------------------------------------- */
.qual-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
  border-top: 1px solid var(--border-light);
}
