/* ================================================================
   CANDIDATURES : bouton permanent + page "Candidater"
   (chargé après style.css et lore.css)
   ================================================================ */

/* ——— Bouton permanent "Candidater" ——— */
.cand-btn { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 9px 18px; border-radius: 999px; background: var(--grad); color: var(--on-or); font-weight: 800; font-size: .92rem; line-height: 1.3; white-space: nowrap; box-shadow: 0 4px 16px rgba(255,79,154,.35); transition: transform .15s, box-shadow .15s; }
.cand-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,79,154,.5); }
.cand-btn svg { width: 1.25em; height: 1.25em; }
.cand-btn[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; }
/* L'interrupteur de thème reste collé à droite, avec ou sans bouton Candidater, avec ou sans onglets de faction */
.bar .theme { margin-left: auto; }
.cand-btn:not([hidden]) + .theme { margin-left: 0; }
@media (min-width: 1091px) { .tabs:not([hidden]) ~ .theme { margin-left: 0; } }

/* Bouton flottant sur téléphone (la barre du haut est trop étroite) */
.cand-fab { display: none; position: fixed; z-index: 30; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); align-items: center; gap: 8px; padding: 11px 17px; border-radius: 999px; background: var(--grad); color: var(--on-or); font-weight: 800; font-size: .88rem; box-shadow: 0 6px 22px rgba(255,79,154,.5), 0 2px 8px rgba(0,0,0,.4); }
.cand-fab svg { width: 1.25em; height: 1.25em; }
.cand-fab[aria-current="page"] { display: none !important; }

/* Barre du haut : compacte pour tenir sur une ligne (Lore | Mentalité | Règlement, onglets de faction, Candidater, thème) */
@media (min-width: 721px) {
  .bar-in { column-gap: 14px; }
  .switch a { padding: 8px 10px; gap: 6px; }
  .cand-btn { padding: 9px 14px; gap: 6px; }
  .tab { padding: 8px 14px; }
}
@media (min-width: 1091px) { .tabs:not([hidden]) ~ .cand-btn { margin-left: 0; } }
/* Sous 1090 px, les onglets de faction passent sur une 2e ligne */
@media (max-width: 1090px) {
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .tabs .tab { flex: 1; text-align: center; }
}
/* Sous 1090 px : le logo seul (sans le texte "Vision Illégal"), pour laisser la place au bouton Candidater */
@media (min-width: 721px) and (max-width: 1090px) { .brand-t { display: none; } }
/* Sous 840 px : le bouton Candidater ne garde que son icône (le nom accessible reste dans aria-label) */
@media (min-width: 721px) and (max-width: 840px) {
  .cand-btn span { display: none; }
  .cand-btn { padding: 10px 12px; }
}
@media (max-width: 720px) {
  .cand-btn { display: none; }
  .cand-fab { display: inline-flex; }
  body { padding-bottom: 80px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* Bouton de l'accueil (à la place de l'ancien "Reprendre") */
.hero-cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 13px 26px; border-radius: 999px; background: #fff; color: #c2185b; font-weight: 800; font-size: 1rem; box-shadow: 0 4px 16px rgba(120,20,70,.28); transition: transform .15s, background-color .15s; }
.hero-cta:hover { background: #fff0f6; transform: translateY(-1px); }
.hero-cta svg { width: 1.25em; height: 1.25em; }

/* ——— Page Candidater : grille simple ——— */
.cand { padding: 52px 20px 64px; }
.c-loading { text-align: center; color: var(--muted); }
.c-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 1000px; margin: 0 auto; }
.c-legend { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }

.tile-t { flex: 0 0 calc((100% - 56px) / 5); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 10px 18px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--ink); text-align: center; transition: transform .18s, border-color .18s, box-shadow .18s; }
.tile-t strong { margin-top: 12px; font-weight: 800; font-size: .95rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .02em; }
.tile-t small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.tile-t:hover:not(:disabled), .tile-t:focus-visible:not(:disabled) { transform: translateY(-3px); border-color: var(--or1); box-shadow: 0 0 0 1px var(--or1), 0 10px 30px rgba(255,79,154,.28); }
.tile-t:disabled { cursor: not-allowed; opacity: .6; }
.tile-t.is-full small { color: var(--ban-fg); }

