/* =========================================================================
   Acronet Retours - feuille de style autonome (rétractation / SAV)
   Module conçu pour la revente : AUCUNE dépendance au thème hôte. Les tokens
   de design vivent sur :root (namespace --acrrp-, inertes tant qu'ils ne sont
   pas référencés) ; les composants restent scopés sous .acrrp-retours / .acrrp-modal
   pour ne pas déborder sur la boutique. Seul l'accent est surchargeable depuis
   le dashboard. Contexte : clarté administrative + réassurance.
   ========================================================================= */

/* Tokens de design - posés sur :root pour être disponibles PARTOUT, y compris
   sur les éléments injectés hors de .acrrp-retours (ex. bouton .acrrp-hist-btn dans
   la liste « Mes commandes »). Volontairement AUTONOMES : aucune dépendance aux
   variables du thème hôte (--dark, --primary-*) → le module se déploie tel quel
   sur n'importe quelle boutique. Seul l'accent est surchargeable depuis le
   dashboard via --acrrp-accent*-cfg (revente). Namespace --acrrp- = zéro collision,
   et les custom properties restent inertes tant qu'elles ne sont pas référencées. */
:root {
  --acrrp-ink: #1f2937;
  --acrrp-accent: var(--acrrp-accent-cfg, #2563eb);
  --acrrp-accent-deep: var(--acrrp-accent-deep-cfg, #1d4ed8);
  --acrrp-accent-soft: var(--acrrp-accent-soft-cfg, #dbeafe);
  --acrrp-paper: #ffffff;
  --acrrp-soft: #f6f8f9;
  --acrrp-line: #e3e8ec;
  --acrrp-muted: #5f6b73;
  --acrrp-danger: #b42318;
  --acrrp-radius: 14px;
}

.acrrp-retours {
  max-width: 760px;
  margin: 0 auto;
  color: var(--acrrp-ink);
  -webkit-font-smoothing: antialiased;
}
.acrrp-retours *,
.acrrp-retours *::before,
.acrrp-retours *::after { box-sizing: border-box; }

/* ---- En-tête ---------------------------------------------------------- */
.acrrp-head { text-align: center; margin: 8px 0 26px; }
.acrrp-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--acrrp-accent-deep);
  background: var(--acrrp-accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
}
.acrrp-title {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  margin: 14px 0 8px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.acrrp-lede { color: var(--acrrp-muted); margin: 0 auto; max-width: 52ch; font-size: 15px; }

/* ---- Rail d'étapes (signature) --------------------------------------- */
.acrrp-steps {
  display: flex;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: acr;
}
.acrrp-steps li {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--acrrp-muted);
  padding-top: 40px;
}
.acrrp-steps li::before {            /* pastille numérotée */
  counter-increment: acr;
  content: counter(acr);
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--acrrp-paper);
  border: 2px solid var(--acrrp-line);
  color: var(--acrrp-muted);
  font-weight: 700;
  z-index: 1;
  transition: background .25s, border-color .25s, color .25s;
}
.acrrp-steps li::after {             /* connecteur */
  content: "";
  position: absolute;
  top: 14px; left: -50%;
  width: 100%; height: 2px;
  background: var(--acrrp-line);
  z-index: 0;
  transition: background .25s;
}
.acrrp-steps li:first-child::after { display: none; }
.acrrp-steps li.is-current { color: var(--acrrp-ink); }
.acrrp-steps li.is-current::before {
  background: var(--acrrp-accent);
  border-color: var(--acrrp-accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--acrrp-accent-soft);
}
.acrrp-steps li.is-done::before {
  background: var(--acrrp-accent-deep);
  border-color: var(--acrrp-accent-deep);
  color: #fff;
  content: "\2713";               /* coche */
}
.acrrp-steps li.is-done::after { background: var(--acrrp-accent); }

/* ---- Carte « dossier » ------------------------------------------------ */
.acrrp-card {
  position: relative;
  background: var(--acrrp-paper);
  border: 1px solid var(--acrrp-line);
  border-radius: var(--acrrp-radius);
  padding: 30px;
  box-shadow: 0 1px 2px rgba(20,33,43,.04), 0 14px 40px -22px rgba(20,33,43,.25);
}
.acrrp-card::before {                /* fine barre d'accent en tête de dossier */
  content: "";
  position: absolute; left: 24px; right: 24px; top: 0;
  height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--acrrp-accent), var(--acrrp-accent-soft));
}

