/* ═══════════════════════════════════════════════════════════
   KLAMPAC — Formulaire de coordonnées + écran de confirmation du devis
   Toutes les classes commencent par .kld- pour éviter les conflits.
   ═══════════════════════════════════════════════════════════ */
:root {
  --kld-ink: #111A33;          /* texte (bleu nuit) */
  --kld-primary: #1E2F65;      /* bleu du logo KLAMPAC : boutons */
  --kld-primary-hover: #16244F;
  --kld-muted: #677087;
  --kld-bg: #FFFFFF;
  --kld-field: #F7F8FA;        /* fond des champs */
  --kld-line: rgba(17, 26, 51, .12);
  --kld-line-strong: rgba(17, 26, 51, .26);
  --kld-error: #C8352D;
  --kld-radius: 6px;
  --kld-font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --kld-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ─────────── 1. FORMULAIRE ─────────── */
.kld-form { font-family: var(--kld-font); color: var(--kld-ink); display: grid; gap: 18px; max-width: 720px }
.kld-head { display: flex; align-items: baseline; gap: 14px; padding-top: 22px; border-top: 1px solid var(--kld-line) }
.kld-head.kld-plain { border-top: 0; padding-top: 0 }
.kld-intro { margin: -8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--kld-muted) }
.kld-head small { font-size: 11px; letter-spacing: .14em; color: var(--kld-muted) }
.kld-head h3 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 500; letter-spacing: -.01em }

.kld-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.kld-fields .kld-full { grid-column: 1 / -1 }
@media (max-width: 359px) { .kld-fields { grid-template-columns: 1fr } }

/* Champ à étiquette flottante : <label class="kld-fld"><input placeholder=" "><span>Nom</span></label> */
.kld-fld { position: relative; display: block; min-width: 0 }
.kld-fld input, .kld-fld textarea, .kld-fld select {
  width: 100%; box-sizing: border-box; height: 56px; margin: 0;
  border: 1px solid var(--kld-line-strong); border-radius: var(--kld-radius);
  background: var(--kld-field); color: var(--kld-ink);
  padding: 22px 14px 6px; font: inherit; font-size: 15px; outline: none;
  transition: border-color .3s, box-shadow .3s, background-color .3s;
  -webkit-appearance: none; appearance: none;
}
.kld-fld textarea { height: 120px; resize: vertical; padding-top: 26px; line-height: 1.5 }
.kld-fld span {
  position: absolute; left: 15px; top: 18px; font-size: 14.5px; color: var(--kld-muted);
  pointer-events: none; transform-origin: left top;
  transition: transform .35s var(--kld-ease), font-size .35s var(--kld-ease);
}
.kld-fld span em { font-style: normal; opacity: .7 }
.kld-fld input:focus, .kld-fld textarea:focus, .kld-fld select:focus {
  border-color: var(--kld-primary); background: var(--kld-bg); box-shadow: 0 0 0 3px rgba(30, 47, 101, .12);
}
.kld-fld input:focus + span, .kld-fld input:not(:placeholder-shown) + span,
.kld-fld textarea:focus + span, .kld-fld textarea:not(:placeholder-shown) + span,
.kld-fld select + span { transform: translateY(-10px); font-size: 11.5px }

.kld-fld.is-error input, .kld-fld.is-error textarea { border-color: var(--kld-error) }
.kld-msg { display: block; font-size: 12px; color: var(--kld-error); margin-top: 6px }
.kld-msg:empty { display: none }

.kld-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 28px; border-radius: 999px; border: 1px solid var(--kld-primary);
  background: var(--kld-primary); color: #fff; font: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  transition: transform .4s var(--kld-ease), opacity .3s, background-color .3s, color .3s;
}
.kld-btn:hover { transform: translateY(-1px); background: var(--kld-primary-hover) }
.kld-btn:disabled { opacity: .55; cursor: wait; transform: none }
.kld-btn.kld-line { background: transparent; color: var(--kld-primary) }
.kld-btn.kld-line:hover { background: var(--kld-primary); color: #fff }
.kld-form .kld-btn { width: 100% }
.kld-note { margin: 0; font-size: 12.5px; color: var(--kld-muted); text-align: center }

/* Téléphone : indicatif + numéro sur une ligne */
.kld-phone { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px }
/* L'indicatif affiche « CI +225 » en court ; la liste complète des pays s'ouvre au toucher */
.kld-cc { position: relative }
.kld-cc select { color: transparent }
.kld-cc select option { color: var(--kld-ink) }
.kld-cc .kld-dial { position: absolute; left: 15px; bottom: 9px; font-size: 15px; font-weight: 500; pointer-events: none; color: var(--kld-ink); font-variant-numeric: tabular-nums }
.kld-cc .kld-dial small { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--kld-muted); margin-right: 6px }
.kld-fld select {
  cursor: pointer; padding-right: 36px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111A33' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.kld-fld input[data-kld-phone] { letter-spacing: .04em; font-variant-numeric: tabular-nums }

/* Panier vide : pas de formulaire, juste ce message */
.kld-empty-cart { font-family: var(--kld-font); color: var(--kld-ink); text-align: center; display: grid; justify-items: center; gap: 14px; padding: clamp(56px, 8vw, 110px) 16px }
.kld-empty-cart svg { width: 56px; height: 56px; fill: none; stroke: var(--kld-ink); stroke-width: 1.2 }
.kld-empty-cart h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -.02em }
.kld-empty-cart p { margin: 0; max-width: 42ch; color: var(--kld-muted); font-size: 15px; line-height: 1.6 }

