/* ==========================================================================
   KIVORA · components.css
   Boutons, cartes, badges, fenêtres, carrousels, accordéon, formulaires.
   ========================================================================== */

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-btn); }
.btn svg { flex-shrink: 0; }

/* Bouton principal : orange plein. Texte bleu nuit pour un contraste AA (6,5:1). */
.btn--primary {
  background: var(--orange-gradient);
  background-color: var(--orange);
  color: var(--ink);
  box-shadow: var(--shadow-orange);
}
.btn--primary:hover { box-shadow: 0 14px 30px -8px rgba(255, 107, 44, .65); transform: translateY(-1px); }

/* Bouton secondaire : blanc avec bordure */
.btn--secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn--secondary:hover { border-color: var(--blue-light); color: var(--blue); }

/* Bouton WhatsApp : vert, texte en grand gras (contraste AA « grand texte ») */
.btn--whatsapp {
  background: var(--green);
  color: var(--white);
  font-size: 1.1875rem;
  box-shadow: var(--shadow-green);
}
.btn--whatsapp:hover { transform: translateY(-1px); }

/* Bouton blanc plein (sur fond orange ou foncé) : texte bleu nuit */
.btn--light {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  box-shadow: 0 10px 24px -10px rgba(10, 20, 53, .35);
}
.btn--light:hover { transform: translateY(-1px); }

.btn--sm { min-height: var(--tap); padding: 8px 18px; font-size: .9375rem; border-radius: 14px; box-shadow: none; }
.btn--lg { min-height: 56px; padding: 14px 26px; font-size: 1.0625rem; }
.btn--block { display: flex; width: 100%; }

/* ---------- Petit titre (pastille bleue) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--blue-pale);
  color: var(--blue);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--yellow);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1.2;
}

/* ---------- Étiquettes de postes ---------- */
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tag {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--blue-pale);
  color: var(--ink);
  font-weight: 700;
  font-size: .9375rem;
}

/* ---------- Liste à coches ---------- */
.checklist { display: grid; gap: 14px; }
.checklist li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  font-weight: 600;
}
.checklist svg { color: var(--blue); margin-top: 1px; }
.checklist--compact { gap: 10px; }
.checklist--compact li { font-size: .9375rem; }

/* ---------- Étoiles ---------- */
.stars { display: inline-flex; gap: 2px; color: var(--yellow); }
.stars .is-off { color: var(--line); }

/* ---------- Carrousels ---------- */
.carousel__nav { display: none; gap: 8px; }
.carousel__btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1.5px solid #D5DDF2;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(10, 20, 53, .06);
  transition: border-color .2s, color .2s, opacity .2s;
}
.carousel__btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.carousel__btn:disabled { opacity: .35; cursor: default; }

.carousel {
  --card-h: 340px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 12px;
  margin-inline: calc(var(--gutter) * -1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); border-radius: 12px; }
.carousel > li { flex: 0 0 auto; scroll-snap-align: start; min-width: 0; width: min(calc(var(--card-h) * var(--r, .5625)), 82vw); }
.carousel--contracts { --card-h: 300px; }

@media (min-width: 640px) {
  .carousel__nav { display: inline-flex; }
  .carousel { --card-h: 380px; }
  .carousel--contracts { --card-h: 340px; }
}
@media (min-width: 1000px) {
  .carousel { --card-h: 420px; gap: 18px; }
  .carousel--contracts { --card-h: 380px; }
  .carousel > li { width: min(calc(var(--card-h) * var(--r, .5625)), 720px); }
}

/* ---------- Cartes de preuves ---------- */
.proof-card { display: grid; gap: 10px; }
.proof-card__media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--blue-pale);
  border: 1px solid var(--line);
  aspect-ratio: var(--r, .5625);
  padding: 0;
  cursor: pointer;
}
.proof-card--whatsapp .proof-card__media img { object-position: top; }
.proof-card__media img,
.proof-card__media video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.proof-card__media video { background: #000; }
.proof-card__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(10,20,53,0) 50%, rgba(10,20,53,.55) 100%);
}
.proof-card__play span {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: var(--blue);
  box-shadow: 0 10px 30px rgba(10,20,53,.3);
  padding-left: 4px;
}
.proof-card__caption { font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.4; }
.proof-card__caption strong { color: var(--ink); }

/* Témoin : photo ronde, prénom, pays, poste */
.witness { display: flex; align-items: center; gap: 10px; min-width: 0; }
.witness__photo { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--line); }
.witness__text { font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.35; min-width: 0; }
.witness__text strong { color: var(--ink); }