/* ---- Choix du type (cartes radio) ------------------------------------ */
.acrrp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.acrrp-choice {
  display: block;
  border: 1.5px solid var(--acrrp-line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  background: var(--acrrp-paper);
}
.acrrp-choice:hover { border-color: #c5ccd2; }
.acrrp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.acrrp-choice .acrrp-choice-t { display: block; font-weight: 600; }
.acrrp-choice .acrrp-choice-d { display: block; font-size: 12.5px; color: var(--acrrp-muted); margin-top: 3px; }
.acrrp-choice:has(input:checked) {
  border-color: var(--acrrp-accent);
  background: var(--acrrp-accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acrrp-accent) 12%, transparent);
}

/* ---- Champs ----------------------------------------------------------- */
.acrrp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.acrrp-field { margin-bottom: 16px; }
.acrrp-field--full { grid-column: 1 / -1; }
.acrrp-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--acrrp-ink);
  margin-bottom: 6px;
}
.acrrp-input, .acrrp-textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--acrrp-line);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  color: var(--acrrp-ink);
  background: var(--acrrp-soft);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.acrrp-input:focus, .acrrp-textarea:focus {
  outline: none;
  border-color: var(--acrrp-accent);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acrrp-accent) 14%, transparent);
}
.acrrp-textarea { resize: vertical; min-height: 84px; }
.acrrp-hint { font-size: 12px; color: var(--acrrp-muted); margin-top: 5px; }
.acrrp-error { display: block; font-size: 12.5px; color: var(--acrrp-danger); margin-top: 5px; font-weight: 600; }
.acrrp-input.is-invalid, .acrrp-textarea.is-invalid { border-color: var(--acrrp-danger); background: #fff6f5; }

/* ---- Boutons ---------------------------------------------------------- */
.acrrp-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.acrrp-btn {
  appearance: none; border: 1.5px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 24px; border-radius: 10px;
  transition: background .2s, color .2s, border-color .2s, transform .08s;
  text-decoration: none; display: inline-block;
}
.acrrp-btn:active { transform: translateY(1px); }
.acrrp-btn--primary { background: var(--acrrp-accent); color: #fff; }
.acrrp-btn--primary:hover { background: var(--acrrp-accent-deep); }
.acrrp-btn--ghost { background: transparent; color: var(--acrrp-ink); border-color: var(--acrrp-line); }
.acrrp-btn--ghost:hover { border-color: var(--acrrp-ink); }
.acrrp-note { font-size: 12.5px; color: var(--acrrp-muted); margin: 12px 0 0; }

/* ---- Récapitulatif ---------------------------------------------------- */
.acrrp-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--acrrp-accent-soft); color: var(--acrrp-accent-deep);
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px;
}
.acrrp-banner.is-danger { background: #fdeceb; color: var(--acrrp-danger); }
.acrrp-recap { margin: 0 0 22px; border-top: 1px solid var(--acrrp-line); }
.acrrp-recap > div { display: flex; gap: 18px; padding: 11px 2px; border-bottom: 1px solid var(--acrrp-line); }
.acrrp-recap dt { flex: 0 0 38%; color: var(--acrrp-muted); font-size: 13px; margin: 0; }
.acrrp-recap dd { flex: 1; margin: 0; white-space: pre-wrap; font-size: 14.5px; }

/* ---- Succès ----------------------------------------------------------- */
.acrrp-success { text-align: center; padding: 12px 0 4px; }
.acrrp-seal {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--acrrp-accent-soft); color: var(--acrrp-accent-deep);
  font-size: 30px; line-height: 1;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--acrrp-accent) 8%, transparent);
}
.acrrp-success h2 { margin: 0 0 8px; font-size: 21px; }
.acrrp-success p { color: var(--acrrp-muted); max-width: 46ch; margin: 0 auto 18px; font-size: 14.5px; }
.acrrp-ref { font-weight: 700; color: var(--acrrp-ink); }

