/* Solution Entretien — page d'entretien en direct (design system du site). */
:root {
  --bg: #07080f; --surface: rgba(255,255,255,.035); --surface-2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --text: #f3f4fb; --muted: #a3a8c3; --muted-2: #6f758f;
  --violet: #8b5cf6; --cyan: #22d3ee; --lime: #a3e635; --pink: #f472b6; --amber: #fbbf24; --red: #fb7185;
  --grad: linear-gradient(100deg, var(--cyan) 0%, var(--violet) 50%, var(--pink) 100%);
  --r-sm: 10px; --r-md: 14px; --r-lg: 22px;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(60% 40% at 50% -10%, rgba(139,92,246,.22), transparent 70%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
kbd { font: 600 11.5px/1 var(--font-mono); padding: 4px 7px; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--line-2); color: var(--muted); }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(14px, 3vw, 32px); background: rgba(7,8,15,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 16px rgba(139,92,246,.6); }
.brand strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user { font-size: 13px; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; font-size: 14.5px; transition: transform .12s, filter .15s, background .15s, opacity .15s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--grad); color: #0b0c14; box-shadow: 0 10px 28px rgba(139,92,246,.3); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-accent { background: rgba(163,230,53,.14); border-color: rgba(163,230,53,.4); color: #d9f99d; }
.btn-accent:hover:not(:disabled) { background: rgba(163,230,53,.22); }
.btn-ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.btn kbd { margin-left: 2px; }
.btn-primary kbd { background: rgba(0,0,0,.18); border-color: rgba(0,0,0,.2); color: #0b0c14; }

/* Page */
.page { max-width: 1100px; margin: 0 auto; padding: 18px clamp(14px, 3vw, 32px) 56px; display: flex; flex-direction: column; gap: 14px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(16px, 3vw, 24px); }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } .side { order: 2; } }

/* Accès */
.access { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.access-main { display: flex; gap: 14px; align-items: flex-start; flex: 1; min-width: 260px; }
.access-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 18px; background: rgba(139,92,246,.15); color: var(--violet); border: 1px solid rgba(139,92,246,.3); }
.access[data-state="pass"] .access-icon { background: rgba(163,230,53,.14); color: var(--lime); border-color: rgba(163,230,53,.35); }
.access[data-state="locked"] .access-icon { background: rgba(251,191,36,.14); color: var(--amber); border-color: rgba(251,191,36,.35); }
.access h2 { font-family: var(--font-display); font-size: 17px; margin-bottom: 2px; }
.access p { font-size: 14px; }
.access-actions { display: flex; gap: 8px; }
.access[data-state="pass"] #buyBtn { display: none; }
.bar { margin-top: 10px; height: 8px; width: min(360px, 100%); background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .5s linear; }