/* Emplacement vide (SHOW_PLACEHOLDERS = true) */
.proof-card--placeholder .proof-card__media {
  display: grid; place-items: center;
  border: 2px dashed #CBD5EE;
  background: repeating-linear-gradient(135deg, #F6F8FE 0 12px, #EEF3FF 12px 24px);
  color: #9AA6C8;
}
.proof-card--placeholder .proof-card__caption { color: #8A93AE; }

/* ---------- Accordéon (FAQ + conditions) ---------- */
.faq { display: grid; gap: 12px; }
.faq__item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.faq__item[open] { border-color: #C9D6FB; box-shadow: var(--shadow-card); }
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 16px 18px 16px 20px;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
  border-radius: 18px;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__chev {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue-pale); color: var(--blue);
  transition: transform .25s var(--ease);
}
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 20px 20px; color: var(--ink-soft); }

.disclosure__summary {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  list-style: none;
}
.disclosure__summary::-webkit-details-marker { display: none; }
.disclosure__summary svg { transition: transform .25s var(--ease); }
.disclosure[open] .disclosure__summary svg { transform: rotate(180deg); }

/* ---------- Fenêtres (bottom sheet mobile / centrée ordinateur) ---------- */
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.sheet::backdrop { background: rgba(10, 20, 53, .55); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-up .32s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .25s ease; }

.sheet__panel {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--white);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(10, 20, 53, .25);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
.sheet__head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 22px 16px 14px 22px;
  border-bottom: 1px solid var(--line);
}
.sheet__grip {
  position: absolute; top: 8px; left: 50%;
  width: 40px; height: 5px; margin-left: -20px;
  border-radius: 99px; background: var(--line);
}
.sheet__title { font-size: 1.375rem; letter-spacing: -0.02em; }
.sheet__close {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border-radius: 50%;
  background: var(--bg-alt); color: var(--ink);
}
.sheet__close:hover { background: var(--blue-pale); }
.sheet__body { overflow-y: auto; padding: 18px 22px 8px; overscroll-behavior: contain; }
.sheet__foot { padding: 12px 22px 18px; border-top: 1px solid var(--line); background: var(--white); }
.sheet__note {
  margin-top: 10px;
  font-size: var(--fs-xs); color: var(--ink-soft); text-align: center; line-height: 1.4;
}
.sheet__note svg { display: inline-block; vertical-align: -2px; color: var(--green); }

@media (min-width: 640px) {
  .sheet { width: min(520px, calc(100% - 40px)); margin: auto; }
  .sheet__panel { border-radius: 26px; max-height: min(86vh, 760px); box-shadow: 0 30px 80px rgba(10, 20, 53, .35); }
  .sheet__grip { display: none; }
  .sheet[open] { animation: pop-in .25s var(--ease); }
}

