/* =====================================================================
   EVM Vote — feuille de style publique (FR / AR, RTL natif)
   Palette issue du logo : or, vert et étoile de Mauritanie, nuit de scène
   ===================================================================== */
:root {
  --bg: #090d0b;
  --bg-2: #0e1512;
  --surface: #131c18;
  --surface-2: #1a2621;
  --line: rgba(232, 184, 74, .16);
  --line-strong: rgba(232, 184, 74, .38);
  --gold: #e8b84a;
  --gold-2: #c58f2a;
  --gold-3: #fbe3a0;
  --green: #0f7a43;
  --green-2: #16a35a;
  --red: #c8102e;
  --text: #f5f0e4;
  --muted: #a8b2aa;
  --danger: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.55 var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(232, 184, 74, .12), transparent 70%),
    radial-gradient(800px 500px at 100% 0, rgba(15, 122, 67, .14), transparent 70%),
    var(--bg);
}
html[dir="rtl"] body { font-family: var(--font-ar); font-size: 17px; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-3); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.section { padding-block: 32px; }
.section__title { font-size: 1.5rem; display: flex; align-items: center; gap: 12px; }
.section__title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
html[dir="rtl"] .section__title::after { background: linear-gradient(270deg, var(--line-strong), transparent); }
.muted { color: var(--muted); font-size: .92rem; }
.empty { color: var(--muted); padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border-inline-start: 4px solid var(--gold); }
.skip { position: absolute; inset-inline-start: -9999px; top: 0; }
.skip:focus { inset-inline-start: 8px; z-index: 100; background: var(--gold); color: #111; padding: 8px 12px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 13, 11, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand img { width: 112px; height: auto; }
.mainnav { display: flex; gap: 4px; margin-inline-start: auto; }
.mainnav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.mainnav a:hover, .mainnav a.is-active { color: var(--text); background: var(--surface-2); }
.langswitch { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
@media (max-width: 640px) {
  .topbar__in { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  .brand img { width: 92px; }
  .mainnav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .mainnav a { flex: 1; text-align: center; padding: 8px 4px; font-size: .9rem; }
  .langswitch { margin-inline-start: auto; }
}
.offline-bar { background: var(--red); color: #fff; text-align: center; padding: 8px 16px; font-weight: 600; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text);
  font-weight: 700; cursor: pointer; text-align: center;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { color: var(--text); background: #22302a; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--gold {
  border: 0; color: #1d1405;
  background: linear-gradient(180deg, #ffd977 0%, var(--gold) 45%, var(--gold-2) 100%);
  box-shadow: 0 8px 22px -10px rgba(232, 184, 74, .8), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn--gold:hover { color: #1d1405; background: linear-gradient(180deg, #ffe08c 0%, #f0c25a 45%, #d39c32 100%); }
.btn--ghost { background: transparent; }
.btn--lg { min-height: 52px; padding-inline: 28px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--voted { background: rgba(22, 163, 90, .16); border-color: rgba(22, 163, 90, .5); color: #7fe0aa; }
.linkbtn { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; }

/* ---------- Accueil ---------- */
.hero { padding-block: 48px 24px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: auto 0 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 12%, var(--green) 12% 88%, var(--red) 88%);
  opacity: .8;
}
.hero__in { display: flex; flex-direction: column; align-items: center; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--gold);
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
html[dir="rtl"] .badge { letter-spacing: 0; }
.hero__title {
  font-size: clamp(2rem, 6vw, 3.4rem); margin: 16px 0 8px; font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(180deg, var(--gold-3), var(--gold) 55%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.hero__state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.state--open .dot { background: var(--green-2); box-shadow: 0 0 0 0 rgba(22, 163, 90, .7); animation: pulse 1.8s infinite; }
.state--paused .dot, .state--not_started .dot { background: var(--gold); }
.state--ended .dot, .state--closed .dot { background: var(--red); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(22, 163, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 90, 0); } }
@media (prefers-reduced-motion: reduce) { .state--open .dot { animation: none; } html { scroll-behavior: auto; } }

.countdown { margin-bottom: 24px; }
.countdown__label { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.countdown__grid { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.countdown__grid span {
  min-width: 68px; padding: 10px 8px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .8rem;
}
.countdown__grid b { display: block; font-size: 1.6rem; color: var(--text); font-variant-numeric: tabular-nums; }

.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps__n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1d1405; font-weight: 900; }
.rule-note { color: var(--gold-3); font-weight: 600; }

.cgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ccard {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px;
  border-radius: var(--radius); color: var(--text);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .2s ease;
}
.ccard:hover { color: var(--text); transform: translateY(-3px); border-color: var(--line-strong); }
.ccard__icon { font-size: 1.8rem; }
.ccard__name { font-weight: 800; font-size: 1.12rem; }
.ccard__meta { color: var(--muted); font-size: .9rem; }
.ccard__voted { position: absolute; top: 14px; inset-inline-end: 14px; color: #7fe0aa; font-size: .82rem; font-weight: 700; }

/* ---------- Catégorie ---------- */
.backlink { display: inline-block; margin-bottom: 16px; color: var(--muted); font-weight: 600; }
.pagehead { margin-bottom: 24px; }
.pagehead h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.pagehead__icon { font-size: 2rem; }
.pagehead__desc { color: var(--muted); max-width: 720px; }
.ngrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 480px) { .ngrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.ncard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ncard.is-chosen { border-color: rgba(22, 163, 90, .7); }
.ncard__media { aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.ncard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.ncard:hover .ncard__media img { transform: scale(1.04); }
.ncard__body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ncard__name { font-size: 1.02rem; margin: 0; }
.ncard__name a { color: var(--text); }
.ncard__work { color: var(--muted); font-size: .88rem; margin: 0; }
.ncard .btn { margin-top: auto; width: 100%; white-space: nowrap; padding-inline: 10px; font-size: .95rem; }

/* ---------- Fiche artiste ---------- */
.artist__grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 380px) 1fr; align-items: start; }
@media (max-width: 760px) { .artist__grid { grid-template-columns: 1fr; } }
.artist__photo { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); aspect-ratio: 1; background: var(--surface-2); }
.artist__photo img { width: 100%; height: 100%; object-fit: cover; }
.artist__name { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-top: 12px; }
.artist__role { color: var(--muted); }
.artist__work { color: var(--gold-3); font-style: italic; }
.artist__count { font-weight: 800; color: var(--gold); }
.artist__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 16px 20px; }
.artist__actions .notice { flex-basis: 100%; margin: 0; }
.media { margin-block: 16px; }
.media__title { font-size: 1.05rem; color: var(--gold); }
.media audio { width: 100%; }
.media--video { margin-top: 32px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.socials { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); }
.socials a { font-weight: 700; }
.bio { margin-top: 32px; max-width: 760px; }
.bio h2 { color: var(--gold); font-size: 1.2rem; }

/* ---------- Résultats ---------- */
.results { margin-bottom: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.results__title { font-size: 1.25rem; color: var(--gold); }
.rlist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.rlist__item { display: grid; grid-template-columns: 32px 48px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--bg-2); }
.rlist__item.is-first { border: 1px solid var(--line-strong); background: linear-gradient(90deg, rgba(232, 184, 74, .1), var(--bg-2)); }
html[dir="rtl"] .rlist__item.is-first { background: linear-gradient(270deg, rgba(232, 184, 74, .1), var(--bg-2)); }
.rlist__rank { font-weight: 900; color: var(--gold); text-align: center; font-size: 1.1rem; }
.rlist__item img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.rlist__body { min-width: 0; }
.rlist__name { font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.rlist__detail { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.rlist__value { text-align: end; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.rlist__value small { color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
html[dir="rtl"] .bar span { background: linear-gradient(270deg, var(--gold-2), var(--gold)); margin-inline-start: 0; }

/* ---------- Informations ---------- */
.infogrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.infocard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.infocard h2 { font-size: 1.08rem; color: var(--gold); }
.infocard p { margin: 0; color: var(--text); }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 32px; background: var(--bg-2); }
.footer__in { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.footer__in img { width: 120px; opacity: .9; margin-bottom: 8px; }
.footer__powered { font-weight: 700; margin: 0; }
.footer__links { margin: 0; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.footer__links > *:not([hidden]) ~ *:not([hidden])::before { content: "·"; display: inline-block; margin: 0 .5em; color: var(--muted); text-decoration: none; }
.footer__copy { color: var(--muted); font-size: .85rem; margin: 0; }

/* ---------- Modales ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(3, 6, 5, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
.modal__box {
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 30px 80px -20px #000;
  padding: 24px; position: relative; animation: rise .22s ease;
}
@media (max-width: 520px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal__box { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
.modal__close {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer;
}
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__icon { font-size: 2.6rem; text-align: center; margin-bottom: 4px; }
.modal__title { font-size: 1.35rem; text-align: center; padding-inline: 32px; }
.modal__text { color: var(--muted); text-align: center; }
.modal__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.modal--error .modal__title { color: var(--danger); }
.modal--success .modal__title { color: #7fe0aa; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.choice { text-align: center; padding: 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 12px; }
.choice img { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.choice__name { font-size: 1.3rem; font-weight: 900; color: var(--gold-3); margin: 0; }
.choice__cat { color: var(--muted); margin: 4px 0 0; }
.receipt-label { text-align: center; margin: 0 0 4px; }
.receipt { text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--gold); direction: ltr; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field legend { font-weight: 700; font-size: .95rem; }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1.1rem;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 184, 74, .25); }
.input--code { text-align: center; letter-spacing: .5em; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; padding-inline-start: calc(14px + .5em); }
.phone { display: flex; direction: ltr; }
.phone__prefix { display: grid; place-items: center; padding-inline: 14px; border: 1px solid var(--line-strong); border-inline-end: 0; border-radius: 12px 0 0 12px; background: var(--surface-2); font-weight: 800; color: var(--gold); }
.phone .input { border-radius: 0 12px 12px 0; letter-spacing: .08em; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; }
.segmented legend { margin-bottom: 6px; font-weight: 700; font-size: .95rem; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px;
  border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-weight: 700; background: var(--bg);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: var(--gold-3); text-decoration: underline; text-underline-offset: 4px; }
.segmented label:has(input:checked) { background: var(--gold); border-color: var(--gold); color: #1d1405; }
.segmented label:has(input:checked) span { color: #1d1405; text-decoration: none; }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--gold-3); outline-offset: 2px; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.4em; margin: 0 0 8px; text-align: center; }
.hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-turnstile { display: flex; justify-content: center; min-height: 70px; margin-bottom: 12px; }
.captcha-q { text-align: center; font-size: 1.8rem; font-weight: 900; color: var(--gold-3); direction: ltr; margin-bottom: 12px; }
.small-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .92rem; }
.small-actions .linkbtn[disabled] { color: var(--muted); cursor: default; }

.share { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.share a, .share button { min-height: 46px; }
.share .s-wa { background: #128c4a; border-color: #128c4a; color: #fff; }
.share .s-fb { background: #1f4fa3; border-color: #1f4fa3; color: #fff; }
.share .s-tt { background: #111; border-color: #444; color: #fff; }

.spinner { width: 40px; height: 40px; margin: 12px auto; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 60; background: var(--gold); color: #1d1405; font-weight: 800;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}