/* Récapitulatif du panier à côté du formulaire : photo + nom + détails + quantité */
.kld-cart { font-family: var(--kld-font); color: var(--kld-ink); background: #F7F8FA; border-radius: var(--kld-radius); padding: 22px; display: grid; gap: 4px; align-content: start }
.kld-cart-title { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--kld-muted) }
.kld-cline { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--kld-line) }
.kld-cline:first-of-type { border-top: 0 }
.kld-cline-img { width: 88px; height: 104px; border-radius: 4px; background: #fff; overflow: hidden }
.kld-cline-img img { width: 100%; height: 100%; object-fit: contain; display: block }
.kld-cline-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3 }
.kld-cline-sub { margin: 3px 0 0; font-size: 13px; color: var(--kld-muted); line-height: 1.45 }
.kld-cline-qty { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap }
@media (max-width: 420px) { .kld-cline { grid-template-columns: 72px minmax(0, 1fr) auto } .kld-cline-img { width: 72px; height: 88px } }

/* Téléphone : finitions mobiles */
@media (max-width: 600px) {
  .kld-form { gap: 16px }
  .kld-head h3 { font-size: 1.6rem; letter-spacing: -.02em; font-weight: 600 }
  .kld-fields { gap: 10px }
  .kld-fld input, .kld-fld select { height: 58px; border-radius: 10px; font-size: 16px }   /* 16 px : évite le zoom automatique sur iPhone */
  .kld-fld textarea { border-radius: 10px; font-size: 16px; height: 140px }
  .kld-phone { grid-template-columns: 118px minmax(0, 1fr) }
  .kld-btn { height: 56px }
}

/* ─────────── 2. ÉCRAN DE CONFIRMATION ─────────── */
.kld-done {
  grid-column: 1 / -1; width: 100%;
  font-family: var(--kld-font); color: var(--kld-ink); background: var(--kld-bg);
  min-height: 78vh; display: grid; place-items: center; text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 52px); box-sizing: border-box;
}
.kld-done-inner { display: grid; justify-items: center; gap: 18px; width: 100%; max-width: 580px }
.kld-done-inner > * { opacity: 0; transform: translateY(14px); animation: kld-rise .9s var(--kld-ease) forwards }
.kld-done-inner > :nth-child(2) { animation-delay: .55s }
.kld-done-inner > :nth-child(3) { animation-delay: .65s }
.kld-done-inner > :nth-child(4) { animation-delay: .75s }
.kld-done-inner > :nth-child(5) { animation-delay: .85s }
.kld-done-inner > :nth-child(6) { animation-delay: .95s }
.kld-done-inner > .kld-check { opacity: 1; transform: none; animation: none }
@keyframes kld-rise { to { opacity: 1; transform: none } }

.kld-check { width: 84px; height: 84px }
.kld-check circle, .kld-check path { fill: none; stroke: var(--kld-primary); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1 }
.kld-check circle { animation: kld-draw 1.1s cubic-bezier(.76, 0, .24, 1) .15s forwards }
.kld-check path { stroke-width: 2; animation: kld-draw .7s var(--kld-ease) .95s forwards }
@keyframes kld-draw { to { stroke-dashoffset: 0 } }

.kld-ref { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--kld-muted) }
.kld-title { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-stretch: 112% }
.kld-text { margin: 0; max-width: 46ch; font-size: 15px; line-height: 1.6; color: var(--kld-muted) }
.kld-text b { color: var(--kld-ink); font-weight: 600 }

.kld-recap {
  width: 100%; box-sizing: border-box; text-align: left; margin-top: 6px;
  border: 1px solid var(--kld-line); border-radius: var(--kld-radius); padding: 18px 20px;
  display: grid; gap: 12px; font-size: 14px;
}
.kld-recap-title { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--kld-muted) }
.kld-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline }
.kld-row > span:first-child { min-width: 0 }
.kld-row small { display: block; color: var(--kld-muted); font-size: 12.5px; margin-top: 2px }
.kld-row .kld-qty { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600 }
.kld-item { align-items: center; justify-content: flex-start }
.kld-item .kld-item-txt { flex: 1 }
.kld-thumb { flex: 0 0 auto; width: 56px; height: 64px; border-radius: 4px; background: #F5F5F5; overflow: hidden; display: block }
.kld-thumb img { width: 100%; height: 100%; object-fit: contain; display: block }
.kld-recap .kld-total { border-top: 1px solid var(--kld-line); padding-top: 12px; font-weight: 600 }

.kld-contact { margin: 0; font-size: 13px; color: var(--kld-muted) }
.kld-contact b { color: var(--kld-ink); font-weight: 600; white-space: nowrap }
.kld-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px }
@media (max-width: 480px) { .kld-actions { width: 100% } .kld-actions .kld-btn { flex: 1 1 100% } }

@media (prefers-reduced-motion: reduce) {
  .kld-done-inner > *, .kld-check circle, .kld-check path { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0 }
}
