:root {
  --bg: #05070a;
  --panel: rgba(16, 18, 24, .78);
  --panel-hi: rgba(28, 24, 24, .9);
  --line: rgba(226, 86, 43, .24);
  --line-soft: rgba(233, 223, 214, .09);
  --text: #e9dfd6;
  --muted: #8d8179;
  --ember: #e2562b;
  --gold: #f08a5d;
  --teal: #7fd0c0;
  --green: #8fbf9a;
  --red: #d9534f;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -3; background: radial-gradient(ellipse at 50% -10%, rgba(226, 86, 43, .22) 0%, rgba(120, 40, 20, .1) 38%, rgba(5, 7, 10, 0) 70%); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0) 0%, rgba(3, 5, 8, .5) 62%, rgba(3, 5, 8, .9) 100%); }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
h1, h2, h3, .brand { font-family: Georgia, "Times New Roman", serif; font-weight: 400; margin: 0; }
a { color: var(--gold); text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 56px; }

/* barre du haut */
.top { position: sticky; top: 0; z-index: 5; background: rgba(4, 6, 9, .86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.top img { width: 34px; height: 34px; border-radius: 8px; }
.brand { letter-spacing: .3em; text-transform: uppercase; font-size: 15px; }
.brand span { color: var(--ember); }
.top .who { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--gold); }

/* bandeau d'accueil */
.hero { padding: 44px 0 26px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); letter-spacing: .02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.todo { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.chip b { color: var(--gold); font-weight: 600; }
.chip.calm { border-color: var(--line-soft); color: var(--muted); }

/* grandes cartes des trois rubriques */
.tiles { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel-hi), var(--panel)); color: var(--text); overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tile::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; background: radial-gradient(circle, var(--glow, rgba(226, 86, 43, .22)), transparent 65%); pointer-events: none; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); border-color: rgba(240, 138, 93, .6); box-shadow: 0 10px 34px rgba(226, 86, 43, .16); outline: none; }
.tile.polls { --glow: rgba(226, 86, 43, .26); }
.tile.questions { --glow: rgba(127, 208, 192, .22); }
.tile.proposals { --glow: rgba(143, 191, 154, .22); }
.tile svg { width: 38px; height: 38px; stroke: var(--gold); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile.questions svg { stroke: var(--teal); }
.tile.proposals svg { stroke: var(--green); }
.tile h2 { font-size: 24px; }
.tile .sub { color: var(--muted); font-size: 14px; }
.tile .count { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.tile .count b { font-family: Georgia, serif; font-size: 34px; font-weight: 400; color: var(--text); }
.tile .count span { color: var(--muted); font-size: 13px; }
.tile .peek { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.tile .peek li { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .go { color: var(--gold); font-size: 14px; }

/* sections « en cours » et « récemment terminé » */
section.block { margin-top: 38px; }
section.block > h3 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
section.block > h3 small { color: var(--muted); font: 13px system-ui, sans-serif; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel); display: grid; gap: 8px; }
.card h4 { margin: 0; font-size: 16px; font-weight: 600; }
.card .meta { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); }
.empty { padding: 22px; border: 1px dashed var(--line-soft); border-radius: 14px; color: var(--muted); text-align: center; }
.soon { margin-top: 36px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }

/* page de connexion */
body.gate { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.gate-card { width: min(440px, 100%); text-align: center; padding: 34px 26px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(6px); }
.gate-card h1 { font-size: 40px; letter-spacing: .3em; text-transform: uppercase; margin-top: 10px; }
.gate-card .lead { color: var(--gold); margin: 4px 0 20px; }
.gate-card .denied { color: #ffb4a8; border: 1px solid rgba(217, 83, 79, .5); border-radius: 10px; padding: 8px 12px; }
.gate-logo { border-radius: 22px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* ---- navigation ---- */
.top .logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a { color: var(--muted); padding: 6px 12px; border-radius: 9px; font-size: 14px; }
nav.main a.on { background: var(--panel-hi); color: var(--text); }
nav.main a[hidden] { display: none; }
@media (max-width: 760px) { .top .wrap { flex-wrap: wrap; } .top .who { margin-left: 0; width: 100%; } }

/* ---- éléments communs ---- */
.page-title { font-size: clamp(24px, 4vw, 34px); margin: 26px 0 8px; }
.lead-text { color: var(--muted); max-width: 70ch; margin: 6px 0 14px; white-space: pre-line; }
.tiny { color: var(--muted); font-size: 12.5px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.hint.bad { color: #ffb4a8; }
.hint.inline { margin-left: 8px; }
a.card, a.chip { color: var(--text); }
a.card { transition: transform .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-2px); border-color: rgba(240, 138, 93, .55); }
.card.done { border-color: rgba(143, 191, 154, .35); }
.state { color: var(--gold); font-size: 12.5px; }
.state.ok { color: var(--green); }
.btn { font: inherit; font-size: 14.5px; padding: 9px 18px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover:not(:disabled) { border-color: rgba(240, 138, 93, .6); background: var(--panel-hi); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, rgba(240, 138, 93, .35), rgba(226, 86, 43, .28)); border-color: rgba(240, 138, 93, .7); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(217, 83, 79, .5); color: #ffb4a8; }
.btn.link { border: 0; background: none; color: var(--gold); padding: 4px 6px; text-decoration: underline; }
.btn.mini { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.mini.on { border-color: var(--green); color: var(--green); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.actions.sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(0deg, var(--bg) 60%, transparent); }
.banner { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); margin: 10px 0; font-size: 14px; }
.banner.ok { border-color: rgba(143, 191, 154, .5); }
.banner.bad { border-color: rgba(217, 83, 79, .6); color: #ffb4a8; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 12px; background: #1b1f26; border: 1px solid var(--line); z-index: 20; transition: .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(217, 83, 79, .7); color: #ffb4a8; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.view { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

/* ---- formulaires ---- */
.field { width: 100%; font: inherit; color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; }
.field:focus { outline: none; border-color: rgba(240, 138, 93, .7); }
.field.narrow { max-width: 180px; }
textarea.field { resize: vertical; }
.form-row { display: grid; gap: 4px; margin: 12px 0; }
.form-label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.check, .radio { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.check input, .radio input { margin-top: 4px; accent-color: var(--ember); }
.inline-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.sub-title { font-size: 18px; margin: 26px 0 6px; color: var(--gold); }

/* ---- réponse à un sondage ---- */
.vote { max-width: 760px; margin: 0 auto; }
.facts { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; gap: 6px; color: var(--muted); }
.progress, .bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress i, .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); transition: width .3s ease; }
.progress { margin: 22px 0 8px; }
.step-n { color: var(--muted); font-size: 13px; }
.q-label { font-size: clamp(22px, 3.5vw, 28px); margin: 8px 0; line-height: 1.25; }
.req { color: var(--ember); }
.answer { margin: 16px 0; }
.choices { display: grid; gap: 10px; }
.choice { font: inherit; text-align: left; padding: 13px 16px; border-radius: 13px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--text); cursor: pointer; transition: .15s; }
.choice:hover { border-color: rgba(240, 138, 93, .55); }
.choice.on { border-color: var(--gold); background: linear-gradient(160deg, rgba(240, 138, 93, .25), rgba(226, 86, 43, .12)); box-shadow: 0 0 0 1px rgba(240, 138, 93, .4) inset; }
.choice.round { width: 54px; height: 54px; padding: 0; text-align: center; border-radius: 50%; font-size: 18px; }
.scale-row { display: flex; flex-wrap: wrap; gap: 10px; }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; }
.muted { opacity: .45; }
.other { margin-top: 4px; }
.ranking { display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); }
.rank-n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(240, 138, 93, .2); color: var(--gold); font-size: 13px; }
.rank-label { flex: 1; }
.comment { margin-top: 12px; }
.review { display: grid; gap: 12px; }
.review-row { padding: 12px 16px; border-radius: 13px; border: 1px solid var(--line-soft); background: var(--panel); display: grid; gap: 4px; }
.review-q { color: var(--muted); font-size: 13.5px; }
.review-a.empty { color: var(--muted); }
.review-c { font-size: 13.5px; color: var(--muted); }
.done-box { text-align: center; padding-top: 30px; }
.big-icon { font-size: 54px; }

/* ---- résultats ---- */
.results-head { margin-bottom: 8px; }
.result-card { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel); margin: 14px 0; }
.result-card h3 { font-size: 19px; margin-bottom: 2px; }
.result-card h4 { margin: 16px 0 6px; font-size: 14px; color: var(--muted); }
.bars { display: grid; gap: 10px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) 3fr minmax(80px, .9fr); gap: 10px; align-items: center; font-size: 14px; }
.track { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.track i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); }
.bar-value { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr 1fr; } .track { grid-column: 1 / -1; order: 3; } }
.stat { margin: 12px 0 0; color: var(--text); }
.texts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.texts li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.pending { margin: 10px 0; }
.pending summary { cursor: pointer; color: var(--gold); }
.names { columns: 2 200px; margin: 8px 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---- administration ---- */
.admin-polls { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.admin-poll { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel); display: grid; gap: 8px; }
.admin-poll.open { border-color: rgba(143, 191, 154, .4); }
.ap-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ap-top h3 { font-size: 17px; font-family: system-ui, sans-serif; font-weight: 600; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.status { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--muted); }
.status.open { color: var(--green); border-color: rgba(143, 191, 154, .5); }
.status.scheduled { color: var(--teal); border-color: rgba(127, 208, 192, .5); }
.status.draft { color: var(--gold); border-color: var(--line); }
.stepper { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--muted); cursor: pointer; font-size: 14px; }
.stepper li b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); font-weight: 600; font-size: 13px; }
.stepper li.on { color: var(--text); border-color: var(--gold); }
.stepper li.on b { background: var(--ember); }
.stepper li.past b { background: rgba(143, 191, 154, .35); }
.wizard-body { margin-top: 12px; }
.q-edit { padding: 16px 18px; margin: 14px 0; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel); }
.q-edit-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ember); font-weight: 600; font-size: 14px; }
.q-type { color: var(--gold); font-size: 14px; }
.q-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.q-opts { margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.type-picker { margin: 22px 0; }
.type-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 8px; }
.type-btn { font: inherit; text-align: left; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); background: transparent; color: var(--text); cursor: pointer; }
.type-btn:hover { border-style: solid; background: var(--panel); }
.type-btn span { color: var(--muted); font-size: 12.5px; }
.preview { margin-top: 10px; padding: 8px 4px; border-radius: 16px; border: 1px dashed var(--line); }

/* ---- questions ---- */
.q-head { margin: 10px 0 14px; }
.q-body { white-space: pre-wrap; line-height: 1.6; }
.answer-card { border-color: rgba(143, 191, 154, .4); }
.chat-list { display: grid; gap: 10px; margin: 12px 0; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); justify-self: start; }
.bubble.mine { justify-self: end; background: rgba(226, 86, 43, .14); border-color: rgba(240, 138, 93, .35); }
.bubble-who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bubble-body { white-space: pre-wrap; word-break: break-word; }
.faq { display: grid; gap: 8px; margin-top: 12px; }
.faq-item { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); padding: 10px 14px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-answer { margin-top: 8px; white-space: pre-wrap; color: var(--muted); }
.faq-preview { margin-top: 12px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--gold); background: rgba(240, 138, 93, .06); }
.faq-preview h4 { margin: 4px 0 8px; font-size: 17px; }
