/* =========================================================
   NextGRC — formulaire « Demander une démo »
   Une question à la fois, sur fond de captures NextGRC v2
   Police : DM Sans (charte)
   ========================================================= */
:root {
  --brand: #e11d48;
  --brand-600: #be123c;
  --brand-300: #fb7185;
  --night: #0d0608;
  --ink: #fff;
  --muted: rgba(255,255,255,.62);
  --line: rgba(255,255,255,.22);
  --ok: #10b981;
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--night); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 3px; border-radius: 8px; }

/* ---------- Fond : captures v2 assombries + dégradé de marque ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg__img { position: absolute; inset: -3%; background: url(../img/demo/background.jpg) center / cover no-repeat; filter: brightness(.34) saturate(.85) blur(1.5px); animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1) translate3d(0,0,0); } to { transform: scale(1.07) translate3d(-1.5%, -1%, 0); } }
.bg__shade { position: absolute; inset: 0;
  background:
    radial-gradient(900px 600px at 85% 10%, rgba(225,29,72,.28), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(74,11,28,.75), transparent 60%),
    linear-gradient(90deg, rgba(13,6,8,.9) 0%, rgba(13,6,8,.55) 55%, rgba(13,6,8,.35) 100%); }

/* ---------- Barre de progression ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,.08); z-index: 5; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-300), var(--brand)); box-shadow: 0 0 18px rgba(251,113,133,.6); transition: width .7s var(--ease-out); }

/* ---------- En-tête ---------- */
.top { position: fixed; top: 4px; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 4vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.brand b { font-weight: 700; }
.top__right { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.lang button { border: 0; background: none; color: rgba(255,255,255,.65); font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.lang button.is-active { background: #fff; color: #16090c; }
.close { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); transition: background .2s, transform .3s var(--ease-out); }
.close:hover { background: var(--brand); transform: rotate(90deg); }

/* ---------- Étapes ---------- */
.stage { position: relative; height: 100%; }
form { position: relative; height: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.step { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; width: min(760px, 100% - 40px); margin: 0 auto; padding: 96px 0 110px;
  opacity: 0; visibility: hidden; transform: translateY(60px); transition: opacity .55s var(--ease), transform .7s var(--ease-out), visibility 0s .7s; }
.step.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease) .1s, transform .8s var(--ease-out) .1s, visibility 0s; }
.step.is-leaving-up { transform: translateY(-60px); }
.step.from-up { transform: translateY(-60px); }

/* Accueil */
.step--welcome { align-items: flex-start; }
.welcome__logo { width: 84px; height: 84px; margin-bottom: 28px; filter: drop-shadow(0 18px 30px rgba(225,29,72,.45)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.step--welcome h1 { margin: 0 0 18px; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; }
.welcome__desc { margin: 0 0 36px; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.6; color: var(--muted); max-width: 600px; }

/* Question */
.q__num { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--brand-300); letter-spacing: .04em; }
.q__num .ico { width: 15px; height: 15px; }
.q__title { display: block; font-size: clamp(24px, 3.2vw, 38px); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 8px; }
.q__title sup { color: var(--brand-300); font-size: .6em; margin-left: 4px; }
.q__desc { margin: 0 0 6px; color: var(--muted); font-size: 16px; }
.field { width: 100%; margin-top: 26px; padding: 10px 0 12px; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-size: clamp(20px, 2.6vw, 30px); font-weight: 500; letter-spacing: -.02em; outline: none; border-radius: 0;
  background-image: linear-gradient(var(--brand-300), var(--brand-300)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .5s var(--ease-out), border-color .3s; }
.field::placeholder { color: rgba(255,255,255,.3); }
.field:focus { background-size: 100% 2px; border-bottom-color: transparent; }
.field.is-invalid { border-bottom-color: #f87171; }
.phone { display: flex; align-items: flex-end; gap: 14px; margin-top: 26px; }
.phone .field { margin-top: 0; }
.phone select { flex: none; padding: 12px 34px 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 17px; font-weight: 600; cursor: pointer; appearance: none;
  background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center no-repeat; }
.phone select option { color: #16090c; }

.error { min-height: 0; margin: 0; }
.error:not(:empty) { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 14px; border-radius: 10px; background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.35); color: #fecaca; font-size: 14px; font-weight: 600; animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Boutons */
.actions { display: flex; align-items: center; gap: 18px; margin-top: 30px; flex-wrap: wrap; }
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer; font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-300) -40%, var(--brand) 45%, var(--brand-600)); box-shadow: 0 12px 30px -10px rgba(225,29,72,.75), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(225,29,72,.9), inset 0 1px 0 rgba(255,255,255,.25); }
.btn:active { transform: scale(.97); }
.btn .ico { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn--ok:hover .ico { transform: none; }
.btn .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.is-loading { pointer-events: none; opacity: .9; }
.btn.is-loading .spin { display: block; }
.btn.is-loading .ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { font-size: 13px; color: var(--muted); }
kbd { font-family: inherit; font-weight: 700; color: #fff; }
.privacy { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; font-size: 13px; color: var(--muted); }
.privacy .ico { width: 15px; height: 15px; }
.send-error { margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.35); color: #fecaca; font-size: 14px; line-height: 1.5; }
.send-error a { color: #fff; font-weight: 700; text-decoration: underline; }

/* Remerciement */
.step--done { align-items: center; text-align: center; }
.done__check { width: 110px; height: 110px; margin-bottom: 28px; }
.done__check circle { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 3; stroke-dasharray: 277; stroke-dashoffset: 277; }
.done__check path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 70; stroke-dashoffset: 70; }
.step--done.is-active .done__check circle { animation: dash 1s var(--ease-out) .3s forwards; }
.step--done.is-active .done__check path { animation: dash .6s var(--ease-out) 1.05s forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
.step--done h2 { margin: 0 0 12px; font-size: clamp(32px, 4.5vw, 52px); letter-spacing: -.035em; }
.step--done p { margin: 0 0 32px; font-size: 18px; color: var(--muted); max-width: 520px; line-height: 1.6; }

/* Navigation haut / bas */
.stepnav { position: fixed; right: clamp(16px, 4vw, 48px); bottom: 28px; z-index: 4; display: flex; gap: 2px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px -12px rgba(0,0,0,.6); }
.stepnav button { width: 44px; height: 40px; border: 0; display: grid; place-items: center; background: var(--brand); color: #fff; cursor: pointer; transition: background .2s, opacity .2s; }
.stepnav button:hover { background: var(--brand-600); }
.stepnav button:disabled { opacity: .45; cursor: default; }
body.is-intro .stepnav, body.is-done .stepnav { opacity: 0; pointer-events: none; }
.stepnav { transition: opacity .4s; }

/* ---------- Bouton clair / sombre (identique au site) ---------- */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: rgba(255,255,255,.62); transition: border-color .25s, background .25s; }
.theme-toggle:hover { border-color: rgba(255,255,255,.4); }
.theme-toggle span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; transition: background .35s var(--ease-out), color .35s, box-shadow .35s, transform .45s var(--ease-out); }
.theme-toggle .ico { width: 17px; height: 17px; }
.theme-toggle .tt-sun, html[data-theme="dark"] .theme-toggle .tt-moon { background: #fff; color: #16090c; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 4px 10px -2px rgba(0,0,0,.25); }
html[data-theme="dark"] .theme-toggle .tt-sun { background: transparent; color: rgba(255,255,255,.62); box-shadow: none; }
html[data-theme="dark"] .theme-toggle .tt-moon .ico { transform: rotate(-20deg); }
.theme-toggle:active span { transform: scale(.9); }

/* ---------- Mode clair : fond de captures éclairci, texte sombre ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #16090c;
  --muted: rgba(22,9,12,.62);
  --line: rgba(22,9,12,.2);
}
html[data-theme="light"] body { background: #faf6f7; }
html[data-theme="light"] .bg__img { filter: brightness(1.02) saturate(.75) blur(2px); opacity: .55; }
html[data-theme="light"] .bg__shade { background:
    radial-gradient(900px 600px at 85% 10%, rgba(225,29,72,.14), transparent 60%),
    linear-gradient(90deg, rgba(250,246,247,.97) 0%, rgba(250,246,247,.8) 55%, rgba(250,246,247,.6) 100%); }
html[data-theme="light"] .progress { background: rgba(22,9,12,.07); }
html[data-theme="light"] .theme-toggle { border-color: #e7dfe2; background: #fff; color: #8a7b80; box-shadow: 0 1px 2px rgba(22,9,12,.05); }
html[data-theme="light"] .theme-toggle:hover { border-color: #cdbfc4; }
html[data-theme="light"] .theme-toggle .tt-sun { background: #f6f1f2; box-shadow: 0 1px 2px rgba(22,9,12,.12), 0 3px 8px -2px rgba(22,9,12,.18); }
html[data-theme="light"] .lang { background: #fff; border-color: #e7dfe2; }
html[data-theme="light"] .lang button { color: #8a7b80; }
html[data-theme="light"] .lang button.is-active { background: #16090c; color: #fff; }
html[data-theme="light"] .close { border-color: #e7dfe2; background: #fff; }
html[data-theme="light"] .close:hover { color: #fff; }
html[data-theme="light"] .field::placeholder { color: rgba(22,9,12,.3); }
html[data-theme="light"] .phone select { background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2316090c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
html[data-theme="light"] .error:not(:empty), html[data-theme="light"] .send-error { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.3); color: #b91c1c; }
html[data-theme="light"] .send-error a { color: #7f1d1d; }
html[data-theme="light"] kbd { color: var(--ink); }
html[data-theme="light"] .done__check circle { stroke: var(--ink); }
html[data-theme="light"] .done__check path { stroke: var(--brand); }
html[data-theme="light"] .q__num, html[data-theme="light"] .q__title sup { color: var(--brand); }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, border-color .45s ease, color .45s ease, opacity .45s ease, filter .45s ease, box-shadow .45s ease !important;
}

@media (max-width: 600px) {
  .top__right { gap: 8px; }
  .theme-toggle { padding: 3px; }
  .theme-toggle span { width: 28px; height: 28px; }
  .theme-toggle .ico { width: 15px; height: 15px; }
  .step { padding: 88px 0 96px; }
  .welcome__logo { width: 64px; height: 64px; margin-bottom: 20px; }
  .hint { display: none; }
  .phone { gap: 10px; }
  .phone select { font-size: 15px; padding: 10px 30px 10px 10px; }
  .stepnav { bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Arabe (RTL) : police de secours + sens de lecture */
html[lang="ar"] body, html[lang="ar"] button, html[lang="ar"] input, html[lang="ar"] textarea { font-family: 'DM Sans', 'Noto Sans Arabic', system-ui, sans-serif; }
html[lang="ar"] body * { letter-spacing: 0 !important; }
.lang button[lang="ar"] { font-family: 'Noto Sans Arabic', 'DM Sans', sans-serif; font-weight: 600; }
html[dir="rtl"] .ico:has(use[href="#i-arrow"]) { scale: -1 1; }
