/* Borne Post IA · charte de la maquette « Borne CNA – maquette wording », format iPad 13" (1376 × 1032).
   La borne est toujours en clair. */
:root {
  --navy: #2E3862; --grey: #4E5577; --mute: #6B7189;
  --line: #E2EAFF; --line2: #D4E0FF; --soft: #F1F5FF;
  --coral: #FF6135; --salmon: #FF8E8B; --pink: #FF96BE; --purple: #4D54D1;
  --done-bg: #D1F2EE; --run-bg: #FFD0C3; --lav: #EFEEFC; --error: #B42318;
  --rainbow: linear-gradient(135deg, #FF96BE, #786ACD 30%, #4D54D1 55%, #5377D4 75%, #64E4DD);
  --rainbow-h: linear-gradient(90deg, #FF96BE, #786ACD 30%, #4D54D1 55%, #5377D4 75%, #64E4DD);
  --cta-bg: linear-gradient(0deg, #FF6135 40%, #FF8E8B 100%);
  --cta-shadow: 0 8px 24px #FFBBB9;
  --card-shadow: 0 6px 24px rgba(77, 84, 209, .10);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--navy); overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  background: radial-gradient(42% 70% at 12% 92%, rgba(112,150,255,.30), transparent 70%),
              radial-gradient(38% 60% at 88% 100%, rgba(255,150,190,.28), transparent 70%),
              radial-gradient(30% 45% at 92% 6%, rgba(100,228,221,.16), transparent 70%), var(--soft); }
input, textarea { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.app { position: fixed; inset: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 18px 24px 22px; overflow: auto; }
.logo { height: 30px; width: auto; display: block; }
.logo-lg { height: 42px; }

/* Boutons */
.cta { border: 0; border-radius: 999px; background: var(--cta-bg); box-shadow: var(--cta-shadow); color: #fff; font-weight: 600; font-size: 17px; padding: 14px 30px; white-space: nowrap; }
.cta:active { filter: brightness(.96); }
.cta[disabled] { background: var(--line2); box-shadow: none; color: #fff; cursor: default; }
.cta.small { font-size: 15px; padding: 11px 22px; }
.ghost { border: 1px solid var(--line2); background: #fff; color: var(--navy); border-radius: 999px; font-weight: 600; font-size: 16px; padding: 13px 28px; }
.ghost[disabled] { opacity: .45; cursor: default; }

/* Configuration */
.setup { margin: auto; width: min(520px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 32px; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
.setup h2 { font-size: 26px; }
.setup p { margin: 0; color: var(--grey); }
.setup input { width: 100%; font: inherit; font-size: 18px; border: 1.5px solid var(--line2); border-radius: 999px; padding: 12px 18px; color: var(--navy); }

/* 1 · Accueil */
.home { align-items: center; text-align: center; cursor: pointer; padding-top: 30px; }
.home h1 { margin-top: 150px; font-weight: 600; font-size: 60px; line-height: 1.08; letter-spacing: -.025em; color: var(--navy); }
.home h1 span { display: block; }
.home h1 .grad { background: linear-gradient(90deg, #FF6136, #FF8E8B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spark { height: .55em; width: auto; vertical-align: .55em; margin-left: .12em; }
.home .sub { margin: 26px 0 0; font-size: 19px; line-height: 1.5; color: var(--grey); max-width: 720px; }
.pill { margin-top: 28px; width: 560px; padding: 2px; border-radius: 999px; background: var(--rainbow-h); box-shadow: 0 6px 24px rgba(77,84,209,.15); }
.pill-in { background: #fff; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 22px; }
.pill .ph { font-size: 15px; color: var(--mute); }
.home .foot { margin-top: auto; padding-bottom: 46px; font-size: 14px; color: var(--grey); }

/* En-tête des écrans 2 à 4 */
.top { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.steps { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--grey); }
.dot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--lav); color: var(--navy); }
.dot.on { background: var(--navy); color: #fff; }
.steps .act { color: var(--navy); font-weight: 600; }
.steps .bar { width: 16px; height: 1px; background: #C9CDDB; }

/* 2 et 3 · Demande et génération */
.cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 16px; }
.card { min-width: 0; min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 20px; display: flex; flex-direction: column; }
.lab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--navy); text-transform: uppercase; }
.lab small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--mute); font-size: 13px; }
.lab.mt { margin-top: 18px; }
.help { margin: 6px 0 0; font-size: 15px; color: var(--grey); }
.ta { margin-top: 12px; flex: 1; min-height: 0; padding: 2px; border-radius: 14px; background: var(--rainbow); display: flex; }
.ta textarea { flex: 1; width: 100%; border: 0; border-radius: 12px; resize: none; padding: 20px 22px; font-family: var(--font); font-size: 24px; line-height: 1.5; color: var(--navy); background: #fff; }
.ta textarea::placeholder { color: #9AA0B4; }
.ta textarea:focus { outline: none; }
.ta textarea:disabled { background: #fff; color: var(--navy); }
.chips { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); border-radius: 999px; padding: 11px 18px; font-size: 15px; color: var(--grey); background: #fff; }
.chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip[disabled] { opacity: .5; }

.status { display: flex; gap: 6px; flex-shrink: 0; }
#rightTitle { white-space: nowrap; }
.st { white-space: nowrap; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--done-bg); color: var(--navy); text-transform: none; letter-spacing: 0; }
.st.wait { background: #fff; border: 1px solid var(--line2); color: var(--mute); }
.st.run { background: var(--run-bg); color: var(--navy); }

.preview { margin-top: 12px; flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
#previewBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.who { display: flex; gap: 10px; align-items: center; padding: 14px 14px 10px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #E8EAF6; color: var(--navy); font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.who b { display: block; font-size: 15px; color: var(--navy); }
.who span span { display: block; font-size: 12px; color: var(--mute); margin-top: 1px; }
.sk { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.sk i { display: block; height: 9px; border-radius: 6px; background: #ECEEF5; }
.posttxt { padding: 0 14px 12px; font-size: 14px; line-height: 1.55; color: var(--navy); white-space: pre-line; overflow: auto; max-height: 40%; flex: none; }
.posttxt .tags { color: var(--purple); }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--purple); vertical-align: text-bottom; }
@media (prefers-reduced-motion: no-preference) { .caret { animation: blink 1s steps(1) infinite; } @keyframes blink { 50% { opacity: 0; } } }
.vis { flex: 1; min-height: 160px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--grey); position: relative; overflow: hidden; text-align: center; padding: 0 16px; }
.vis img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) { .vis img { animation: reveal .6s ease-out; } @keyframes reveal { from { opacity: 0; transform: scale(1.03); } } }
.verr { color: var(--error); }
.benef { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--navy); }
.benef li { display: flex; gap: 10px; align-items: center; }
.benef svg { width: 16px; height: 16px; color: var(--purple); flex-shrink: 0; }
.bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; }

/* Présentation de Digital Media pendant la création du visuel */
.slides { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(180deg, #F1F5FF, #FFFFFF); text-align: left; }
.stripes { position: absolute; right: -14px; top: -14px; width: 150px; height: 150px; border-radius: 50%; background: repeating-linear-gradient(135deg, rgba(255,97,54,.28) 0 5px, transparent 5px 12px); }
.badge { position: absolute; left: 24px; top: 18px; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: #C2381C; display: flex; align-items: center; gap: 7px; }
.spin { width: 11px; height: 11px; border: 2px solid #F7B7A8; border-top-color: var(--coral); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .slide-ic, .o-tag { animation: pop .6s cubic-bezier(.2,.8,.2,1.2); } @keyframes pop { from { transform: scale(.6); opacity: 0; } } }
.slide-ic { width: 34px; height: 34px; color: var(--coral); }
.slide-t { margin: 10px 0 0; font-weight: 600; font-size: 24px; color: var(--navy); letter-spacing: -.01em; }
.slide-p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--grey); max-width: 420px; }
.prog { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.dots { display: flex; gap: 4px; }
.dots i { display: block; width: 5px; height: 5px; border-radius: 999px; background: #C9CDDB; }
.dots i.on { width: 18px; background: var(--navy); }
.track { flex: 1; height: 2px; background: #E1E3EC; border-radius: 2px; overflow: hidden; }
.track b { display: block; height: 100%; width: 0; background: var(--rainbow-h); }
.slides.offer { background: linear-gradient(120deg, #1B1D49 0%, #2B2F75 45%, #4D54D1 100%); }
.slides.offer .stripes { background: repeating-linear-gradient(135deg, rgba(255,97,54,.45) 0 5px, transparent 5px 12px); }
.o-tag { align-self: flex-start; background: linear-gradient(90deg, #FF6135, #FF8E8B 100%); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.o-pack { margin: 10px 0 0; font-weight: 600; font-size: 17px; color: #C9CDF2; }
.o-price { margin: 2px 0 0; display: flex; align-items: baseline; gap: 8px; color: #fff; }
.o-price strong { font-size: 48px; line-height: 1; letter-spacing: -.02em; }
.o-price span { font-size: 15px; }
.o-price s { font-size: 14px; color: #AEB3D9; margin-left: 6px; }
.slides.offer .slide-p { color: #E4E6F7; max-width: 460px; }
.slides.offer .dots i { background: #5A5F9A; }
.slides.offer .dots i.on { background: #fff; }
.slides.offer .track { background: #4A4F8A; }

/* 4 · Publication */
.s4 { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 40px; }
.s4 h2 { font-weight: 600; font-size: 38px; color: var(--navy); letter-spacing: -.015em; }
.mailcard { margin-top: 28px; width: min(600px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 30px 34px; text-align: left; display: flex; flex-direction: column; }
.m-lab { font-size: 18px; font-weight: 600; color: var(--navy); }
.m-help { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--grey); }
.mailcard input[type="email"] { margin-top: 16px; width: 100%; border: 1.5px solid var(--line2); border-radius: 999px; padding: 14px 22px; font-family: var(--font); font-size: 20px; color: var(--navy); }
.mailcard input[type="email"]:focus { outline: 3px solid var(--purple); outline-offset: 1px; }
.mailcard input[aria-invalid="true"] { border-color: var(--error); }
.m-check { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--grey); cursor: pointer; }
.m-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.m-check a { color: var(--purple); text-decoration: underline; }
.m-legal { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--mute); }
.m-err { margin: 10px 0 0; font-size: 13px; color: var(--error); }
.m-btn { margin-top: 20px; align-self: flex-end; }
.qrstep { display: flex; flex-direction: column; align-items: center; }
.qr { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 26px; min-width: 200px; min-height: 200px; display: grid; place-items: center; }
.qr img { display: block; width: min(52vh, 460px); height: min(52vh, 460px); }
.qr .wait { font-size: 16px; color: var(--grey); max-width: 360px; }
.s4 .ins { margin: 22px 0 0; font-size: 19px; line-height: 1.5; color: var(--grey); max-width: 560px; }
.s4btn { position: absolute; right: 24px; bottom: 22px; }

/* Politique de confidentialité */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(27, 29, 73, .45); display: grid; place-items: center; padding: 24px; }
.modal-card { width: min(560px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(27,29,73,.3); padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
.modal-card h3 { font-size: 22px; color: var(--navy); }
.modal-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--grey); }
.modal-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.modal-qr img { width: 180px; height: 180px; }
.modal-url { font-family: ui-monospace, Menlo, monospace; font-size: 13px !important; color: #5B6191 !important; }

/* Bouton de l'équipe : appui long de 2 s */
.staff { position: fixed; left: calc(50% - 17px); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--mute); display: flex; align-items: center; justify-content: center; opacity: .5; z-index: 10; touch-action: none; -webkit-touch-callout: none; transition: opacity .2s, transform .2s; }
.staff svg { width: 15px; height: 15px; }
.staff.holding { opacity: 1; transform: scale(1.25); border-color: var(--coral); color: var(--coral); transition: opacity .2s, transform 2s linear; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