.ring { position: relative; display: grid; place-items: center; width: 96px; height: 96px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--or1); stroke-linecap: round; }
.is-full .ring-fg { stroke: var(--ban-fg); }
.ring b { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--ink); }
.ring b i { font-style: normal; font-weight: 700; font-size: 1rem; color: var(--muted); margin-left: 1px; }

/* ——— Fenêtre du formulaire ——— */
dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); color: var(--text); overflow: hidden; }
dialog::backdrop { background: rgba(5,5,7,.78); backdrop-filter: blur(3px); }
.c-dlg-in { position: relative; max-height: calc(100dvh - 26px); padding: 30px 26px 26px; overflow-y: auto; }
.c-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.1rem; }
.c-close:hover { border-color: var(--or1); }
#c-dt { padding-right: 48px; font-weight: 800; font-size: 1.5rem; line-height: 1.2; }
.c-ds { margin: 4px 0 22px; color: var(--a-ink); font-weight: 700; font-size: .95rem; }

.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; margin: 0 0 8px; padding: 0; font-weight: 700; color: var(--ink); }
.field input[type="text"], .field input[type="url"] { width: 100%; height: 52px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: 1rem; }
.field input::placeholder { color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--ban-fg); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.err { margin: 6px 0 0; color: var(--ban-fg); font-weight: 600; font-size: .9rem; }
.err:empty { display: none; }
.radios { display: flex; flex-wrap: wrap; gap: 10px; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; }
.radio span { display: block; padding: 13px 22px; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--bg); color: var(--ink); font-weight: 700; cursor: pointer; }
.radio input:checked + span { background: var(--grad); border-color: transparent; color: var(--on-or); }
.radio input:focus-visible + span { outline: 3px solid var(--or1); outline-offset: 3px; }
.check { display: flex !important; gap: 12px; align-items: flex-start; margin: 0 !important; font-weight: 500 !important; color: var(--text) !important; line-height: 1.55; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--or1); }
.check a { color: var(--a-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.c-submit { width: 100%; height: 56px; border: 0; border-radius: 14px; background: var(--grad); color: var(--on-or); font-weight: 800; font-size: 1.05rem; box-shadow: 0 4px 16px rgba(255,79,154,.35); }
.c-submit:hover { filter: brightness(1.06); }
.c-submit:disabled { opacity: .6; cursor: progress; filter: none; }
.c-priv { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.c-banner { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--ban-fg); border-radius: 12px; background: var(--ban-bg); color: var(--ban-fg); font-weight: 600; }
.c-retry { margin-left: 8px; padding: 6px 14px; border: 2px solid var(--ban-fg); border-radius: 999px; background: transparent; color: var(--ban-fg); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.c-success { text-align: center; padding: 18px 0 4px; }
.c-check { display: inline-grid; place-items: center; width: 68px; height: 68px; margin-bottom: 14px; border-radius: 50%; background: var(--grad); color: var(--on-or); }
.c-check svg { width: 34px; height: 34px; stroke-width: 3; }
.c-success h2 { font-size: 1.6rem; font-weight: 800; }
.c-success h2:focus { outline: none; }
.c-success p { margin: 12px auto 22px; max-width: 26rem; }

@media (max-width: 900px) { .tile-t { flex-basis: calc((100% - 28px) / 3); } }
@media (max-width: 560px) {
  .cand { padding: 36px 14px 56px; }
  .tile-t { flex-basis: calc((100% - 14px) / 2); padding: 18px 8px 16px; }
  .ring { width: 84px; height: 84px; }
  .ring b { font-size: 1.3rem; }
  .c-dlg-in { padding: 26px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { .tile-t { transition: none; } .tile-t:hover:not(:disabled) { transform: none; } }
