/**
 * Pages rétractation (front) — styles.
 *
 * @author    Akyana <contact@akyana.co>
 * @copyright Akyana
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

/* ─────────────────────────────────────────────────────────────────────────
   API de personnalisation : le module est NEUTRE par défaut (gris sobres,
   police héritée du thème hôte). Pour l'habiller aux couleurs d'une boutique,
   un thème n'a qu'à redéfinir ces variables sur « .akw » dans son propre CSS :

     .akw {
       --akw-accent: var(--ma-couleur-marque);
       --akw-surface: #f7f3ec;
       --akw-font-head: var(--ma-police-titres);
     }

   Les défauts sont posés en :where() (spécificité 0) → toute redéfinition de
   thème l'emporte, quel que soit l'ordre de chargement des feuilles de style.
   ───────────────────────────────────────────────────────────────────────── */
:where(.akw) {
  --akw-text: #1a1a1a;          /* titres, texte fort */
  --akw-muted: #6a6a6a;         /* texte secondaire */
  --akw-faint: #8c8c8c;         /* libellés discrets, bordures moyennes */
  --akw-surface: #f5f5f5;       /* champs, cartes commande, encadrés */
  --akw-surface-2: #fafafa;     /* cartes, notices, reçu */
  --akw-border: #e2e2e2;        /* bordures standard */
  --akw-border-soft: #ededed;   /* bordures fines */
  --akw-accent: #1a1a1a;        /* accent NEUTRE (≈ noir), sans teinte de marque */
  --akw-accent-soft: rgba(0, 0, 0, 0.05); /* fond d'état sélectionné */
  --akw-success: var(--akw-accent); /* états « validé / confirmé » (étape faite, pastille d'accusé) */
  --akw-on-accent: #ffffff;     /* texte/icône sur fond accent */
  --akw-focus: rgba(0, 0, 0, 0.12); /* halo de focus clavier */
  --akw-radius: 4px;
  --akw-font: inherit;          /* hérite la police du thème hôte */
  --akw-font-head: inherit;     /* idem pour les titres */
}

.akw {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: var(--akw-font);
  color: var(--akw-text);
}

/* En-tête éditorial */
.akw__head {
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--akw-border);
}
.akw .eyebrow {
  display: block; margin-bottom: 12px; color: var(--akw-accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.akw__head h1,
.akw--done h1 {
  font-family: var(--akw-font-head); font-weight: 300;
  font-size: clamp(34px, 5vw, 50px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 14px; color: var(--akw-text);
}
.akw__lead { font-size: 15px; line-height: 1.65; color: var(--akw-text); margin: 0; max-width: 56ch; }
.akw__lead a, .akw__login a { color: var(--akw-accent); text-decoration: underline; text-underline-offset: 3px; }

/* Indicateur d'étapes */
.akw-steps { list-style: none; display: flex; align-items: center; gap: 14px; padding: 0; margin: 0 0 32px; }
.akw-steps__item { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--akw-faint); }
.akw-steps__num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--akw-border); background: var(--akw-surface);
  font-size: 12px; font-weight: 700; color: var(--akw-muted);
}
.akw-steps__item.is-current { color: var(--akw-text); }
.akw-steps__item.is-current .akw-steps__num { background: var(--akw-text); border-color: var(--akw-text); color: var(--akw-surface); }
.akw-steps__item.is-done { color: var(--akw-text); }
.akw-steps__item.is-done .akw-steps__num { background: var(--akw-success); border-color: var(--akw-success); color: var(--akw-on-accent); font-size: 0; }
.akw-steps__item.is-done .akw-steps__num::after { content: '✓'; font-size: 12px; line-height: 1; }
.akw-steps__sep { flex: 0 0 36px; height: 1px; background: var(--akw-border); }

/* Notice */
.akw__notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--akw-surface-2); border-left: 3px solid var(--akw-accent);
  padding: 16px 18px; margin: 0 0 32px;
}
.akw__notice svg { color: var(--akw-accent); flex-shrink: 0; margin-top: 2px; }
.akw__notice p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--akw-text); }
.akw__notice--soft { border-left-color: var(--akw-border); margin: 18px 0; }
.akw__notice--soft svg { color: var(--akw-faint); }

/* Carte */
.akw__card {
  background: var(--akw-surface-2); border: 1px solid var(--akw-border-soft);
  border-radius: var(--akw-radius); padding: 32px;
}
.akw__h2 { font-family: var(--akw-font-head); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--akw-text); }
.akw__hint { font-size: 13px; color: var(--akw-muted); line-height: 1.55; margin: 0 0 18px; }

/* Formulaire — la STRUCTURE (espacement, grille, champs) vient des composants
   Bootstrap du thème (mb-3, row/col, form-control) ; les règles ci-dessous ne
   font qu'ajouter l'habillage de marque par-dessus (couleurs, libellés). */
