/* Site SimpliciOS — mêmes couleurs, police et esprit que l'application (src/renderer/css/base.css) :
   grosses cartes arrondies, gros boutons libellés, texte grand et contrasté, rien qui bouge. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/polices/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/polices/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/polices/atkinson-hyperlegible-next-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --font: 'Atkinson Hyperlegible Next', 'Segoe UI', Arial, sans-serif;
  --bg: #F3F0E8;
  --desk: #E2DDD3;
  --surface: #FFFFFF;
  --surface-2: #F8F6F1;
  --hover: #EDE9E0;
  --text: #1C1B19;
  --muted: #58544D;
  --border: #D8D2C6;
  --border-strong: #B9B1A3;
  --primary: #1B5CA8;
  --primary-strong: #144A8A;
  --primary-soft: #E2ECF8;
  --on-primary: #FFFFFF;
  --ok: #1D7436;
  --ok-soft: #E1F2E5;
  --danger: #B3261E;
  --danger-soft: #FBE7E5;
  --warn: #8A5A00;
  --warn-soft: #FFF3D1;
  --focus: #F2A900;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(40, 32, 20, .10), 0 6px 20px rgba(40, 32, 20, .08);
  color-scheme: light;
}

html { font-size: 20px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 600px) { html { font-size: 18px; } }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
@media (max-width: 600px) { h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-underline-offset: .15em; }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
b, strong { font-weight: 700; }

.icone { width: 1.35em; height: 1.35em; flex: none; vertical-align: -.25em; }
.icone-geante { width: 4rem; height: 4rem; color: var(--primary); margin-bottom: .6rem; }
.icone-ok { color: var(--ok); }
.icone-ronde {
  width: 3.4rem; height: 3.4rem; padding: .75rem; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); flex: none;
}

.texte-grand { font-size: 1.15rem; }
.muet { color: var(--muted); }
.petit { font-size: .88rem; }
.centre { text-align: center; }
.casse { overflow-wrap: anywhere; }
.code { letter-spacing: .06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.grandit { flex: 1; min-width: 12rem; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.evitement { position: absolute; left: -10000px; top: .5rem; z-index: 100; background: var(--surface); padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 700; }
.evitement:focus { left: .5rem; }

/* ---------- Mise en page ---------- */
.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 600px) { .conteneur { padding: 0 16px; } }
.etroit { max-width: 860px; }
.page { flex: 1; outline: none; }
.page-large .conteneur { max-width: 1500px; }
.section { padding-top: 2rem; padding-bottom: 1.4rem; }
.titre-section { margin-top: 2rem; }
.flash { padding-top: 1rem; }
.flash .notice { margin: 0; }

.bandeau-demo {
  display: flex; gap: .6rem; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center;
  padding: .45rem 16px; background: var(--warn-soft); color: #4A3200; border-bottom: 2px solid var(--warn); font-size: .92rem;
}