@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in  { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Étapes de paiement ---------- */
.pay-step { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.pay-step__legend {
  display: flex; align-items: center; gap: 10px;
  padding: 0; margin-bottom: 12px;
  font-weight: 800; font-size: 1.0625rem;
}
.pay-step__num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  font-size: var(--fs-xs); font-weight: 800;
}

/* Choix (radio en carte) */
.choice-list { display: grid; gap: 10px; }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__radio {
  flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #B9C3DE;
  display: grid; place-items: center;
}
.choice__radio::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue); transform: scale(0); transition: transform .15s var(--ease);
}
.choice__name { flex: 1; font-weight: 700; }
.choice__name small { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--ink); }
.choice__price { font-weight: 800; white-space: nowrap; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-pale); box-shadow: 0 0 0 1px var(--blue); }
.choice:has(input:checked) .choice__radio { border-color: var(--blue); }
.choice:has(input:checked) .choice__radio::after { transform: scale(1); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice.is-checked { border-color: var(--blue); background: var(--blue-pale); }
.choice.is-checked .choice__radio::after { transform: scale(1); }

/* Offre Dossier mise en avant dans la fenêtre de paiement : orange */
.choice--featured { border-color: var(--orange); background: #FFF1EA; }
.choice--featured .choice__name small { display: table; margin-top: 3px; padding: 1px 8px; border-radius: 99px; background: var(--orange); color: var(--ink); }
.choice--featured:has(input:checked), .choice--featured.is-checked { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), 0 10px 22px -12px rgba(255, 107, 44, .8); }
.choice--featured:has(input:checked) .choice__radio, .choice--featured.is-checked .choice__radio { border-color: var(--ink); background: var(--white); }
.choice--featured:has(input:checked) .choice__radio::after, .choice--featured.is-checked .choice__radio::after { background: var(--ink); }
.choice--featured:has(input:checked) .choice__name small, .choice--featured.is-checked .choice__name small { background: var(--white); }

/* Moyens de paiement (3 tuiles) */
.method-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method-list .choice {
  flex-direction: column; justify-content: center; gap: 6px;
  min-height: 84px; padding: 10px 6px;
  text-align: center;
}
.method-list .choice__radio { display: none; }
.method-list .choice__name { flex: 0; font-size: var(--fs-xs); line-height: 1.25; }
.method-logos { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; }
.method-logos img { height: 18px; width: auto; }

/* Logos de paiement officiels (fond blanc, couleurs d'origine) */
.pay-logos { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pay-logo {
  display: inline-grid; place-items: center;
  height: 34px; padding: 0 10px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--line);
}
.pay-logo img { width: auto; height: 24px; }
.pay-logo img[alt="Orange Money"] { height: 20px; }
.pay-logo img[alt="Visa"] { height: 16px; }

/* Champs */
.field { margin-bottom: 14px; }
.field__label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .9375rem; }
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-size: 1rem;   /* 16 px : évite le zoom automatique sur iPhone */
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: #8A93AE; font-weight: 500; }
.field__input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 83, 230, .18); }
.field__input[aria-invalid="true"] { border-color: #D93025; }
.field__error {
  margin-top: 6px;
  color: #C5221F;
  font-size: var(--fs-small);
  font-weight: 700;
}

/* ---------- Mini-formulaire (quiz) ---------- */
.quiz { padding: 6px 0 16px; }
.quiz__progress { height: 8px; border-radius: 99px; background: var(--blue-pale); overflow: hidden; }
.quiz__bar {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: var(--blue-gradient);
  background: linear-gradient(90deg, #4C82F7, #1D3BD1);
  transition: width .3s var(--ease);
}
.quiz__count { margin-top: 10px; font-size: var(--fs-small); font-weight: 700; color: var(--ink-soft); }
.quiz__question {
  min-height: 3.6em;
  margin: 18px 0 22px;
  font-size: 1.375rem; font-weight: 800; line-height: 1.3; letter-spacing: -0.015em;
}
.quiz__answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz__answers .btn { min-height: 60px; font-size: 1.125rem; }

.quiz-result { padding: 8px 0 18px; text-align: center; }
.quiz-result:focus { outline: none; }
.quiz-result h3 { font-size: 1.5rem; margin: 16px 0 10px; }
.quiz-result p { color: var(--ink-soft); margin-bottom: 22px; }
.quiz-result__icon {
  display: inline-grid; place-items: center;
  width: 76px; height: 76px; border-radius: 50%;
}
.quiz-result__icon--ok { background: var(--yellow); color: var(--ink); }
.quiz-result__icon--ko { background: var(--blue-pale); color: var(--blue); }

/* ---------- Lien WhatsApp texte ---------- */
.link-wa {
  display: inline-block;
  padding: 10px 4px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(31, 168, 85, .6);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.link-wa svg { display: inline-block; vertical-align: -4px; margin-right: 6px; color: var(--green); }
.link-wa:hover { color: var(--blue); }

/* ---------- Bouton WhatsApp de la barre du haut ---------- */
.header-wa { gap: 8px; padding-inline: 16px; font-size: 1.1875rem; box-shadow: var(--shadow-green); }
@media (max-width: 599px) {
  .header-wa { width: var(--tap); padding: 0; border-radius: 14px; }
  .header-wa__label { display: none; }
}

/* ---------- Bouton WhatsApp flottant (ordinateur seulement) ---------- */
.wa-float { display: none; }
@media (min-width: 900px) {
  .wa-float {
    position: fixed; z-index: 40; right: 24px; bottom: 24px;
    display: grid; place-items: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--green); color: var(--white);
    box-shadow: var(--shadow-green), 0 2px 6px rgba(10, 20, 53, .15);
    transition: transform .2s var(--ease);
  }
  .wa-float:hover { transform: scale(1.06); }
  .wa-float:focus-visible { border-radius: 50%; }
}

/* ---------- Notification « vient de réserver » ---------- */
.toast {
  position: fixed; z-index: 35;
  left: 12px; right: 12px;
  bottom: calc(var(--sticky-h) + 10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  max-width: 380px;
  padding: 10px 8px 10px 12px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -12px rgba(10, 20, 53, .3);
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s ease, transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; }
.toast__icon { color: var(--green); flex-shrink: 0; }
.toast__text { flex: 1; font-size: var(--fs-xs); line-height: 1.4; color: var(--ink-soft); }
.toast__text strong { color: var(--ink); }
.toast__close { flex-shrink: 0; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; color: var(--ink-soft); }
@media (min-width: 900px) { .toast { left: 24px; right: auto; bottom: 24px; } }

/* ---------- Visionneuse ---------- */
.lightbox {
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: rgba(10, 20, 53, .94);
  color: var(--white);
}
.lightbox::backdrop { background: rgba(10, 20, 53, .6); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__stage {
  display: grid; justify-items: center; gap: 12px;
  width: 100%; height: 100%;
  margin: 0; padding: 64px 16px 56px;
  align-content: center;
}
.lightbox__img { max-width: min(100%, 900px); max-height: calc(100dvh - 160px); width: auto; height: auto; border-radius: 12px; background: var(--white); }
.lightbox__caption { max-width: 60ch; text-align: center; font-size: var(--fs-small); color: #C3CDEB; }
.lightbox__btn {
  position: absolute;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: var(--white);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; margin-top: -24px; }
.lightbox__next { right: 12px; top: 50%; margin-top: -24px; }
.lightbox__count { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: var(--fs-small); font-weight: 700; color: #C3CDEB; }
@media (max-width: 639px) {
  /* Mobile : flèches en bas pour ne pas recouvrir l'image */
  .lightbox__prev, .lightbox__next { top: auto; bottom: 16px; margin-top: 0; }
  .lightbox__prev { left: calc(50% - 64px); }
  .lightbox__next { right: calc(50% - 64px); }
  .lightbox__stage { padding-bottom: 88px; }
}