.akw__form { display: flex; flex-direction: column; }
.akw-field { display: flex; flex-direction: column; gap: 6px; }
.akw-field > span, .akw-field-legend {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--akw-muted); margin: 0;
}
/* Couleurs de marque par-dessus .form-control (qui garde taille/padding/largeur) */
.akw-field input.form-control,
.akw-field input {
  border-color: var(--akw-border); background: var(--akw-surface); color: var(--akw-text);
}
.akw-field input:focus { border-color: var(--akw-accent); box-shadow: 0 0 0 3px var(--akw-focus); }
.akw-orders { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.akw-field-legend { padding: 0; }

/* Cartes commande / adresse */
.akw-order-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; background: var(--akw-surface); border: 1px solid var(--akw-border);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.akw-order-card:hover { border-color: var(--akw-faint); }
.akw-order-card--selected { border-color: var(--akw-accent); background: var(--akw-accent-soft); }
.akw-order-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.akw-order-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--akw-faint); flex-shrink: 0; position: relative; margin-top: 2px; }
.akw-order-card--selected .akw-order-radio { border-color: var(--akw-accent); }
.akw-order-card--selected .akw-order-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 3px; background: var(--akw-accent); }
.akw-order-body { display: flex; flex-direction: column; gap: 3px; }
.akw-order-body strong { font-size: 14px; color: var(--akw-text); }
.akw-order-body span { font-size: 12.5px; color: var(--akw-muted); }
.akw-order-body em { font-size: 12px; font-style: normal; color: var(--akw-accent); }

/* Rétractation partielle : articles à cocher */
.akw-articles { margin: 0 0 4px; padding: 14px 16px; border: 1px solid var(--akw-border-soft); border-top: none; background: var(--akw-surface-2); }
.akw-articles.is-hidden { display: none; }
.akw-articles__title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--akw-muted); margin: 0 0 10px; }
.akw-article { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.akw-article + .akw-article { border-top: 1px solid var(--akw-border-soft); }
.akw-article input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.akw-article__check { width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid var(--akw-faint); background: var(--akw-surface); border-radius: 3px; position: relative; }
.akw-article input:checked + .akw-article__check { background: var(--akw-accent); border-color: var(--akw-accent); }
.akw-article input:checked + .akw-article__check::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--akw-on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.akw-article__name { flex: 1; font-size: 13.5px; color: var(--akw-text); }
.akw-article__name em { font-style: normal; color: var(--akw-muted); }
.akw-article__price { font-size: 13px; font-weight: 600; color: var(--akw-text); white-space: nowrap; }
.akw-article__badge { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--akw-muted); background: var(--akw-border-soft); padding: 3px 7px; border-radius: 2px; white-space: nowrap; }
.akw-article--excluded { cursor: not-allowed; opacity: 0.6; }
.akw-article--excluded .akw-article__check { border-style: dashed; background: transparent; }
.akw-articles__hint { font-size: 11.5px; line-height: 1.5; color: var(--akw-muted); margin: 10px 0 0; }

/* Boutons : .akw__cta s'appuie sur le .btn-primary du thème (intégration native) */
.akw__cta { display: inline-flex; align-items: center; justify-content: center; gap: 9px; align-self: flex-start; }
.akw__login { font-size: 13px; color: var(--akw-muted); margin: 18px 0 0; }
.akw__empty { font-size: 13.5px; color: var(--akw-muted); margin: 0; }

/* Récapitulatif déclaration */
.akw__declaration {
  white-space: pre-wrap; font-family: var(--akw-font); font-size: 13.5px; line-height: 1.7;
  background: var(--akw-surface); border: 1px solid var(--akw-border);
  padding: 18px 20px; color: var(--akw-text); margin: 0 0 4px;
}
.akw__actions { display: flex; align-items: center; gap: 22px; margin-top: 6px; }
.akw__back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--akw-muted); text-decoration: none; }
.akw__back:hover { color: var(--akw-accent); }

/* Réassurance bas de page */
.akw__trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 24px 0 0;
  margin: 32px 0 0; border-top: 1px solid var(--akw-border-soft);
}
.akw__trust li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--akw-muted); }
.akw__trust svg { color: var(--akw-accent); flex-shrink: 0; }

/* Écran terminé */
.akw--done { text-align: center; max-width: 600px; }
.akw--done .eyebrow { margin-top: 4px; }
.akw__check {
  width: 60px; height: 60px; border-radius: 50%; background: var(--akw-success); color: var(--akw-on-accent);
  display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 22px;
}
.akw__receipt {
  text-align: left; background: var(--akw-surface-2); border: 1px solid var(--akw-border-soft);
  padding: 8px 20px; margin: 24px auto; max-width: 440px;
}
.akw-receipt-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--akw-border-soft); font-size: 13.5px; }
.akw-receipt-row:last-child { border-bottom: none; }
.akw-receipt-row span { color: var(--akw-muted); }
.akw-receipt-row strong { color: var(--akw-text); }
.akw--done .akw__hint { max-width: 480px; margin: 0 auto 24px; text-align: center; }
.akw--done .akw__cta { align-self: center; margin: 0 auto; }

/* Formulaire type */
.akw-formtype__doc { border: 1px solid var(--akw-border); padding: 24px; background: var(--akw-surface-2); margin: 0 0 20px; font-size: 14px; line-height: 1.8; }
.akw-formtype__fields { list-style: none; padding: 0; margin: 12px 0 0; }
.akw-formtype__fields li { padding: 6px 0; }

/* Bouton détail commande (espace client) + pied de page */
.akw-orderlink { margin: 16px 0; }
.akw-orderlink__btn { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--akw-text); background: transparent; border: 1px solid var(--akw-faint); padding: 10px 16px; text-decoration: none; transition: all .2s; }
.akw-orderlink__btn:hover { border-color: var(--akw-accent); color: var(--akw-accent); }

@media (max-width: 560px) {
  .akw__trust { gap: 10px 16px; }
}
