/* AppWire Host et AppWire Game : socle commun.
   Tokens repris de web.appwire.net (papier bleuté, encre bleu de Prusse, bleu du « A », Archivo et son axe de largeur,
   points de conduite). host.css et game.css redéfinissent les couleurs de surface et la largeur des titres. */

:root {
    --papier: #f2f4f7;
    --papier-2: #e6e9ef;
    --feuille: #ffffff;
    --encre: #0b1a3f;
    --encre-2: #4a5573;
    --trait: #d3d8e3;
    --trait-fort: #98a2ba;
    --bleu: #1f5ce6;
    --bleu-fonce: #1647b5;
    --bleu-pale: #e2eafc;
    --ciel: #3ca6f4;
    --ok: #0b7a51;
    --alerte: #9a5b00;
    --err: #b42318;
    --sur-bleu: #fff;

    --f: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --large-titre: 112%;

    --t-xs: .8125rem;
    --t-s: .9375rem;
    --t-m: 1.0625rem;
    --t-l: 1.25rem;
    --t-xl: 1.625rem;
    --t-2xl: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
    --t-3xl: clamp(2.6rem, 1.3rem + 5vw, 5.4rem);

    --marge: clamp(16px, 4vw, 48px);
    --rayon: 6px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 400 var(--t-m)/1.6 var(--f); overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, picture { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; font-stretch: var(--large-titre); letter-spacing: -.025em; line-height: 1.04; text-wrap: balance; }
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--papier-2); padding: .1em .35em; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--bleu); color: var(--sur-bleu); }