/* Chips d'aide */
.hintbar { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.chip-accent { color: #a5f3fc; border-color: rgba(34,211,238,.35); background: rgba(34,211,238,.08); }

/* Zone principale */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.select select { font: inherit; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 7px 10px; outline: none; }
.rec { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.rec.is-on { color: #fda4af; }
.rec.is-on i { background: var(--red); box-shadow: 0 0 0 0 rgba(251,113,133,.6); animation: pulse 1.4s infinite; }
.rec.is-busy { color: #a5f3fc; }
.rec.is-busy i { background: var(--cyan); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(251,113,133,.55); } 70% { box-shadow: 0 0 0 9px rgba(251,113,133,0); } 100% { box-shadow: 0 0 0 0 rgba(251,113,133,0); } }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.buttons .btn { flex: 1 1 200px; }
.label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.output { min-height: 120px; max-height: 42vh; overflow: auto; padding: 14px 16px; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.output:empty::before { content: attr(data-empty); color: var(--muted-2); }
.output .final { color: var(--text); }
.output .interim { color: var(--muted); }
.output.answer { min-height: 160px; }

/* Messages (plus d'alert()) */
.msg { margin: 12px 0 0; padding: 11px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.msg::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: currentColor; }
.msg-error { background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.35); color: #fda4af; }
.msg-ok { background: rgba(163,230,53,.12); border: 1px solid rgba(163,230,53,.35); color: #d9f99d; }
.msg-info { background: rgba(34,211,238,.10); border: 1px solid rgba(34,211,238,.3); color: #a5f3fc; }
.msg a { text-decoration: underline; font-weight: 600; }

/* Colonne latérale */
.side textarea { width: 100%; resize: vertical; min-height: 110px; margin-top: 8px; padding: 12px; font: inherit; font-size: 14px; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: var(--r-md); outline: none; }
.side textarea:focus { border-color: rgba(139,92,246,.7); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
.side .label:first-child { margin-top: 0; }
.shortcuts { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.shortcuts a { color: var(--cyan); }

/* Modale des pass */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3,4,10,.75); backdrop-filter: blur(6px); }
.modal-box { position: relative; width: 100%; max-width: 640px; padding: clamp(22px, 4vw, 34px); background: #0e1019; border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-box h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; padding-right: 36px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.modal-close:hover { color: var(--text); }
.plans { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin: 18px 0 8px; }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; text-align: left; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); transition: .15s; }
.plan:hover:not(:disabled) { border-color: var(--violet); background: rgba(139,92,246,.1); transform: translateY(-2px); }
.plan:disabled { opacity: .5; cursor: wait; }
.plan-featured { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.1); }
.plan-tag { position: absolute; top: -10px; left: 12px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--grad); color: #0b0c14; }
.plan-name { font-weight: 600; color: var(--muted); font-size: 13px; }
.plan-price { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.plan-sub { font-size: 12.5px; }

@media (max-width: 480px) { .hide-sm { display: none; } .user { max-width: 28vw; } }
@media (prefers-reduced-motion: reduce) { .rec i { animation: none !important; } }


/* ── Mode clair ─────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --bg: #f4f5fb; --surface: rgba(255,255,255,.75); --surface-2: rgba(17,19,34,.06);
  --line: rgba(17,19,34,.10); --line-2: rgba(17,19,34,.18);
  --text: #141628; --muted: #4f5570; --muted-2: #7c8299;
  --violet: #6d28d9; --cyan: #0891b2; --lime: #65a30d; --pink: #db2777; --amber: #d97706; --red: #e11d48;
}
html[data-theme="light"] body { background-image: radial-gradient(60% 40% at 50% -10%, rgba(139,92,246,.16), transparent 70%); }
html[data-theme="light"] .topbar { background: rgba(244,245,251,.85); }
html[data-theme="light"] .card { background: #ffffff; box-shadow: 0 10px 30px rgba(20,22,40,.06); }
html[data-theme="light"] kbd,
html[data-theme="light"] .select select,
html[data-theme="light"] .output,
html[data-theme="light"] .side textarea { background: #f7f8fc; color: var(--text); }
html[data-theme="light"] .btn-primary { color: #fff; }
html[data-theme="light"] .btn-primary kbd { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.3); color: #fff; }
html[data-theme="light"] .btn-ghost:hover:not(:disabled) { background: rgba(17,19,34,.1); }
html[data-theme="light"] .btn-accent { background: rgba(101,163,13,.12); border-color: rgba(101,163,13,.4); color: #3f6212; }
html[data-theme="light"] .chip-accent { color: #0e7490; background: rgba(8,145,178,.08); }
html[data-theme="light"] .msg-error { background: rgba(225,29,72,.08); color: #9f1239; }
html[data-theme="light"] .msg-ok { background: rgba(101,163,13,.1); color: #3f6212; }
html[data-theme="light"] .msg-info { background: rgba(8,145,178,.08); color: #155e75; }
html[data-theme="light"] .rec.is-on { color: #be123c; }
html[data-theme="light"] .rec.is-busy { color: #0e7490; }
html[data-theme="light"] .bar { background: rgba(17,19,34,.08); }
html[data-theme="light"] .modal-box { background: #ffffff; }
html[data-theme="light"] .plan-tag { color: #fff; }

/* ── Promo NOVEMBRE50 ───────────────────────────────────────────────────── */
.promo-old { font-size: 15px; font-weight: 500; color: var(--muted-2); text-decoration: line-through; margin-right: 4px; }
.promo-new.is-promo { color: var(--lime); }
.promo-banner { margin: 6px 0 10px; padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; background: rgba(163,230,53,.1); border: 1px solid rgba(163,230,53,.35); color: var(--text); }
.promo-banner i { color: var(--lime); margin-right: 4px; }
.promo-banner code { font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); letter-spacing: .04em; }
html[data-theme="light"] .promo-banner { background: rgba(101,163,13,.1); border-color: rgba(101,163,13,.35); }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 22px; white-space: nowrap; }
.promo-old { font-size: 13px; }

/* Lien vers les abonnements dans la fenêtre des pass */
.plans-sub { display: block; margin: 14px 0 4px; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1.5px solid var(--accent, #8b5cf6); text-decoration: none; color: inherit; }
.plans-sub span { display: block; margin-top: 4px; font-weight: 600; color: var(--accent, #8b5cf6); }

/* Étapes du partage d'onglet */
.howto { margin: 14px 0 6px 18px; display: grid; gap: 4px; }