.acrrp-foot-note { text-align: center; font-size: 12px; color: var(--acrrp-muted); margin-top: 16px; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 560px) {
  .acrrp-card { padding: 22px 18px; }
  .acrrp-choices, .acrrp-grid { grid-template-columns: 1fr; }
  .acrrp-steps li { font-size: 11px; }
  .acrrp-recap dt { flex-basis: 44%; }
}

@media (prefers-reduced-motion: reduce) {
  .acrrp-retours * { transition: none !important; }
}

/* =========================================================================
   Intégration dans le thème : la page /retours est rendue à l'intérieur de
   <section id="content" class="page-content card card-block"> et sous un
   <header class="page-header"><h1>…</h1></header> qui fait doublon avec notre
   propre titre. On cible le body du contrôleur (#module-retractationpro-retractation)
   pour aplatir la carte du thème et retirer le titre dupliqué - sans toucher au
   reste du site.
   ========================================================================= */
#module-retractationpro-retractation .page-header { display: none; }
#module-retractationpro-retractation #content.page-content {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 28px 16px;
  margin: 0 auto;
}
.acrrp-lede { text-align: center; }

/* Le thème applique `p:last-child { margin:0 }` (spécificité 0,1,1) qui écrase
   notre margin auto. On remonte la spécificité (deux classes) pour re-forcer le
   centrage du bloc et préserver les marges utiles. */
.acrrp-retours .acrrp-lede { margin-left: auto; margin-right: auto; }
.acrrp-retours .acrrp-foot-note { margin-top: 16px; }
.acrrp-retours .acrrp-note { margin-top: 12px; }

