/* assets/css/app.css — Application Sondages : design moderne (navigation flottante, fonds en dégradé,
   parcours participant immersif). Espace participants + espace administrateur. */

:root {
    --ink: #0a1424;
    --ink-2: #111f36;
    --ink-3: #1b2d4d;
    --primary: #2457d6;
    --primary-600: #1c46b4;
    --primary-50: #eef3ff;
    --primary-100: #dce6ff;
    --primary-rgb: 36, 87, 214;
    --brand: #1e4e79;
    --accent: #f5c518;
    --accent-2: #ffd84d;
    --accent-50: #fff7d6;
    --cyan: #22b8cf;
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #8391a7;
    --border: #e6eaf2;
    --border-strong: #d3dae6;
    --ok: #0e9f6e; --ok-50: #e6f7f0;
    --warn: #b7791f; --warn-50: #fff4dc;
    --bad: #e11d48; --bad-50: #ffe9ee;
    --r: 18px;
    --r-lg: 24px;
    --r-sm: 12px;
    --sh-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --sh: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .10);
    --sh-lg: 0 2px 6px rgba(15, 23, 42, .05), 0 24px 60px -18px rgba(15, 23, 42, .28);
    --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
button { font: inherit; }
::selection { background: rgba(var(--primary-rgb), .18); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

/* Fond « mesh » (dégradés superposés + grille fine) */
.mesh {
    background:
        radial-gradient(55% 80% at 8% 0%, rgba(36, 87, 214, .55), transparent 62%),
        radial-gradient(38% 60% at 92% 8%, rgba(245, 197, 24, .22), transparent 60%),
        radial-gradient(45% 70% at 62% 105%, rgba(34, 184, 207, .28), transparent 62%),
        linear-gradient(180deg, #0b1628, #0a1424);
    position: relative; overflow: hidden; isolation: isolate;
}
.mesh::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(80% 90% at 50% 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(80% 90% at 50% 0%, #000 30%, transparent 75%);
}
.mesh::after {
    content: ''; position: absolute; width: 520px; height: 520px; right: -160px; top: -220px; z-index: -1; border-radius: 50%;
    background: conic-gradient(from 120deg, rgba(245,197,24,.0), rgba(245,197,24,.18), rgba(36,87,214,.22), rgba(245,197,24,.0));
    filter: blur(40px); animation: tourne 26s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
.grad-txt { background: linear-gradient(90deg, var(--accent-2), #ffb020 60%, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ───────────── Boutons ───────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
    font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; letter-spacing: -.005em;
    transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s var(--ease), filter .18s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .input:focus-visible, .choix-opt:focus-visible, .btn-icon:focus-visible, .mode:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .3); outline-offset: 2px; }
.btn-primary {
    background: linear-gradient(180deg, #2f66ea, #1f4ec8); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 20px -8px rgba(var(--primary-rgb), .7);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 26px -8px rgba(var(--primary-rgb), .75); }
.btn-accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 20px -8px rgba(245,197,24,.7); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-sm); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-glass { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-glass:hover:not(:disabled) { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f6c2cd; }
.btn-danger:hover:not(:disabled) { background: var(--bad-50); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-xs { height: 30px; padding: 0 11px; font-size: 12px; gap: 6px; border-radius: 9px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 14px; }
.btn-icon {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none !important;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn-icon:hover:not(:disabled) { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); transform: translateY(-1px); }
.btn-icon.danger:hover:not(:disabled) { background: var(--bad-50); color: var(--bad); border-color: #f6c2cd; }
.btn-icon:disabled { opacity: .35; cursor: not-allowed; }

/* ───────────── Formulaires ───────────── */
.label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.req { color: var(--bad); }
.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.input, .textarea, select.input {
    width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: #a3aec0; }
.textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.input:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12); }
.input:disabled { opacity: .7; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238391a7' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; }
.input-ico { position: relative; }
.input-ico > i { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 13px; }
.input-ico > .input { padding-inline-start: 40px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.msg { color: var(--bad); font-size: 13px; font-weight: 600; }
.msg:empty { display: none; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d1d8e4; border-radius: 24px; cursor: pointer; transition: background .25s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + span { background: linear-gradient(90deg, #12b981, var(--ok)); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(var(--primary-rgb), .3); outline-offset: 2px; }

/* ───────────── Badges, cartes, divers ───────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef1f6; color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--bad-50); color: var(--bad); }
.badge.info { background: var(--primary-50); color: var(--primary); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card-head h3 i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-50); color: var(--primary); font-size: 13px; }
.card-body { padding: 22px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty i.big { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--primary-50); color: var(--primary); font-size: 24px; }

.section-title { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 34px 0 16px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.toast {
    position: fixed; left: 50%; bottom: 26px; z-index: 1000; display: flex; align-items: center; gap: 12px;
    max-width: min(520px, calc(100vw - 32px)); padding: 13px 18px 13px 14px; border-radius: 16px; background: rgba(10, 20, 36, .92); color: #fff;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--sh-lg); font-weight: 600; font-size: 13.5px;
    transform: translate(-50%, 24px) scale(.96); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .25s;
}
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.toast i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(16, 185, 129, .2); color: #34d399; flex: none; }
.toast.err i { background: rgba(225, 29, 72, .22); color: #fb7185; }

/* ───────────── Indicateurs (bento) ───────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.kpi-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-50); color: var(--primary); font-size: 16px; flex: none; }
.kpi > div:last-child { display: flex; flex-direction: column; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; order: 0; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi.ok .kpi-ico { background: var(--ok-50); color: var(--ok); }
.kpi.warn .kpi-ico { background: var(--warn-50); color: var(--warn); }
.kpi.bad .kpi-ico { background: var(--bad-50); color: var(--bad); }
.kpi.accent .kpi-ico { background: var(--accent-50); color: #9a7400; }
.kpis .kpi:first-child { background: linear-gradient(145deg, #1d4fc9, #12357f 70%, #0d2552); border-color: transparent; color: #fff; }
.kpis .kpi:first-child::after { content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; background: radial-gradient(circle, rgba(245,197,24,.45), transparent 65%); }
.kpis .kpi:first-child .kpi-ico { background: rgba(255,255,255,.14); color: var(--accent-2); }
.kpis .kpi:first-child .kpi-label, .kpis .kpi:first-child .kpi-sub { color: rgba(255,255,255,.7); }

/* ───────────── Tableaux ───────────── */
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 12px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 15px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover td { background: #fafbfe; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-titre strong { display: block; font-weight: 700; font-size: 14px; }
.tbl-titre small { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ───────────── Onglets (contrôle segmenté) ───────────── */
.tabs { display: inline-flex; gap: 4px; padding: 5px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--sh-sm); max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.tab-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 11px; background: none; color: var(--text-2); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.active { background: var(--ink); color: #fff; box-shadow: 0 6px 14px -6px rgba(10,20,36,.6); }
.tab-count { background: rgba(var(--primary-rgb), .12); color: var(--primary); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.tab-btn.active .tab-count { background: rgba(255,255,255,.16); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: monte .35s var(--ease); }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(140deg, #3b74f0, #1c46b4); color: #fff; font-weight: 800; font-size: 12.5px; flex: none; letter-spacing: .02em; }

/* ════════════════════════ ESPACE PARTICIPANTS ════════════════════════ */

.pub-top { color: #fff; padding-bottom: 96px; }
.pub-header { position: sticky; top: 0; z-index: 60; background: rgba(10, 20, 36, .55); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid rgba(255,255,255,.07); }
.pub-header-in { max-width: 1160px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; min-width: 0; }
.brand img { height: 38px; width: auto; max-width: 140px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px 8px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(140deg, var(--accent-2), #f0a500); color: var(--ink); font-size: 17px; flex: none; box-shadow: 0 8px 20px -8px rgba(245,197,24,.8); }
.brand-txt { min-width: 0; }
.brand-txt strong { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { display: block; font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-header .btn { flex: none; }

.pub-hero-in { max-width: 1160px; margin: 0 auto; padding: 64px 24px 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.85); margin-bottom: 22px; }
.eyebrow b { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 11px; }
.pub-hero-in h1 { font-size: clamp(32px, 5.4vw, 58px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; max-width: 780px; }
.pub-hero-in > p { margin: 18px 0 0; max-width: 600px; color: rgba(255,255,255,.72); font-size: 16.5px; line-height: 1.6; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; font-size: 13px; color: rgba(255,255,255,.7); font-weight: 500; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust i { color: var(--accent); }
.pub-top.compact { padding-bottom: 90px; }
.pub-top.compact .pub-hero-in { padding: 26px 24px 0; max-width: 868px; }
.pub-top.compact .eyebrow, .pub-top.compact p, .pub-top.compact .trust { display: none; }
.pub-top.compact h1 { font-size: 20px; letter-spacing: -.02em; }

.pub-main { max-width: 1160px; margin: -64px auto 0; padding: 0 24px 64px; position: relative; z-index: 2; }
.pub-footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 36px; }

.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.s-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; animation: monte .5s var(--ease) both; }
.s-card:nth-child(2) { animation-delay: .06s; } .s-card:nth-child(3) { animation-delay: .12s; } .s-card:nth-child(4) { animation-delay: .18s; }
.s-card:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); }
.s-card-top { height: 92px; position: relative; background: radial-gradient(70% 120% at 0% 0%, rgba(36,87,214,.22), transparent 60%), radial-gradient(60% 120% at 100% 0%, rgba(245,197,24,.22), transparent 60%), var(--surface-2); border-bottom: 1px solid var(--border); }
.s-card.off .s-card-top { filter: grayscale(1); opacity: .7; }
.s-card-body { padding: 0 24px 4px; flex: 1; }
.s-card-head { display: flex; flex-direction: column; gap: 14px; margin-top: -30px; margin-bottom: 12px; }
.s-card-ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(140deg, #3b74f0, #1c46b4); color: #fff; font-size: 22px; flex: none; box-shadow: 0 12px 24px -10px rgba(var(--primary-rgb), .8), 0 0 0 5px #fff; position: relative; }
.s-card h3 { font-size: 19px; font-weight: 800; }
.s-card-desc { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px; white-space: pre-line; }
.s-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); font-weight: 600; }
.chip i { color: var(--primary); font-size: 11px; }
.s-card-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px 22px; }
.s-card-foot .etat { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.etat.ok { color: var(--ok); }
.etat.ok i { font-size: 8px; animation: pulse 2s infinite; border-radius: 50%; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14,159,110,.5); } 70% { box-shadow: 0 0 0 7px rgba(14,159,110,0); } 100% { box-shadow: 0 0 0 0 rgba(14,159,110,0); } }
.etat.off { color: var(--muted); }

.chip.chip-lock { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.chip-lock i { color: var(--accent); }

/* Écran « Sondage protégé » */
.verrou { max-width: 440px; margin: 0 auto; padding: 18px 0 8px; text-align: center; animation: monte .45s var(--ease); }
.verrou-ico { position: relative; display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 26px; background: linear-gradient(145deg, var(--ink-3), var(--ink)); color: var(--accent); font-size: 32px; box-shadow: 0 20px 40px -16px rgba(10,20,36,.7); }
.verrou-ico::after { content: ''; position: absolute; inset: -8px; border-radius: 32px; border: 1.5px solid rgba(var(--primary-rgb), .18); }
.verrou h3 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.verrou p { color: var(--text-2); margin: 0 0 26px; line-height: 1.6; }
.verrou-form { display: grid; gap: 12px; }
.verrou .msg { display: block; margin-top: 14px; }
.mdp-champ { position: relative; }
.mdp-champ > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mdp-champ .input { min-height: 56px; padding: 10px 52px 10px 46px; font-size: 18px; font-weight: 700; letter-spacing: .18em; text-align: center; }
.mdp-champ .input::placeholder { letter-spacing: normal; font-weight: 500; font-size: 15px; }
.mdp-oeil { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.mdp-oeil:hover { background: var(--primary-50); color: var(--primary); }
.mdp-champ.erreur { animation: secoue .45s; }
.mdp-champ.erreur .input { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(225, 29, 72, .1); }
/* Variante compacte (éditeur admin) */
.mdp-champ.compact .input { min-height: 46px; font-size: 15px; letter-spacing: .12em; text-align: left; padding-left: 40px; padding-right: 92px; }
.mdp-champ.compact > i { left: 15px; font-size: 13px; }
.mdp-outils { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.mdp-outils button { width: 36px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.mdp-outils button:hover { background: var(--primary-50); color: var(--primary); }
.mdp-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 10px; border-radius: 9px; background: var(--ink); color: #fff; font: 700 12px var(--font); letter-spacing: .1em; white-space: nowrap; }
.mdp-badge i { color: var(--accent); font-size: 10px; }
.mdp-badge button { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 10px; }
.mdp-badge button:hover { background: rgba(255,255,255,.22); }

/* Parcours */
.run { max-width: 820px; margin: 0 auto; }
.run-back { margin: -72px 0 22px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--sh-lg); overflow: hidden; }
.panel-head { padding: 30px 38px 24px; border-bottom: 1px solid var(--border); position: relative; }
.panel-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.panel-body { padding: 32px 38px 34px; }
.apercu-band { background: repeating-linear-gradient(-45deg, var(--accent-50), var(--accent-50) 12px, #fff1b8 12px, #fff1b8 24px); color: #7a5d00; padding: 10px 38px; font-size: 13px; font-weight: 700; }

.progress { margin-top: 20px; display: flex; align-items: center; gap: 14px; }
.progress-bar { flex: 1; height: 8px; background: #edf1f7; border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--cyan) 70%, var(--accent)); border-radius: 99px; transition: width .5s var(--ease); }
.progress small { font-size: 12.5px; color: var(--text-2); font-weight: 700; min-width: 96px; text-align: end; font-variant-numeric: tabular-nums; }

.intro { background: linear-gradient(135deg, var(--primary-50), #f7f9ff); border: 1px solid var(--primary-100); border-radius: 18px; padding: 18px 22px; color: var(--text-2); white-space: pre-line; margin-bottom: 30px; font-size: 13.5px; line-height: 1.65; }
.ident-title { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.ident-title i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: var(--accent); font-size: 14px; }
.ident-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; margin-inline-start: 48px; }
.ident { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ident .full { grid-column: 1 / -1; }
.ident .input { min-height: 52px; font-size: 15px; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px 18px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s; }
.mode > i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--surface-2); font-size: 16px; color: var(--muted); flex: none; transition: background .2s, color .2s; }
.mode strong { display: block; font-size: 14px; font-weight: 800; }
.mode span { display: block; font-size: 12.5px; color: var(--muted); }
.mode:hover { border-color: var(--primary-100); transform: translateY(-2px); }
.mode.active { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .08); }
.mode.active > i { background: var(--primary); color: #fff; }

.run-actions { display: flex; align-items: center; gap: 12px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.kbd-hint { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: #fff; font: 700 11px var(--font); color: var(--text-2); }

.sec-banner { display: flex; align-items: center; gap: 12px; margin: 34px 0 6px; padding: 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
.sec-banner::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--primary-100), transparent); }
.sec-banner:first-child { margin-top: 0; }
.sec-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: var(--accent); font-size: 12.5px; flex: none; letter-spacing: 0; }

.q { padding: 22px 0; border-bottom: 1px solid var(--border); }
.q:last-child { border-bottom: 0; }
.q-title { display: flex; gap: 14px; font-weight: 700; font-size: 16px; margin-bottom: 16px; letter-spacing: -.01em; }
.q-num { flex: none; min-width: 36px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-50); color: var(--primary); font-size: 12.5px; font-weight: 800; }
.q-body { padding-inline-start: 50px; }
.q.is-missing { animation: secoue .45s; }
.q.is-missing .q-num { background: var(--bad-50); color: var(--bad); }
.q.is-missing .choix-opt { border-color: #f6c2cd; }
@keyframes secoue { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* Question par question : présentation immersive */
.single { animation: entre .45s var(--ease); min-height: 280px; }
.single.retour { animation-name: entreRetour; }
@keyframes entre { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes entreRetour { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.single .sec-banner { margin-bottom: 18px; }
.single .q { border-bottom: 0; padding: 4px 0 0; }
.single .q-title { flex-direction: column; gap: 14px; font-size: clamp(20px, 3vw, 27px); font-weight: 800; letter-spacing: -.03em; line-height: 1.25; margin-bottom: 26px; }
.single .q-num { align-self: flex-start; }
.single .q-body { padding-left: 0; }
.single .choix { grid-template-columns: 1fr; max-width: 580px; }

.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.choix-opt {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 54px;
    border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
    transition: border-color .15s, background .15s, transform .15s var(--ease), box-shadow .15s;
}
.choix-opt .key { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--border-strong); font-size: 11.5px; font-weight: 800; color: var(--muted); flex: none; transition: all .15s; }
.choix-opt .lib { flex: 1; }
.choix-opt::after { content: ''; width: 20px; height: 20px; border-radius: 50%; flex: none; margin-inline-start: auto; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease);
    background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat; }
.choix-opt:hover { border-color: var(--primary-100); background: #fbfcff; transform: translateY(-1px); box-shadow: var(--sh); }
.choix-opt:hover .key { border-color: var(--primary); color: var(--primary); }
.choix-opt[aria-checked="true"] { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .08); }
.choix-opt[aria-checked="true"] .key { background: var(--primary); border-color: var(--primary); color: #fff; }
.choix-opt[aria-checked="true"]::after { opacity: 1; transform: scale(1); }
.choix-opt.flash { animation: flash .35s; }
@keyframes flash { 50% { transform: scale(.98); } }
.com { margin-top: 14px; }
.com label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.com .textarea { min-height: 70px; }
.single .textarea[data-txt] { min-height: 150px; font-size: 15px; }

/* ── Écran de fin : statut, remerciement du sondage (le même que sur la fiche PDF), récapitulatif ── */
.done { text-align: center; padding: 22px 0 6px; animation: monte .5s var(--ease); }
.done-ico { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 26px; box-shadow: 0 0 0 8px var(--ok-50), 0 14px 30px -12px rgba(14,159,110,.7); animation: pop .55s var(--ease); }
.done-ico.apercu { background: var(--warn); box-shadow: 0 0 0 8px var(--warn-50), 0 14px 30px -12px rgba(183,121,31,.6); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.done-statut { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px; background: var(--ok-50); color: var(--ok); font-size: 12.5px; font-weight: 700; margin-bottom: 14px; }
.done-statut.apercu { background: var(--warn-50); color: var(--warn); }
.done-titre { max-width: 620px; margin: 0 auto; font-size: 25px; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; color: var(--ink); }
.done-sep { width: 48px; height: 3px; margin: 18px auto 18px; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.done-texte { max-width: 600px; margin: 0 auto; }
.done-texte p { margin: 0 0 6px; color: var(--text-2); font-size: 15px; line-height: 1.85; }
.done-texte p.signature { margin-top: 14px; color: var(--ink); font-weight: 700; }
.done-remarque { max-width: 600px; margin: 26px auto 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-align: start; }
.done-remarque .label i { color: var(--primary); }
.done-remarque .textarea { min-height: 96px; }
.done-remarque-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.done-remarque-actions .msg { margin-inline-end: auto; }
.msg.ok { color: var(--ok); }
.done-recu { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 440px; margin: 28px auto 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.done-recu > div { padding: 13px 12px; }
.done-recu > div + div { border-inline-start: 1px solid var(--border); }
.done-recu small { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.done-recu strong { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.done-confid { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.done-confid i { color: var(--ok); }
.done .run-actions { justify-content: center; border-top: 0; margin-top: 22px; }
[dir="rtl"] .done-recu small, [dir="rtl"] .done-titre { letter-spacing: 0; }
@media (max-width: 600px) {
    .done-titre { font-size: 21px; }
    .done-recu { grid-template-columns: 1fr; }
    .done-recu > div + div { border-inline-start: 0; border-top: 1px solid var(--border); }
}
.pdf-state { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 9px 16px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }

/* ════════════════════════ ESPACE ADMINISTRATEUR ════════════════════════ */

.adm { position: relative; min-height: 100vh; }
.adm-band { position: absolute; left: 0; right: 0; top: 0; height: 330px; z-index: 0; }
.topnav { position: sticky; top: 0; z-index: 100; background: rgba(10, 20, 36, .72); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); border-bottom: 1px solid rgba(255,255,255,.07); }
.topnav-in { max-width: 1400px; margin: 0 auto; height: 70px; padding: 0 28px; display: flex; align-items: center; gap: 18px; }
.tn-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; flex: none; }
.tn-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
.tn-brand strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.15; }
.tn-brand small { display: block; font-size: 11.5px; color: rgba(255,255,255,.55); }
.tn-links { display: flex; gap: 2px; padding: 5px; margin: 0 auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; }
.tn-links a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; color: rgba(255,255,255,.7); font-weight: 700; font-size: 13.5px; text-decoration: none !important; transition: color .2s, background .2s; white-space: nowrap; }
.tn-links a i { font-size: 13px; }
.tn-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
.tn-links a.active { background: #fff; color: var(--ink); box-shadow: 0 6px 16px -6px rgba(0,0,0,.5); }
.tn-links a.active i { color: var(--primary); }
.tn-right { display: flex; align-items: center; gap: 10px; flex: none; }
.tn-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.8); text-decoration: none !important; transition: background .2s, color .2s; }
.tn-icon:hover { background: rgba(255,255,255,.14); color: #fff; }
.tn-user { position: relative; }
.tn-user summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 14px; cursor: pointer; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); transition: background .2s; }
.tn-user summary::-webkit-details-marker { display: none; }
.tn-user summary:hover { background: rgba(255,255,255,.14); }
.tn-user summary .avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, var(--accent-2), #f0a500); color: var(--ink); }
.tn-user summary strong { font-size: 13px; font-weight: 700; }
.tn-user summary i { font-size: 10px; color: rgba(255,255,255,.6); transition: transform .2s; }
.tn-user[open] summary i { transform: rotate(180deg); }
.tn-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--sh-lg); animation: monte .2s var(--ease); }
.tn-menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.tn-menu .who strong { display: block; font-size: 13.5px; }
.tn-menu .who small { color: var(--muted); font-size: 12px; }
.tn-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 13.5px; text-decoration: none !important; }
.tn-menu a i { width: 16px; color: var(--muted); }
.tn-menu a:hover { background: var(--surface-2); }
.tn-menu a.out { color: var(--bad); }
.tn-menu a.out i { color: var(--bad); }

.adm-content { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 36px 28px 72px; }
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 30px; color: #fff; min-height: 100px; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.035em; }
.page-head p { margin: 6px 0 0; color: rgba(255,255,255,.65); font-size: 14.5px; }
.page-head .tools { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.page-head .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); box-shadow: none; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.page-head .btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.5); margin-bottom: 10px; font-weight: 600; }
.crumb a { color: rgba(255,255,255,.65); }
.crumb a:hover { color: #fff; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.chart-box { position: relative; height: 270px; }
.chart-box.tall { height: 420px; }
.recent { list-style: none; margin: 0; padding: 6px 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 11px 22px; transition: background .15s; }
.recent li:hover { background: var(--surface-2); }
.recent li.empty { display: block; }
.recent .t { flex: 1; min-width: 0; }
.recent .t strong { display: block; font-size: 13.5px; }
.recent .t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filtres { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.filtres .input-ico { flex: 1; min-width: 220px; }
.filtres select.input { width: auto; min-width: 190px; }

/* Éditeur */
.ed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ed-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ed-grid .full { grid-column: 1 / -1; }
.ed-warn { display: flex; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--warn-50); color: #7a4c00; border: 1px solid #f3dcae; margin-bottom: 20px; font-size: 13.5px; box-shadow: var(--sh); }
.ed-warn i { margin-top: 3px; }
.ed-checks { display: flex; flex-direction: column; gap: 14px; }
.ed-outline { list-style: none; margin: 0; padding: 0; max-height: 48vh; overflow: auto; }
.ed-outline li { display: flex; gap: 8px; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.ed-outline li:hover { background: var(--primary-50); color: var(--primary); }
.ed-outline li b { color: var(--primary); min-width: 28px; }
.ed-outline li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-outline li.sec { font-weight: 800; color: var(--text); cursor: default; margin-top: 8px; background: none; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.ed-savebar {
    position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 22px; margin-top: 28px;
    background: rgba(10, 20, 36, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 18px; box-shadow: var(--sh-lg); color: #fff;
}
.ed-savebar .msg { color: #fda4af; }
.ed-savebar .muted { color: rgba(255,255,255,.7) !important; }
.ed-savebar .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); box-shadow: none; }
.ed-savebar .btn-ghost:hover { background: rgba(255,255,255,.16); }
.ed-savebar .btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--ink); box-shadow: 0 8px 20px -8px rgba(245,197,24,.8); }

.qe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 14px; transition: border-color .2s, box-shadow .2s; }
.qe:focus-within { border-color: rgba(var(--primary-rgb), .4); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .07), var(--sh); }
.qe-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0; cursor: pointer; }
.qe.closed .qe-head { border-bottom: 0; border-radius: var(--r); }
.qe-num { flex: none; padding: 4px 10px; border-radius: 9px; background: var(--ink); color: var(--accent); font-size: 12px; font-weight: 800; }
.qe-resume { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qe-resume b { color: var(--text); font-weight: 700; }
.qe-tools { display: flex; gap: 4px; }
.qe-tools .btn-icon { width: 30px; height: 30px; font-size: 12px; border-color: transparent; background: transparent; }
.qe-tools .btn-icon:hover:not(:disabled) { border-color: var(--primary-100); }
.qe-body { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 210px; gap: 16px; }
.qe-body .full { grid-column: 1 / -1; }
.qe-body .span2 { grid-column: span 2; }
.qe.closed .qe-body { display: none; }
.choix-edit { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.choix-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 100px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.choix-row .idx { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1.5px solid var(--border-strong); color: var(--text-2); font-size: 11.5px; font-weight: 800; }
.choix-row .input { min-height: 38px; padding: 7px 11px; background: #fff; }
.choix-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.choix-tools small { color: var(--muted); margin-inline-start: auto; }
.add-q { width: 100%; height: 60px; border: 2px dashed var(--border-strong); background: rgba(255,255,255,.5); color: var(--primary); border-radius: var(--r); font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all .2s; }
.add-q:hover { border-color: var(--primary); background: var(--primary-50); transform: translateY(-1px); }

/* Résultats */
.res-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.fiches { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.fiches-liste { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); max-height: calc(100vh - 120px); overflow: auto; position: sticky; top: 92px; padding: 6px; }
.p-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; transition: background .15s; }
.p-item:hover { background: var(--surface-2); }
.p-item.active { background: var(--primary-50); box-shadow: inset 0 0 0 1.5px rgba(var(--primary-rgb), .25); }
.p-item .t { flex: 1; min-width: 0; }
.p-item strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-item small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pct { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.pct.ok { background: var(--ok-50); color: var(--ok); }
.pct.mid { background: var(--warn-50); color: var(--warn); }
.pct.low { background: var(--bad-50); color: var(--bad); }

.fiche { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); min-height: 300px; overflow: hidden; }
.fiche-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.fiche-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.fiche-bar .tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.fiche-doc { padding: 26px 30px 32px; }
.fiche-titre { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.fiche-titre h2 { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.fiche-titre small { color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: #fff; border-radius: 16px; padding: 18px 20px; margin-bottom: 10px; }
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.55); font-weight: 700; }
.info-value { font-weight: 700; font-size: 14.5px; }
/* Remarque de l'administrateur et correction de l'identité */
.remarque-admin { margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-50); border: 1px solid #f3e2a0; }
.remarque-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #8a6a00; margin-bottom: 6px; }
.remarque-tete small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.remarque-tete .btn-xs { margin-left: auto; }
.remarque-txt { white-space: pre-line; line-height: 1.6; color: var(--text); }
.remarque-ajout { margin: 0 0 14px; }
.remarque-admin.fin { background: var(--primary-50); border-color: var(--primary-100); }
.remarque-admin.fin .remarque-tete { color: var(--primary); }
.fiche-edit { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.fiche-edit h4 { font-size: 14px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.fiche-edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.fiche-edit .actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fiche-edit .actions .msg { color: var(--danger, #d64545); font-size: 13px; font-weight: 600; margin-right: auto; }
@media (max-width: 720px) { .fiche-edit-grid { grid-template-columns: 1fr; } }
.score { text-align: right; }
.score strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.score-bar { display: block; width: 170px; height: 7px; background: #edf1f7; border-radius: 99px; margin-top: 8px; overflow: hidden; margin-left: auto; }
.score-bar span { display: block; height: 100%; background: linear-gradient(90deg, #19c08a, var(--ok)); border-radius: 99px; }
.score.mid .score-bar span { background: linear-gradient(90deg, var(--accent-2), #f0a500); }
.score.low .score-bar span { background: linear-gradient(90deg, #fb7185, var(--bad)); }
.r-choix { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r-opt { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); font-weight: 600; }
.r-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(var(--primary-rgb), .7); }
.r-pts { margin-left: 6px; font-size: 12px; color: var(--text-2); font-weight: 800; }
.r-com { margin-top: 10px; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; font-size: 13px; color: var(--text-2); white-space: pre-line; }
.r-com i { color: var(--muted); margin-right: 6px; }
.r-texte { padding: 12px 16px; background: var(--surface-2); border-inline-start: 3px solid var(--primary); border-start-end-radius: 12px; border-end-end-radius: 12px; white-space: pre-line; }
.r-sans { color: var(--muted); font-style: italic; font-size: 13px; }

.matrice { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matrice th, .matrice td { padding: 10px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.matrice thead th { background: var(--surface-2); font-weight: 800; color: var(--text-2); vertical-align: bottom; position: sticky; top: 0; z-index: 1; }
.matrice thead th small { display: block; font-weight: 500; color: var(--muted); max-width: 200px; white-space: normal; }
.matrice .sticky { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--border); }
.matrice thead .sticky { z-index: 3; }
.matrice td.texte { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.matrice td.vide { color: var(--border-strong); text-align: center; }
.cell-choix { padding: 3px 9px; border-radius: 7px; background: #eef1f6; font-weight: 600; }
.cell-choix.ok { background: var(--ok-50); color: var(--ok); }
.cell-choix.mid { background: var(--warn-50); color: var(--warn); }
.cell-choix.low { background: var(--bad-50); color: var(--bad); }
.lien { border: 0; background: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 0; }
.lien:hover { text-decoration: underline; }
.matrice-scroll { max-height: calc(100vh - 220px); overflow: auto; }

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.charts .wide { grid-column: 1 / -1; }
.qstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 16px; }
.qstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh); }
.qstat-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.qstat-head .t { flex: 1; font-weight: 700; font-size: 13.5px; }
.qstat-head .sec { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); font-weight: 800; margin-bottom: 2px; }
.qstat-moy { font-size: 12.5px; font-weight: 800; color: #fff; background: var(--ink); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 78px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.bar-row .lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.bar { height: 10px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); border-radius: 99px; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.qstat-foot { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Connexion */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); color: #fff; }
.login-art { padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-art h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; letter-spacing: -.04em; line-height: 1.08; max-width: 520px; margin-bottom: 16px; }
.login-art p { color: rgba(255,255,255,.7); max-width: 460px; font-size: 15.5px; margin: 0; }
.login-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; max-width: 560px; }
.login-feats div { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; color: rgba(255,255,255,.88); }
.login-feats i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(245,197,24,.15); color: var(--accent); flex: none; }
.login-form { display: grid; place-items: center; padding: 40px 28px; }
.login-box { width: 100%; max-width: 420px; padding: 38px 36px; background: #fff; color: var(--text); border-radius: 28px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); animation: monte .5s var(--ease); }
.login-box h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.login-box > p { color: var(--muted); margin: 0 0 26px; }
.login-box .field { margin-bottom: 16px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 18px; box-shadow: var(--sh-sm); }
.alert.err { background: var(--bad-50); color: var(--bad); border: 1px solid #f9cdd7; }
.alert.ok { background: var(--ok-50); color: var(--ok); border: 1px solid #bfeadb; }

/* Paramètres */
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.logo-prev { display: grid; place-items: center; height: 120px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.logo-prev img { max-height: 86px; max-width: 80%; }
.form-stack { display: grid; gap: 16px; }

/* ───────────── Responsive ───────────── */
/* ───────────── Sondages en arabe (lecture de droite à gauche) ───────────── */
/* Police arabe sur le conteneur seulement : les icônes (.fas) gardent leur propre police. */
[dir="rtl"] { font-family: 'IBM Plex Sans Arabic', var(--font); }
.apercu-band { direction: ltr; text-align: left; }
[dir="rtl"] { letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .q-title, [dir="rtl"] .ident-title { letter-spacing: 0; }
[dir="rtl"] .sec-banner { text-transform: none; letter-spacing: 0; font-size: 15px; }
[dir="rtl"] .sec-banner::after { background: linear-gradient(270deg, var(--primary-100), transparent); }
[dir="rtl"] .ico-dir { transform: scaleX(-1); }
[dir="rtl"] select.input { background-position: left 14px center; padding-right: 14px; padding-left: 40px; }
[dir="rtl"] .single { animation-name: entreRetour; }
[dir="rtl"] .single.retour { animation-name: entre; }
[dir="rtl"] .q-title, [dir="rtl"] .intro, [dir="rtl"] .done p { line-height: 1.75; }
[dir="rtl"] .choix-opt { font-size: 15px; }
.pub-top.rtl .pub-hero-in { direction: rtl; }
.s-card-top { position: relative; }
.s-langue { position: absolute; top: 12px; inset-inline-end: 14px; padding: 3px 10px; border-radius: 99px; background: var(--ink); color: var(--accent); font-size: 12px; font-weight: 700; }
.badge.lang { background: var(--ink); color: var(--accent); }

/* Menu « Importer un modèle » */
.menu-modeles { position: relative; }
.menu-modeles summary { list-style: none; }
.menu-modeles summary::-webkit-details-marker { display: none; }
.menu-modeles .tn-menu { width: 330px; z-index: 50; }
.menu-modeles .tn-menu a { align-items: flex-start; }
.menu-modeles .tn-menu a i { margin-top: 3px; color: var(--primary); }
.menu-modeles .tn-menu a span { display: flex; flex-direction: column; gap: 2px; }
.menu-modeles .tn-menu a small { color: var(--muted); font-weight: 500; font-size: 12px; }

/* Rendu HTML du PDF arabe (hors écran, capturé en images par pdf.js) */
.pdf-rendu { position: fixed; left: -10000px; top: 0; width: 794px; background: #fff; color: #212529; font-family: 'IBM Plex Sans Arabic', var(--font); }
.pdf-rendu .pb { padding: 0 52px; }
.pdf-rendu .pb-tete { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 30px; padding-bottom: 18px; }
.pdf-rendu .pb-tete img { max-height: 64px; max-width: 220px; }
.pdf-rendu .pb-tete .org { font-size: 22px; font-weight: 700; color: #1e4e79; }
.pdf-rendu .pb-tete h1 { font-size: 24px; font-weight: 700; color: #1e4e79; letter-spacing: 0; text-align: end; }
.pdf-rendu .pb-tete small { display: block; color: #6e7887; font-size: 13px; text-align: end; margin-top: 4px; }
.pdf-rendu .pb-bande { height: 6px; background: linear-gradient(90deg, #1e4e79 0 62%, #f5c518 62% 100%); }
.pdf-rendu .pb-infos { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; background: #eaf1f8; border-radius: 10px; padding: 12px 16px; margin: 6px 0 16px; }
.pdf-rendu .pb-infos b { display: block; font-size: 11px; color: #6e7887; }
.pdf-rendu .pb-infos span { font-size: 15px; font-weight: 700; }
.pdf-rendu .pb-desc { background: #f7f9fc; border-inline-start: 4px solid #1e4e79; padding: 10px 14px; color: #5b6574; font-size: 13px; line-height: 1.8; white-space: pre-line; margin-bottom: 16px; }
.pdf-rendu .pb-sec { display: flex; align-items: center; gap: 10px; background: #eaf1f8; border-inline-start: 5px solid #f5c518; border-radius: 6px; padding: 7px 12px; margin: 10px 0 8px; font-size: 16px; font-weight: 700; color: #1e4e79; }
.pdf-rendu .pb-sec i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1e4e79; color: #fff; font-style: normal; font-size: 12px; }
.pdf-rendu .pb-q { padding: 8px 0 10px; border-bottom: 1px dashed #e2e8f0; }
.pdf-rendu .pb-q h4 { display: flex; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 8px; line-height: 1.7; letter-spacing: 0; }
.pdf-rendu .pb-q h4 em { font-style: normal; color: #1e4e79; flex: none; }
.pdf-rendu .pb-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-inline-start: 30px; font-size: 13px; color: #6e7887; }
.pdf-rendu .pb-opts span::before { content: '○'; margin-inline-end: 5px; }
.pdf-rendu .pb-opts .on { color: #1e4e79; font-weight: 700; }
.pdf-rendu .pb-opts .on::before { content: '●'; }
.pdf-rendu .pb-rep { padding-inline-start: 30px; font-size: 14px; line-height: 1.8; white-space: pre-line; }
.pdf-rendu .pb-rep small { display: block; color: #6e7887; font-size: 11px; }
.pdf-rendu .pb-com { padding-inline-start: 30px; margin-top: 6px; font-size: 13px; font-style: italic; color: #333; }
.pdf-rendu .pb-fin { background: #eaf1f8; border-radius: 10px; padding: 14px 18px; margin-top: 14px; text-align: center; font-size: 13.5px; line-height: 1.8; white-space: pre-line; }
.pdf-rendu .pb-fin b { color: #1e4e79; font-size: 15px; }

@media (max-width: 1100px) {
    .ed-layout { grid-template-columns: minmax(0, 1fr); }
    .ed-aside { position: static; order: -1; }
    .dash-grid, .charts, .param-grid { grid-template-columns: minmax(0, 1fr); }
    .fiches { grid-template-columns: minmax(0, 1fr); }
    .fiches-liste { position: static; max-height: 320px; }
    .tn-links a { padding: 8px 12px; }
}
@media (max-width: 900px) {
    .topnav-in { padding: 0 16px; height: 62px; }
    .tn-links { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 150; margin: 0; justify-content: space-around; border-radius: 22px; padding: 6px;
        background: rgba(10, 20, 36, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 40px -12px rgba(0,0,0,.6); }
    .tn-links a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 8px 6px; border-radius: 16px; flex: 1; justify-content: center; }
    .tn-links a i { font-size: 16px; }
    .tn-brand { margin-right: auto; }
    .tn-user summary strong { display: none; }
    .tn-user summary { padding-right: 10px; }
    .adm-content { padding: 26px 16px 110px; }
    .ed-savebar { bottom: 92px; }
    .login-page { grid-template-columns: minmax(0, 1fr); }
    .login-art { padding: 28px 24px 0; }
    .login-art .hide-mobile { display: none; }
    .login-form { padding: 24px 16px 40px; align-items: start; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .res-bar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .ident, .modes, .ed-grid { grid-template-columns: minmax(0, 1fr); }
    .qe-body { grid-template-columns: minmax(0, 1fr); }
    .qe-body .span2 { grid-column: auto; }
    .panel { border-radius: 22px; }
    .panel-head, .panel-body { padding-left: 20px; padding-right: 20px; }
    .apercu-band { padding: 9px 20px; }
    .ident-sub { margin-left: 0; }
    .q-body { padding-left: 0; }
    .choix { grid-template-columns: minmax(0, 1fr); }
    .s-grid { grid-template-columns: minmax(0, 1fr); }
    .pub-hero-in { padding: 40px 16px 20px; }
    .pub-main { padding: 0 16px 40px; }
    .pub-header-in { padding: 10px 16px; }
    .brand-txt small, .hide-sm { display: none; }
    .qstats { grid-template-columns: minmax(0, 1fr); }
    .bar-row { grid-template-columns: 96px minmax(0, 1fr) 66px; }
    .choix-row { grid-template-columns: 24px minmax(0, 1fr) 70px 34px; }
    .fiche-doc { padding: 20px 16px; }
    .page-head .tools { margin-left: 0; }
    .kbd-hint { display: none; }
    .login-box { padding: 30px 22px; }
    .login-feats { grid-template-columns: minmax(0, 1fr); }
    .tn-brand small { display: none; }
    .run-actions .btn-lg { flex: 1; }
}

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

@media print {
    .topnav, .adm-band, .fiches-liste, .fiche-bar, .tabs, .res-bar, .kpis, .page-head, .toast, .no-print { display: none !important; }
    .fiches { display: block; }
    .fiche { border: 0; box-shadow: none; }
    body { background: #fff; }
    .info-grid { background: #f1f4f9; color: #000; }
}