[hidden] { display: none !important; }
.cadre { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--marge); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--encre-2); }
.petit { font-size: var(--t-s); }
.passer { position: absolute; left: 16px; top: -80px; z-index: 50; background: var(--encre); color: var(--papier); padding: 10px 14px; border-radius: var(--rayon); font-weight: 600; }
.passer:focus { top: 12px; }
.chapo { font-size: clamp(1.0625rem, 1rem + .45vw, 1.3rem); line-height: 1.5; color: var(--encre-2); max-width: 56ch; }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section-tete { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.texte { max-width: 66ch; display: grid; gap: 1em; }
.texte ul { padding-left: 1.2em; display: grid; gap: .4em; }

/* Liens et boutons */
.lien { color: var(--bleu); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.lien:hover { text-decoration-color: currentColor; }
.lien-bouton { font: inherit; font-size: var(--t-s); font-weight: 600; color: var(--bleu); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .22em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: var(--rayon); border: 1.5px solid transparent; cursor: pointer;
    font: 600 1rem/1.2 var(--f); font-stretch: 104%; text-decoration: none; text-align: center; transition: background-color .2s, border-color .2s, color .2s; }
.btn:active { transform: translateY(1px); }
.btn-plein { background: var(--bleu); color: var(--sur-bleu); }
.btn-plein:hover { background: var(--bleu-fonce); }
.btn-ligne { border-color: var(--trait-fort); background: transparent; color: var(--encre); }
.btn-ligne:hover { border-color: var(--encre); }
.btn-petit { white-space: nowrap; min-height: 40px; padding: 8px 16px; font-size: var(--t-s); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Points de conduite : libellé ........ valeur */
.ligne { display: flex; align-items: last baseline; gap: .55em; margin: 0; }
.ligne > .lib { flex: 1 1 auto; display: flex; align-items: last baseline; gap: .55em; min-width: 0; margin: 0; }
.ligne > .lib::after { content: ""; flex: 1 1 1.5em; min-width: 1.5em; height: .5em; color: var(--trait-fort);
    background: radial-gradient(circle, currentColor 1px, transparent 1.3px) left bottom / 7px 3px repeat-x; }
.ligne > .val { flex: none; margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.fiche { display: grid; gap: 10px; }

/* Statut commercial : toujours visible, jamais décoratif */
.statut { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 600; line-height: 1.2; color: var(--encre-2); }
.statut::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.statut-disponible { color: var(--ok); }
.statut-bientot { color: var(--alerte); }
.statut-etude { color: var(--encre-2); }
.avis-grille { font-size: var(--t-s); color: var(--encre-2); border-left: 3px solid var(--trait-fort); padding: 6px 0 6px 14px; max-width: 70ch; }

/* En-tête */
.tete { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--papier) 90%, transparent); border-bottom: 1px solid var(--trait); }
@supports (backdrop-filter: blur(1px)) { .tete { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); } }
.tete-barre { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); flex: none; }
.marque .logo-a { height: 28px; width: auto; }
.marque-nom { font-size: 1.22rem; font-weight: 700; font-stretch: 112%; letter-spacing: -.03em; line-height: 1; }
.marque-nom span { font-weight: 400; color: var(--encre-2); }
.menu > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--rayon); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-icone, .menu-icone::before, .menu-icone::after { display: block; width: 20px; height: 2px; background: var(--encre); border-radius: 2px; position: relative; transition: transform .2s var(--ease), background-color .2s; }
.menu-icone::before, .menu-icone::after { content: ""; position: absolute; left: 0; }
.menu-icone::before { top: -6px; }
.menu-icone::after { top: 6px; }
.menu[open] .menu-icone { background: transparent; }
.menu[open] .menu-icone::before { transform: translateY(6px) rotate(45deg); }
.menu[open] .menu-icone::after { transform: translateY(-6px) rotate(-45deg); }
.nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--papier); border-bottom: 1px solid var(--trait); padding: 8px var(--marge) 24px; display: grid; gap: 16px; max-height: calc(100dvh - 68px); overflow: auto; }
.menu:not([open]) .nav { display: none; }
.nav-liens { list-style: none; display: grid; }
.nav-liens a { display: block; padding: 12px 0; text-decoration: none; font-weight: 500; color: var(--encre-2); border-bottom: 1px solid var(--trait); }
.nav-liens a[aria-current="page"] { color: var(--encre); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (min-width: 1340px) {
    .menu > summary { display: none; }
    .nav { position: static; display: flex; align-items: center; gap: 28px; padding: 0; background: none; border: 0; max-height: none; overflow: visible; }
    .nav-liens { display: flex; gap: 22px; }
    .nav-liens a { padding: 6px 0; border-bottom: 1.5px solid transparent; font-size: var(--t-s); white-space: nowrap; }
    .nav-liens a:hover { color: var(--encre); }
    .nav-liens a[aria-current="page"] { border-bottom-color: currentColor; font-weight: 600; }
    .nav-actions { padding-left: 24px; border-left: 1px solid var(--trait); flex-wrap: nowrap; }
}

/* Visuels */
.media { position: relative; overflow: hidden; background: var(--papier-2); }
.media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fx, 50%) 50%; }
@media (max-width: 640px) { .media img { object-position: 50% 50%; } }
.media-attente { display: grid; align-content: end; min-height: 240px; color: var(--encre-2);
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--bleu)) 18%, transparent) 0 1px, transparent 1px 14px), var(--papier-2); }
.media-attente-note { margin: 16px; font-size: var(--t-xs); font-weight: 600; background: var(--feuille); color: var(--encre-2); padding: 4px 10px; border-radius: 999px; justify-self: start; }

/* FAQ */
.faq { display: grid; border-top: 1px solid var(--trait); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--trait); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-weight: 600; font-size: var(--t-l); line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details > div { padding: 0 0 24px; color: var(--encre-2); max-width: 68ch; display: grid; gap: .8em; }