/* En-tête */
.entete { position: relative; background: var(--surface); border-bottom: 2px solid var(--border); z-index: 20; }
@media (min-width: 1001px) { .entete { position: sticky; top: 0; } }
.entete-in { max-width: 1180px; margin: 0 auto; padding: .45rem 20px; display: flex; align-items: center; gap: 1rem; }
.logo { display: block; flex: none; }
.logo img { display: block; height: 3.3rem; width: auto; }
.nav-principale { display: flex; flex-wrap: wrap; gap: .3rem; margin-left: auto; justify-content: flex-end; }
.nav-lien {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.8rem; padding: .4rem .85rem;
  border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 700; border: 2px solid transparent;
}
.nav-lien:hover { background: var(--hover); color: var(--text); }
.nav-lien.actif { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.menu-mobile { display: none; margin-left: auto; }
.menu-mobile > summary { list-style: none; }
.menu-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile {
  position: absolute; left: 0; right: 0; top: 100%; display: grid; gap: .35rem;
  padding: .7rem 16px 1rem; background: var(--surface); border-bottom: 2px solid var(--border); box-shadow: var(--shadow);
}
.nav-mobile .nav-lien { border-radius: var(--radius-sm); border-color: var(--border); min-height: 3.2rem; padding: .5rem 1rem; }
.nav-mobile .nav-lien.actif { border-color: var(--primary); }
@media (max-width: 1000px) {
  .nav-principale { display: none; }
  .menu-mobile { display: block; }
  .entete-in { padding: .4rem 16px; }
  .logo img { height: 2.8rem; }
}

/* Pied de page */
.pied { margin-top: 2.5rem; background: var(--desk); border-top: 2px solid var(--border); padding: 1.6rem 0; }
.pied-in { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; align-items: center; justify-content: space-between; }
.pied-marque { display: flex; gap: .9rem; align-items: center; }
.pied-marque img { width: 3.2rem; height: 3.2rem; }
.pied-marque p { margin: 0; }
.pied-liens { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.pied-liens a { color: var(--text); font-weight: 700; padding: .3rem 0; }
.pied-deconnexion { margin: 0; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .55rem 1.1rem; margin: 0;
  font: 700 1rem/1.2 var(--font); color: var(--text); text-decoration: none; text-align: center;
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
}
.bouton:hover { background: var(--hover); color: var(--text); }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton-principal { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.bouton-principal:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.bouton-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.bouton-danger:hover { background: #962019; border-color: #962019; color: #fff; }
.bouton-discret { background: transparent; border-color: transparent; }
.bouton-grand { min-height: 3.6rem; font-size: 1.1rem; padding: .7rem 1.5rem; }
.bouton-geant { min-height: 4.4rem; font-size: 1.25rem; padding: .9rem 1.9rem; border-radius: var(--radius); }
.bouton-geant .icone { width: 1.6em; height: 1.6em; }
.bouton-bloc { width: 100%; }
.bouton.copie-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: .8rem; }
.actions form { margin: 0; }
.actions-centre { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 1.4rem 0 .4rem; }
@media (max-width: 600px) {
  .actions-centre > .bouton, .actions-centre > form, .actions-centre > form .bouton, .actions > .bouton { width: 100%; }
}

/* ---------- Cartes ---------- */
.carte {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem 1.5rem; margin-bottom: 1rem;
}
@media (max-width: 600px) { .carte { padding: 1.1rem 1rem; } }
.carte > :last-child { margin-bottom: 0; }
.mise-en-avant { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.grille-2 > .carte, .grille-3 > .carte { margin-bottom: 0; }

/* ---------- Accueil ---------- */
.hero { padding-top: 1.2rem; }
.hero-image {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 2px solid var(--border); box-shadow: var(--shadow); background: #6fb3f2;
}
.hero-texte { position: relative; max-width: 54rem; margin: -5.5rem auto 0; text-align: center; padding: 1.6rem 2rem 1.2rem; }
.hero-texte h1 { font-size: 2.5rem; }
.hero-texte .actions { justify-content: center; margin: 1.2rem 0 .9rem; }
@media (max-width: 800px) {
  .hero-texte { margin-top: -1.6rem; padding: 1.2rem 1rem 1rem; }
  .hero-texte h1 { font-size: 1.85rem; }
  .hero-texte .actions .bouton { width: 100%; }
}
.carte-pour { text-align: center; }
.carte-pour .icone-ronde { margin: 0 auto .8rem; display: block; }
.grille-fonctions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: .9rem; }
.fonction { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; }
.fonction h3 { margin-bottom: .2rem; }
.fonction p { margin: 0; color: var(--muted); }
.icone-fonction { width: 2.6rem; height: 2.6rem; color: var(--primary); margin-top: .1rem; }
.grille-captures { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 1.2rem; }
.capture { margin: 0; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.capture a { display: block; }
.capture img { display: block; width: 100%; height: auto; border-bottom: 2px solid var(--border); }
.capture figcaption { padding: .8rem 1.1rem; font-weight: 700; }

.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.etapes > li { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.etapes h3 { margin-bottom: .25rem; }
.etapes p { margin: 0; }
.etapes-verticales { grid-template-columns: 1fr; }
.etape-num {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 1.3rem;
}

/* ---------- Tarifs ---------- */
.chronologie { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.chronologie > li { position: relative; margin: 0; }
.chronologie > li:not(:last-child)::after {
  content: ''; position: absolute; top: 50%; right: -1.25rem; width: .9rem; height: .9rem;
  border-top: 4px solid var(--primary); border-right: 4px solid var(--primary); transform: translateY(-50%) rotate(45deg);
}
@media (max-width: 900px) {
  .chronologie { grid-template-columns: 1fr; gap: 1.8rem; }
  .chronologie > li:not(:last-child)::after { top: auto; bottom: -1.45rem; right: 50%; transform: translateX(50%) rotate(135deg); }
}
.chrono-quand { display: inline-flex; gap: .45rem; align-items: center; font-weight: 700; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; padding: .25rem .8rem; }
.prix { font-size: 2.1rem; font-weight: 700; color: var(--primary-strong); margin: .2rem 0 .5rem; line-height: 1.15; }
.prix span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.choix-formule .icone-ronde { margin-bottom: .6rem; }
.liste-coches { list-style: none; padding: 0; margin: .5rem 0 0; }
.liste-coches li { position: relative; padding-left: 1.9rem; margin-bottom: .45rem; }
.liste-coches li::before {
  content: ''; position: absolute; left: .25rem; top: .3rem; width: .55rem; height: .95rem;
  border-right: 4px solid var(--ok); border-bottom: 4px solid var(--ok); transform: rotate(45deg);
}
.exemple { background: var(--primary-soft); border-color: var(--primary); margin-top: 1.4rem; }
.grille-2 + .texte-grand { margin-top: 1rem; }
.liste-infos { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.liste-infos > li { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.liste-infos > li > .icone { width: 1.8rem; height: 1.8rem; color: var(--primary); margin-top: .05rem; }
.carte .liste-infos > li { border-color: var(--surface-2); background: var(--surface-2); }

/* ---------- Téléchargement ---------- */
.carte-telechargement { padding: 2rem 1.5rem; }
.carte-telechargement .bouton-geant { margin-bottom: .8rem; }
@media (max-width: 600px) { .carte-telechargement .bouton-geant { width: 100%; } }

/* ---------- Aide ---------- */
.sommaire ul { margin: 0; padding-left: 1.3rem; columns: 2 16rem; }
.sommaire li { margin: .2rem 0; font-weight: 700; }
.question h3 { color: var(--primary-strong); }

/* ---------- Formulaires ---------- */
.formulaire { padding: 1.5rem; }
.champ { display: flex; flex-direction: column; gap: .4rem; margin: 0 0 1.2rem; padding: 0; border: 0; min-width: 0; }
.champ > label, .champ > legend, .label-fort { font-weight: 700; font-size: 1.05rem; }
.champ > legend { padding: 0; margin-bottom: .4rem; }
.obligatoire { font-weight: 400; color: var(--muted); font-size: .9rem; }
.saisie {
  width: 100%; min-height: 3rem; padding: .55rem .85rem; margin: 0;
  font: 400 1.05rem/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
}
.saisie:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea.saisie { resize: vertical; min-height: 8rem; }
select.saisie { cursor: pointer; }
.saisie-grande { font-size: 1.2rem; min-height: 3.5rem; }
.saisie-courte { max-width: 9rem; }
.saisie-code { font-size: 2.2rem; font-weight: 700; letter-spacing: .45em; text-align: center; max-width: 16rem; min-height: 4rem; padding-left: 1.2rem; }
input.code { text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 600px) { .saisie-grande { font-size: 1.05rem; } .saisie-grande.code { padding-left: .6rem; padding-right: .6rem; } }
.en-erreur .saisie, .en-erreur .option { border-color: var(--danger); }
.erreur-champ { margin: 0; color: var(--danger); font-weight: 700; }
.aide-champ { margin: 0; color: var(--muted); font-size: .92rem; }
.option {
  display: flex; gap: .85rem; align-items: flex-start; padding: .75rem 1rem; margin-bottom: .55rem;
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400;
}
.champ > label.option { font-weight: 400; font-size: 1rem; }
.option input { flex: none; width: 1.5rem; height: 1.5rem; margin: .1rem 0 0; accent-color: var(--primary); cursor: pointer; }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.piege { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.etape-achat { display: inline-flex; gap: .5rem; align-items: center; font-weight: 700; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; padding: .3rem .9rem; }
.resume-achat .prix { margin-top: 0; }
.aide-code h2 { font-size: 1.2rem; }
.formulaire-ligne { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.formulaire-ligne label { font-weight: 700; }
.formulaire-ligne .saisie { flex: 1; min-width: 14rem; }

/* ---------- Messages ---------- */
.notice {
  display: flex; gap: .8rem; align-items: flex-start; margin: 1rem 0; padding: .9rem 1.1rem;
  background: var(--primary-soft); border: 2px solid var(--primary); border-radius: var(--radius-sm);
}
.notice > div > :last-child { margin-bottom: 0; }
.notice-icone { width: 1.6rem; height: 1.6rem; color: var(--primary); margin-top: .05rem; }
.notice-ok { background: var(--ok-soft); border-color: var(--ok); }
.notice-ok .notice-icone { color: var(--ok); }
.notice-attention { background: var(--warn-soft); border-color: var(--warn); }
.notice-attention .notice-icone { color: var(--warn); }
.notice-danger { background: var(--danger-soft); border-color: var(--danger); }
.notice-danger .notice-icone { color: var(--danger); }

.badge { display: inline-block; padding: .2rem .75rem; border-radius: 999px; border: 2px solid; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.badge-attention { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.badge-neutre { background: var(--surface-2); color: var(--muted); border-color: var(--border-strong); }

/* ---------- Compte ---------- */
.compte-tete { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: flex-start; }
.compte-tete .actions { margin-top: .3rem; }
.liste-licences { display: grid; gap: 1.2rem; }
.licence { margin: 0; scroll-margin-top: 6rem; }
.licence-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.licence-tete h3 { margin: 0; font-size: 1.3rem; }
.licence-tete p { margin: 0; }
.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .7rem 1.4rem; margin: 1.1rem 0; }
.infos > div { min-width: 0; }
.infos dt { color: var(--muted); font-size: .9rem; }
.infos dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.bloc-ia { margin: 1rem 0; padding: 1rem 1.2rem; background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-sm); }
.bloc-ia h4 { display: flex; gap: .5rem; align-items: center; color: var(--primary-strong); }
.bloc-ia p { margin-bottom: .2rem; }
.actions-licence { margin-top: 1rem; }
.bloc-simulation { margin-top: 1.1rem; padding: .8rem 1rem; border: 2px dashed var(--warn); border-radius: var(--radius-sm); background: var(--warn-soft); }
.bloc-simulation p { margin: 0; }
.cle-licence { font-family: Consolas, 'Courier New', monospace; font-size: .85rem; line-height: 1.4; word-break: break-all; min-height: 9rem; background: var(--surface-2); }
.liste-numerotee { padding-left: 1.4rem; }
.liste-numerotee li { margin-bottom: .4rem; }

/* ---------- Tableaux ---------- */
.tableau-defilant { width: 100%; overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.tableau th { background: var(--surface-2); font-size: .85rem; white-space: nowrap; }
.tableau tr.alerte td { background: var(--warn-soft); }
.tableau a[href^="/admin/licences/"] { white-space: nowrap; }
.tableau-journal td.code { max-width: 28rem; }

/* ---------- Administration ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.4rem; }
.actions.filtres { margin: 0 0 1rem; }
.admin-recherche { display: flex; gap: .5rem; flex: 1; min-width: min(100%, 24rem); margin: 0; }
.admin-recherche .saisie { flex: 1; }
.grille-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; margin: 0; padding: 1rem 1.1rem; }
.stat-valeur { font-size: 1.7rem; font-weight: 700; color: var(--primary-strong); }
a.stat-lien { color: var(--text); text-decoration: none; }
a.stat-lien:hover { border-color: var(--primary); }
.liste-simple { margin: 0; padding-left: 1.2rem; }

/* ---------- Pages légales ---------- */
.texte-legal h2 { margin-top: 1.6rem; font-size: 1.3rem; }
.texte-legal ul { padding-left: 1.3rem; }
.texte-legal li { margin-bottom: .4rem; }
.a-completer { background: #FFF1A8; color: #3D2A00; outline: 2px dashed var(--warn); padding: 0 .3rem; font-weight: 700; border-radius: 4px; }

@media print {
  .entete, .pied, .bandeau-demo, .actions, .bloc-simulation { display: none !important; }
  body { background: #fff; }
  .carte { box-shadow: none; }
}