/* ---- Espace client : sélecteur commande + tableau produits + bloc info ---- */
.acrrp-muted { color: var(--acrrp-muted); }
.acrrp-info {
  background:#fff; border:1px solid var(--acrrp-line); border-left:4px solid var(--acrrp-accent);
  border-radius:10px; padding:16px 18px; margin:22px 0 0; font-size:14.5px; line-height:1.6;
}
.acrrp-info :where(h1,h2,h3,h4){ margin:.2em 0 .4em; font-size:1.05em; }
.acrrp-info p{ margin:0 0 .6em; }
.acrrp-info p:last-child{ margin-bottom:0; }
.acrrp-info a{ color:var(--acrrp-accent-deep); text-decoration:underline; }
.acrrp-order-ref { margin:0 0 18px; color:var(--acrrp-muted); font-size:14px; }
.acrrp-order-list { list-style:none; margin:0; padding:0; }
.acrrp-order-list li {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 0; border-bottom:1px solid var(--acrrp-line); flex-wrap:wrap;
}
.acrrp-order-list li:last-child{ border-bottom:0; }
.acrrp-tag { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.04em; padding:2px 8px; border-radius:999px; background:#eef1f3; color:var(--acrrp-muted); margin-left:6px; }
.acrrp-tag--ok { background:var(--acrrp-accent-soft); color:var(--acrrp-accent-deep); }
.acrrp-prod-table { width:100%; border-collapse:collapse; margin:8px 0 4px; }
.acrrp-prod-table td { padding:10px 8px; border-bottom:1px solid var(--acrrp-line); vertical-align:middle; }
.acrrp-prod-table tr:last-child td { border-bottom:0; }
.acrrp-prod-check { width:34px; }
.acrrp-prod-check input { width:18px; height:18px; }
.acrrp-prod-name { font-size:14.5px; }
.acrrp-prod-qty { white-space:nowrap; text-align:right; }
.acrrp-qty { width:64px; padding:7px 8px; border:1.5px solid var(--acrrp-line); border-radius:8px; font:inherit; background:var(--acrrp-soft); text-align:center; }
.acrrp-qty:focus { outline:none; border-color:var(--acrrp-accent); background:#fff; box-shadow:0 0 0 3px color-mix(in srgb, var(--acrrp-accent) 14%, transparent); }

/* ============================ Modale espace client ============================ */
.acrrp-modal-ov { position:fixed; inset:0; background:rgba(20,33,43,.55); display:none; z-index:99999; padding:16px; overflow:auto; }
@supports (backdrop-filter:blur(2px)) { .acrrp-modal-ov { backdrop-filter:blur(3px); } }
.acrrp-modal-ov.is-open { display:block; }
.acrrp-modal { max-width:640px; margin:5vh auto; background:#fff; border-radius:16px; box-shadow:0 30px 80px -20px rgba(0,0,0,.5); overflow:hidden; animation:acrrp-pop .22s cubic-bezier(.34,1.2,.64,1); }
@keyframes acrrp-pop { from { opacity:0; transform:translateY(14px) scale(.985); } to { opacity:1; transform:none; } }
.acrrp-modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 22px; border-bottom:1px solid var(--acrrp-line); font-weight:700; color:var(--acrrp-ink); position:relative; font-size:1.05em; }
.acrrp-modal-head::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; background:linear-gradient(90deg, var(--acrrp-accent), var(--acrrp-accent-soft)); }
.acrrp-modal-x { border:0; background:none; font-size:26px; line-height:1; cursor:pointer; color:var(--acrrp-muted); padding:0 4px; }
.acrrp-modal-x:hover { color:var(--acrrp-ink); }
.acrrp-modal-body { padding:22px; max-height:76vh; overflow:auto; }
.acrrp-modal-body.acrrp-retours { max-width:none; margin:0; }
@media (max-width:560px) { .acrrp-modal { margin:0; border-radius:0; min-height:100vh; } .acrrp-modal-body { max-height:none; } }

/* Bouton injecté dans la liste « Mes commandes ». Il vit DANS le DOM du thème
   (hors de tout conteneur scopé), donc une règle du thème (ex. `#history td a`)
   peut écraser ses propriétés. Comme le module doit marcher sur n'importe quel
   thème (revente), on blinde la signature visuelle avec !important sur ce seul
   élément - usage justifié d'un widget injecté en territoire hostile. */
.acrrp-hist-btn {
  display:inline-block !important;
  width:auto !important;
  margin-top:6px !important;
  padding:7px 16px !important;
  border:0 !important;
  border-radius:8px !important;
  font-size:.85em !important;
  font-weight:600 !important;
  line-height:1.35 !important;
  color:#fff !important;
  text-decoration:none !important;
  background:var(--acrrp-accent) !important;
  box-shadow:0 2px 6px -1px color-mix(in srgb, var(--acrrp-accent) 50%, transparent);
  transition:background .15s;
}
.acrrp-hist-btn:hover { background:var(--acrrp-accent-deep) !important; color:#fff !important; }

.acrrp-subhead { font-size:1.05em; font-weight:700; color:var(--acrrp-ink); margin:18px 0 10px; }

/* Lien permanent injecté en pied de page (hookDisplayFooter). Présenté en
   pastille discrète aux couleurs d'accent du thème (var --acrrp-accent, pilotable
   depuis le dashboard → zéro couleur en dur, cohérent avec la revente).
   display:block + width:100% : force le centrage même quand le footer hôte met
   son conteneur en flex (sinon le div se réduit à son contenu et reste à gauche).
   Pas de marge basse : supprime l'espace blanc qui cassait le footer. */
.acronet-retours-footer {
  display:block;
  width:100%;
  margin:14px 0 0;
  text-align:center;
  font-size:.9em;
}
.acronet-retours-footer a {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 16px;
  border-radius:999px;
  font-weight:600;
  line-height:1.3;
  text-decoration:none;
  color:#fff;
  background:var(--acrrp-accent);
  border:1px solid var(--acrrp-accent);
  box-shadow:0 2px 8px -2px color-mix(in srgb, var(--acrrp-accent) 50%, transparent);
  transition:background .15s, color .15s, box-shadow .15s;
}
.acronet-retours-footer a::before {
  content:"\21BA"; /* ↺ flèche retour - neutre, pas d'emoji */
  font-size:1.05em;
  line-height:1;
}
.acronet-retours-footer a:hover {
  color:var(--acrrp-accent-deep);
  background:var(--acrrp-accent-soft);
  border-color:color-mix(in srgb, var(--acrrp-accent) 28%, transparent);
  box-shadow:none;
}