/* Configurateur */
.config { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) { .config { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; } .config-recap { position: sticky; top: 96px; } }
.config-champs { display: grid; gap: 28px; }
.choix-produit { display: grid; gap: 8px; font-weight: 600; }
.choix-produit select, .formulaire input, .formulaire textarea { font: inherit; color: var(--encre); background: var(--feuille); border: 1.5px solid var(--trait-fort); border-radius: var(--rayon); padding: 12px 14px; min-height: 48px; width: 100%; }
.champ { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
.champ legend { font-weight: 700; font-stretch: 104%; font-size: var(--t-l); padding: 0; margin-bottom: 12px; }
.choix-grille { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.choix { position: relative; display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: baseline; padding: 14px 16px; border: 1.5px solid var(--trait); border-radius: var(--rayon); background: var(--feuille); cursor: pointer; transition: border-color .15s, background-color .15s; }
.choix:hover { border-color: var(--trait-fort); }
.choix input { margin: 0; accent-color: var(--bleu); transform: translateY(2px); }
.choix:has(input:checked) { border-color: var(--bleu); background: color-mix(in srgb, var(--bleu) 7%, var(--feuille)); }
.choix:has(input:focus-visible) { outline: 2px solid var(--bleu); outline-offset: 2px; }
.choix-nom { font-weight: 600; }
.choix-detail { grid-column: 2 / 4; grid-row: 2; font-size: var(--t-s); color: var(--encre-2); line-height: 1.4; }
.choix-prix { grid-column: 3; grid-row: 1; font-size: var(--t-s); color: var(--encre-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.choix.est-bloque { opacity: .45; cursor: not-allowed; }
.choix.est-bloque .choix-nom { text-decoration: line-through; text-decoration-thickness: 1px; }
.champ-note, .note-loc { font-size: var(--t-s); color: var(--encre-2); }
.config-recap { display: grid; gap: 14px; padding: 24px; background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--rayon); }
.recap-lignes { display: grid; gap: 8px; margin: 0; font-size: var(--t-s); }
.recap-total { font-size: var(--t-xl); font-weight: 700; font-stretch: 104%; padding-top: 12px; border-top: 1px solid var(--trait); line-height: 1.2; }
.recap-total-attente { font-size: var(--t-l); }
.recap-note { font-size: var(--t-s); color: var(--encre-2); }
.recap-alerte { font-size: var(--t-s); padding: 10px 12px; background: color-mix(in srgb, var(--alerte) 12%, var(--feuille)); border-radius: var(--rayon); }
.recap-statut { font-size: var(--t-s); font-weight: 600; color: var(--alerte); }

/* Commande */
.commande { display: grid; gap: 40px; }
@media (min-width: 960px) { .commande { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; } }
.formulaire { display: grid; gap: 16px; }
.formulaire label { display: grid; gap: 6px; font-weight: 600; font-size: var(--t-s); }
.formulaire .case { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.formulaire .case input { width: auto; min-height: 0; margin-top: 4px; }
.formulaire .piege { position: absolute; left: -9999px; }
.retour { padding: 14px 16px; background: var(--feuille); border-left: 3px solid var(--bleu); }
.vide { padding: 24px; border: 1.5px dashed var(--trait-fort); border-radius: var(--rayon); }

/* Blocs communs aux pages (produit, support, engagements) */
.p-hero { padding-block: clamp(40px, 6vw, 80px) clamp(40px, 6vw, 72px); display: grid; gap: 24px; }
.p-hero h1 { font-size: clamp(2.4rem, 1.3rem + 4.4vw, 4.6rem); max-width: 15ch; }
.tableau { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
.tableau th, .tableau td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau th { font-weight: 700; color: var(--encre); }
.tableau td:first-child { font-weight: 600; white-space: nowrap; }
.defile { overflow-x: auto; }
.encart { background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 28px; display: grid; gap: 14px; }
.zone-garantie { display: grid; gap: 1px; background: var(--trait); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
@media (min-width: 800px) { .zone-garantie { grid-template-columns: 1fr 1fr; } }
.zone-garantie > div { background: var(--feuille); padding: 24px; display: grid; gap: 10px; align-content: start; }
.zone-garantie h3 { font-size: var(--t-l); }

/* Pied */
.pied { border-top: 1px solid var(--trait); padding-block: 56px; font-size: var(--t-s); color: var(--encre-2); }
.pied-grille { display: grid; gap: 32px; }
@media (min-width: 800px) { .pied-grille { grid-template-columns: 2fr 1fr 1fr; } }
.pied-marque { display: grid; gap: 16px; max-width: 42ch; }
.pied-liens { display: grid; gap: 8px; align-content: start; }
.pied-liens a { text-decoration: none; }
.pied-liens a:hover { text-decoration: underline; }
.pied-titre { font-weight: 700; color: var(--encre); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.recap-statut.statut-disponible { color: var(--ok); }
