/* Nuvrelay — système de design partagé (site, espace client, admin)
   Sol gris-vert doux, cartes blanches, vert forêt pour l'action, citron vert pour l'accent. Police unique : Onest. */
:root {
  --ground: #f7f6fb;
  --ground-2: #efecf6;
  --card: #ffffff;
  --card-2: #f7f5fc;
  --forest: #110e1a;
  --forest-2: #2c2740;
  --lime: #c8b5ff;
  --lime-2: #b39bff;
  --lime-soft: #f2edff;
  --ink: #14111d;
  --ink-2: #3d3850;
  --muted: #6a6480;
  --line: #ebe7f3;
  --line-2: #dcd5ea;
  --lilac: #e6dcff;
  --sky: #dce8ff;
  --mint: #dff3ea;
  --peach: #ffe5d2;
  --ok: #138a55;
  --warn: #a8640a;
  --warn-bg: #fff1d6;
  --ko: #c0352b;
  --ko-bg: #ffe3df;
  --info: #2f5fd0;
  --wa: #25d366;
  --violet: #7c4dff;
  --violet-2: #6a3cf0;
  --wash: radial-gradient(60% 80% at 0% 0%, #ecdfff 0%, transparent 60%), radial-gradient(55% 70% at 100% 100%, #ffe6cf 0%, transparent 60%);
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --pill: 999px;
  --lift: 0 1px 2px rgba(40, 20, 90, .06), 0 12px 32px -18px rgba(40, 20, 90, .28);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
p { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--forest); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--forest); color: #fff; font-weight: 600; }
.skip:focus { top: 12px; }
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }

/* Icônes en trait */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

/* Marque */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: -.04em; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--pill); border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer; white-space: nowrap; transition: background-color .18s, border-color .18s, color .18s, transform .18s; }
.btn:active { transform: translateY(1px); }
.btn-forest { background: var(--forest); color: #fff; }
.btn-forest:hover { background: var(--forest-2); }
.btn-lime { background: var(--violet); color: #fff; }
.btn-lime:hover { background: var(--violet-2); }
.btn-line { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--card-2); color: var(--ink); }
.btn-danger { background: var(--ko-bg); color: var(--ko); }
.btn-danger:hover { background: #ffd2cc; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-xs { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--ko); border: 2px solid var(--card); }

/* Pastilles d'état */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: #dcf5e7; color: var(--ok); }
.badge.wait { background: var(--warn-bg); color: var(--warn); }
.badge.ko { background: var(--ko-bg); color: var(--ko); }
.badge.off { background: var(--ground-2); color: var(--muted); }
.badge.info { background: #e1eafe; color: var(--info); }
.badge.plain::before { display: none; }

/* Formulaires */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); outline: none; transition: border-color .18s, box-shadow .18s; }
.textarea { min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(40, 20, 90, .1); }
.field.is-error .input { border-color: var(--ko); }
.err { display: none; font-size: 13px; color: var(--ko); }
.field.is-error .err { display: block; }
.hint { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--forest); }
.check a { text-decoration: underline; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

/* Interrupteur */
.switch { position: relative; display: inline-flex; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--pill); background: var(--line-2); transition: background-color .18s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--forest); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--forest); outline-offset: 3px; }

/* Notification flottante */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--pill); background: var(--forest); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--lift); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Fenêtre de confirmation */
.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(460px, calc(100% - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(40, 20, 90, .5); }
.modal::backdrop { background: rgba(19, 26, 22, .45); }
.modal-in { padding: 26px; display: grid; gap: 14px; }
.modal h2 { font-size: 21px; }
.modal p { color: var(--muted); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Code à 6 chiffres (e-mail, WhatsApp) */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 372px; }
.otp input { width: 100%; height: 58px; padding: 0; text-align: center; font: 600 24px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink); border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--card); transition: border-color .15s, box-shadow .15s, background-color .15s; caret-color: var(--violet); }
.otp input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 77, 255, .16); }
.otp input.f { border-color: #b9a2ff; background: #faf7ff; }
.otp.bad { animation: otpShake .42s; }
.otp.bad input { border-color: var(--ko); background: #fff5f4; }
.otp.good input { border-color: #22c55e; background: #effbf3; color: #157a3e; animation: otpPop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--k, 0) * 45ms); }
@keyframes otpShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes otpPop { 50% { transform: scale(1.1); } }
@media (max-width: 400px) { .otp { gap: 6px; } .otp input { height: 50px; font-size: 20px; border-radius: 12px; } }
@media (prefers-reduced-motion: reduce) { .otp.bad, .otp.good input { animation: none; } }
.otp input { min-width: 0; }

/* Bouton occupé (envoi en cours) */
.btn.is-loading { cursor: progress; pointer-events: none; }
.btn.is-loading[disabled] { opacity: .82; }
.btn.is-loading > .i { display: none; }
.btn.is-loading::before { content: ""; width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: btnSpin .7s linear infinite; }
@keyframes btnSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before { animation: btnSpin 1.6s linear infinite !important; } }

/* Deux champs côte à côte (prénom / nom) */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }

/* Production (<html class="prod">, posé par _build/deploy.py) : aucun outil de démonstration visible */
.prod .vf-demo, .prod .lk-demo, .prod .demo-bar, .prod .demo-switch, .prod .demo-sim, .prod [data-v-demo], .prod [data-pv-demo] { display: none !important; }
