:root{
  color-scheme: dark;
  --navy:#0B052F; --navy-2:#130C3C; --navy-3:#1F1751; --badge:#27243A;
  --blanc:#FAFAFC; --texte:rgba(250,250,252,.86); --doux:rgba(250,250,252,.6); --pale:rgba(250,250,252,.38);
  --or:linear-gradient(270deg,#F5E39A 0%,#C4B876 50%,#8F845A 100%); --or-plein:#C4B876;
  --feuille:#FAFAFC; --encre:#0B052F; --encre-douce:#4A4566; --filet:rgba(11,5,47,.12);
  --titre:'Playfair Display',Georgia,serif; --corps:'Inter',-apple-system,BlinkMacSystemFont,'Helvetica Neue',Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{background:radial-gradient(1200px 700px at 80% -10%,#1F1751 0%,transparent 60%),radial-gradient(900px 600px at -10% 110%,#171043 0%,transparent 55%),var(--navy);
  color:var(--texte);font-family:var(--corps);font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
.grain{position:fixed;inset:0;pointer-events:none;opacity:.05;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>")}
.surtitre{margin:0;font-size:.875rem;letter-spacing:.24em;text-transform:uppercase;background:var(--or);-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:600}
.bouton{appearance:none;border:0;border-radius:999px;padding:.95rem 1.6rem;font:600 .95rem var(--corps);color:var(--navy);background:var(--or);cursor:pointer;transition:transform .15s,box-shadow .2s}
.bouton:hover{box-shadow:0 0 0 4px rgba(196,184,118,.18),0 10px 30px -10px rgba(245,227,154,.45)}
.bouton:active{transform:translateY(1px)}
.lien{appearance:none;background:none;border:0;color:var(--doux);font:500 .9rem var(--corps);cursor:pointer;padding:.4rem .2rem;border-bottom:1px solid transparent}
.lien:hover{color:var(--blanc);border-bottom-color:var(--or-plein)}
:focus-visible{outline:2px solid #F5E39A;outline-offset:3px;border-radius:6px}

/* La porte */
.porte{position:relative;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:3rem 16px}
.porte__medaille{width:132px;height:132px;margin-bottom:1.6rem;filter:drop-shadow(0 18px 40px rgba(0,0,0,.45))}
.porte__titre{font-family:var(--titre);font-weight:600;font-size:clamp(2.6rem,7vw,4.4rem);line-height:1.02;margin:.4rem 0 1rem;color:var(--blanc)}
.porte__texte{max-width:30rem;margin:0 auto 2.4rem;color:var(--doux)}
.porte__form{width:100%;max-width:30rem;text-align:left}
.vlabel{display:block;font-size:.875rem;color:var(--pale);margin:0 0 .5rem .9rem;letter-spacing:.04em}
.porte__ligne{display:flex;gap:.5rem;padding:.4rem;border-radius:999px;background:rgba(255,255,255,.05);border:1px solid rgba(196,184,118,.28);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.porte__ligne:focus-within{border-color:rgba(245,227,154,.7)}
.porte__ligne input{flex:1;min-width:0;background:transparent;border:0;outline:0;color:var(--blanc);font:500 1rem ui-monospace,SFMono-Regular,Menlo,monospace;padding:.6rem .9rem;letter-spacing:.02em}
.porte__ligne input::placeholder{color:var(--pale)}
.porte__erreur{min-height:1.4em;margin:.7rem .9rem 0;color:#F2A38E;font-size:.9rem}
.porte__pied{position:absolute;bottom:1.4rem;left:0;right:0;margin:0;font-size:.875rem;color:var(--pale)}

/* La salle */
.tete{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9rem clamp(16px,4vw,2.5rem);
  background:rgba(11,5,47,.72);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid rgba(196,184,118,.14)}
.tete__marque{display:flex;align-items:center;gap:.9rem;font-family:var(--titre);font-size:1.1rem;color:var(--blanc);min-width:0}
.tete__marque img{height:30px;width:auto}
.tete__sep{width:1px;height:22px;background:rgba(196,184,118,.4)}
.tete__droite{display:flex;align-items:center;gap:1.1rem;min-width:0}
.tete__pour{font-size:.875rem;color:var(--pale);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}
.salle__corps{display:grid;grid-template-columns:minmax(0,22rem) minmax(0,1fr);gap:clamp(1.2rem,3vw,2.5rem);padding:clamp(1.2rem,3vw,2.5rem) clamp(16px,4vw,2.5rem) 4rem;max-width:1440px;margin:0 auto}

/* Sommaire : chaque section est une chemise */
.sommaire{display:flex;flex-direction:column;gap:1rem;align-self:start;position:sticky;top:5.2rem}
.chemise{position:relative;border-radius:4px 16px 16px 16px;background:linear-gradient(156deg,#130C3C 4%,#0F0936 40%,#171043 100%);border:1px solid rgba(196,184,118,.16);padding:1.1rem 1.1rem 1rem}
.chemise::before{content:"";position:absolute;top:-9px;left:-1px;width:42%;height:10px;border-radius:6px 10px 0 0;background:#151040;border:1px solid rgba(196,184,118,.16);border-bottom:0}
.chemise h2{margin:0 0 .25rem;font-family:var(--titre);font-weight:600;font-size:1.12rem;color:var(--blanc)}
.chemise p{margin:0 0 .8rem;font-size:.9rem;color:var(--pale)}
.chemise ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.15rem}
.piece{width:100%;display:flex;align-items:flex-start;gap:.7rem;text-align:left;background:none;border:0;border-radius:10px;padding:.55rem .6rem;color:var(--texte);font:500 .9rem var(--corps);cursor:pointer}
.piece:hover{background:rgba(255,255,255,.05)}
.piece[aria-current="true"]{background:rgba(196,184,118,.12);color:var(--blanc)}
.piece:disabled{cursor:default;color:var(--pale)}
.piece:disabled:hover{background:none}
.piece__feuille{flex:none;width:16px;height:20px;margin-top:1px;border-radius:2px;background:var(--feuille);clip-path:polygon(0 0,70% 0,100% 24%,100% 100%,0 100%);opacity:.9}
.piece:disabled .piece__feuille{background:transparent;outline:1px dashed rgba(250,250,252,.3);clip-path:none}
.piece__texte{min-width:0}
.piece__etat{display:block;font-size:.875rem;color:var(--pale);margin-top:.1rem}

/* Lecture : la piece ouverte est une feuille */
.lecture{min-width:0}
.accueil{padding:clamp(1.5rem,4vw,3rem) 0}
.accueil h1{font-family:var(--titre);font-weight:600;font-size:clamp(2rem,4.5vw,3.2rem);line-height:1.08;color:var(--blanc);margin:.5rem 0 1rem}
.accueil p{max-width:38rem;color:var(--doux)}
.feuille{background:var(--feuille);color:var(--encre);border-radius:6px;padding:clamp(1.4rem,4vw,3.2rem);box-shadow:0 30px 80px -30px rgba(0,0,0,.6);min-width:0}
.feuille__tete{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;border-bottom:1px solid var(--filet);padding-bottom:1rem;margin-bottom:1.4rem}
.feuille__tete h1{font-family:var(--titre);font-size:clamp(1.4rem,3vw,2rem);margin:0;line-height:1.15}
.feuille__tete span{font-size:.875rem;color:var(--encre-douce)}
.feuille h2{font-family:var(--titre);font-size:1.35rem;margin:2rem 0 .8rem}
.feuille h3{font-family:var(--titre);font-size:1.1rem;margin:1.6rem 0 .6rem}
.feuille h2:first-child{margin-top:0}
.feuille p,.feuille li{color:#2A2546}
.feuille code{font-size:.85em;background:rgba(11,5,47,.06);padding:.1em .35em;border-radius:4px}
.feuille blockquote{margin:1rem 0;padding:.6rem 1rem;border-left:3px solid var(--or-plein);background:rgba(196,184,118,.08)}
.tableau{overflow-x:auto;margin:.6rem 0 1.4rem;border:1px solid var(--filet);border-radius:8px}
.feuille table{border-collapse:collapse;width:100%;font-size:.9rem}
.feuille th{text-align:left;background:#F0EEF6;font-weight:600;color:var(--encre);padding:.6rem .8rem;white-space:nowrap}
.feuille td{padding:.6rem .8rem;border-top:1px solid var(--filet);vertical-align:top;color:#2A2546}
.feuille td:first-child{white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--encre);font-weight:500}
.feuille td:last-child{color:var(--encre-douce);font-size:.875rem}
.apercu{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:6px;border:1px solid var(--filet)}
.telecharger{display:inline-flex;margin-top:1.2rem}

.cadre-pdf{display:block;width:100%;height:min(80vh,1100px);border:1px solid var(--filet);border-radius:6px;margin-top:1rem;background:#fff}
.apercu-coupon{margin-top:2rem;border-top:1px solid var(--filet);padding-top:1.4rem}
.apercu-coupon h2{margin:0 0 .4rem}
.coupon{display:flex;flex-direction:column;gap:1.4rem}
.champ{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:.45rem;min-width:0}
.champ label,.champ legend{font-weight:600;font-size:.9rem;color:var(--encre)}
.champ legend{margin-bottom:.5rem}
.champ textarea,.champ input:not([type]),.champ input[type=text]{font:400 .95rem/1.5 var(--corps);color:var(--encre);background:#fff;border:1px solid rgba(11,5,47,.2);border-radius:8px;padding:.7rem .8rem;width:100%;min-width:0;resize:vertical}
.champ textarea:focus,.champ input:focus{outline:2px solid #C4B876;outline-offset:1px}
.champ__aide{margin:0;font-size:.875rem;color:var(--encre-douce)}
.champ__aide--trop{color:#B4432A;font-weight:600}
.champ--ligne{flex-direction:row;gap:1rem;flex-wrap:wrap}
.champ--ligne>div{flex:1 1 14rem;display:flex;flex-direction:column;gap:.45rem;min-width:0}
.cases{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr));gap:.35rem 1rem}
.case{display:flex;gap:.55rem;align-items:flex-start;font-weight:400!important;font-size:.92rem;color:#2A2546;cursor:pointer}
.case input{margin-top:.2rem;accent-color:#0B052F;width:1rem;height:1rem;flex:none}
.signature{width:100%;max-width:600px;aspect-ratio:10/3;height:auto;background:#fff;border:1px dashed rgba(11,5,47,.35);border-radius:8px;touch-action:none;cursor:crosshair}
.signature__barre{display:flex;gap:1.2rem;align-items:center;flex-wrap:wrap}
.lien--sombre{color:var(--encre-douce)}
.lien--sombre:hover{color:var(--encre)}
.coupon .bouton{align-self:flex-start}
.coupon .porte__erreur{margin:0;color:#B4432A}
@media (max-width: 860px){
  .salle__corps{grid-template-columns:minmax(0,1fr)}
  .sommaire{position:static}
  .tete__pour{display:none}
  .tete__marque span:last-child{display:none}
  .tete__sep{display:none}
  .feuille td:first-child{white-space:normal}
}
@media (max-width: 480px){
  .porte{justify-content:flex-start;padding-top:12vh}
  .porte__medaille{width:104px;height:104px}
  .porte__ligne{flex-direction:column;border-radius:20px;padding:.5rem}
  .porte__ligne .bouton{width:100%}
  .porte__pied{position:static;margin-top:2.5rem}
  .tete{padding:.75rem 16px}
  .salle__corps{padding:1rem 16px 3rem}
  .feuille{padding:1.2rem 1rem;border-radius:4px}
  .feuille th,.feuille td{padding:.5rem .55rem}
}
@media (prefers-reduced-motion: reduce){*{transition:none!important}}
