/* ============================================================
   FRNIX Votes Manager — front.css
   Anti-Elementor + charte FRNIX
   ============================================================ */

/* ---- Reset anti-Elementor ---- */
[class*="frnix-vote"] a,
.elementor [class*="frnix-vote"] a,
.elementor-widget [class*="frnix-vote"] a {
    text-decoration: none !important;
    color: #0099FF !important;
}

/* ============================================================
   WRAP PRINCIPAL
   ============================================================ */
.frnix-vote-wrap {
    max-width: 960px !important;
    margin: 0 auto;
    font-family: Lato, Arial, sans-serif;
    color: #1E3F70;
    overflow: visible;
}

/* ============================================================
   HEADER
   ============================================================ */
.frnix-vote-header {
    margin-bottom: 32px;
}
.frnix-vote-header h2 {
    font-family: Cabin, Arial, sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #1E3F70;
    margin-bottom: 12px;
}
.frnix-vote-intro {
    background: #f8fafc;
    border-left: 4px solid #0099FF;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    color: #39383F;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================
   NOTICES
   ============================================================ */
.frnix-notice {
    padding: 12px 16px;
    border-left: 3px solid #CCCCCC;
    margin-bottom: 20px;
    font-size: 14px;
    background: #fff;
    border-radius: 0 !important;
}
.frnix-notice.success { border-left-color: #64CA8C; color: #276749; }
.frnix-notice.warning { border-left-color: #f59e0b; color: #92400e; }
.frnix-notice.error   { border-left-color: #FF3333; color: #991b1b; }

/* ============================================================
   SECTIONS DU BULLETIN
   ============================================================ */
.frnix-vote-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.frnix-vote-section-title {
    font-family: Cabin, Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1E3F70;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0099FF;
}
.frnix-vote-section-title .frnix-optional {
    font-size: 12px;
    font-weight: 400;
    color: #9C9C9C;
    margin-left: 6px;
}

/* ============================================================
   QUESTIONS — POUR / CONTRE / ABSTENTION
   ============================================================ */
.frnix-vote-question {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}
.frnix-vote-question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.frnix-question-label {
    font-weight: 600;
    color: #1E3F70;
    font-size: 15px;
    margin-bottom: 12px;
}

.frnix-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.frnix-radio-option {
    cursor: pointer;
    flex: 1;
    min-width: 120px;
}
.frnix-radio-option input[type="radio"] {
    display: none;
}
.frnix-radio-label {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    color: #39383F;
    background: #f8fafc;
}
.frnix-radio-option input:checked + .frnix-radio-label {
    border-color: #0099FF;
    background: #EBF5FF;
    color: #1E3F70;
}
.frnix-pour     .frnix-radio-label:hover,
.frnix-pour     input:checked + .frnix-radio-label { border-color: #64CA8C; background: #f0fff4; color: #276749; }
.frnix-contre   .frnix-radio-label:hover,
.frnix-contre   input:checked + .frnix-radio-label { border-color: #FF3333; background: #fff5f5; color: #991b1b; }
.frnix-abstention .frnix-radio-label:hover { border-color: #CCCCCC; background: #f1f5f9; color: #64748b; }
.frnix-abstention input:checked + .frnix-radio-label { border-color: #64748B; background: #e2e8f0; color: #334155; font-weight: 700; }

/* ============================================================
   ÉLECTION — CANDIDATS
   ============================================================ */
.frnix-election-info {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}
.frnix-candidats-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 12px;
}
.frnix-candidat-card {
    flex: 0 0 280px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 16px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.15s ease;
    position: relative;
    box-shadow: none !important;
}
.frnix-candidat-card:hover { border-color: #0099FF; background: #EBF5FF; }
.frnix-candidat-cb { display: none; }
.frnix-candidat-name { font-weight: 600; color: #1E3F70; font-size: 14px; flex: 1; pointer-events: none; }
.frnix-candidat-check {
    opacity: 0;
    color: #fff;
    background: #0099FF;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: opacity 0.15s;
    flex-shrink: 0;
    pointer-events: none;
}
.frnix-candidat-check-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #CCCCCC;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: transparent;
    background: #fff;
    transition: all 0.15s ease;
    pointer-events: none;
}
.frnix-candidat-card.frnix-selected {
    border-color: #0099FF;
    background: #EBF5FF;
}
.frnix-candidat-card.frnix-selected .frnix-candidat-check { opacity: 1; }
.frnix-candidat-card.frnix-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.frnix-candidat-card.selected {
    border: none !important;
    background: transparent !important;
}
.frnix-candidat-card.selected .frnix-candidat-check-box {
    background: #0099FF !important;
    border-color: #0099FF !important;
    color: white !important;
}
.frnix-election-counter {
    font-size: 13px;
    color: #0099FF;
    font-weight: 600;
    text-align: right;
}

/* v1.2.3 — Fiches candidats enrichies (photo/initiales + fonction + orga + bio inline) */
.frnix-candidat-card-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 20px !important;
    width: 100% !important;
    padding: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    margin-bottom: 8px !important;
}
.frnix-candidat-card-wrap:has(.frnix-candidat-card.selected) {
    border: 2px solid #0099FF !important;
    background: #EBF5FF !important;
}
.frnix-candidat-photo {
    width: 100px !important;
    height: 100px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    pointer-events: none;
}
.frnix-candidat-initiales {
    width: 100px !important;
    height: 100px !important;
    border-radius: 8px !important;
    background: #1E3F70;
    color: #fff;
    font-family: Cabin, Arial, sans-serif;
    font-size: 32px !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: none;
    line-height: 1;
}
.frnix-candidat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    pointer-events: none;
}
.frnix-candidat-fonction {
    font-style: italic;
    color: #64748b;
    font-size: 12px;
    pointer-events: none;
}
.frnix-candidat-orga {
    color: #9C9C9C;
    font-size: 11px;
    pointer-events: none;
}
.frnix-candidat-bio-inline {
    flex: 1 !important;
    font-size: 13px !important;
    color: #39383F !important;
    line-height: 1.6 !important;
    padding-top: 4px !important;
}
.frnix-candidat-bio-inline p:first-child { margin-top: 0; }
.frnix-candidat-bio-inline p:last-child { margin-bottom: 0; }

/* ============================================================
   COMMENTAIRE
   ============================================================ */
.frnix-comment-info {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}
#frnix-commentaire {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-family: Lato, Arial, sans-serif;
    color: #1E3F70;
    resize: vertical;
    transition: border-color 0.15s;
}
#frnix-commentaire:focus { border-color: #0099FF; outline: none; }
.frnix-char-counter { font-size: 12px; color: #9C9C9C; text-align: right; margin-top: 4px; }

/* ============================================================
   FOOTER — VALIDER
   ============================================================ */
.frnix-vote-footer { text-align: center; margin-top: 24px; }
.frnix-vote-warning {
    font-size: 12px;
    color: #9C9C9C;
    margin-top: 10px;
}
.frnix-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}
.frnix-btn-lg    { padding: 14px 40px; font-size: 16px; }
.frnix-btn-primary {
    background: #0099FF;
    color: #fff !important;
    border-color: #0099FF;
}
.frnix-btn-primary:hover {
    background: #0077CC;
    border-color: #0077CC;
    box-shadow: 0 4px 12px rgba(0,153,255,0.3);
}
.frnix-btn-outline {
    background: #fff;
    color: #1E3F70 !important;
    border-color: #e2e8f0;
}
.frnix-btn-outline:hover { border-color: #0099FF; color: #0099FF !important; }

/* ============================================================
   MODALE DE CONFIRMATION
   ============================================================ */
.frnix-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.frnix-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.frnix-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.frnix-modal-header h3 { margin: 0; color: #1E3F70; font-family: Cabin, Arial, sans-serif; }
.frnix-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.frnix-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Récap dans la modale */
.frnix-confirm-section { margin-bottom: 16px; }
.frnix-confirm-section h4 { font-size: 13px; color: #9C9C9C; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.frnix-confirm-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.frnix-confirm-q   { color: #39383F; }
.frnix-confirm-rep { font-weight: 700; }
.frnix-rep-pour       { color: #276749; }
.frnix-rep-contre     { color: #991b1b; }
.frnix-rep-abstention { color: #9C9C9C; }

/* ============================================================
   RÉCAPITULATIF POST-VOTE
   ============================================================ */
.frnix-vote-done .frnix-vote-header { margin-bottom: 16px; }

.frnix-vote-recap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.frnix-vote-recap h3 { font-family: Cabin; color: #1E3F70; margin-top: 0; }
.frnix-vote-recap h4 { font-size: 13px; color: #9C9C9C; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }

.frnix-recap-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.frnix-recap-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.frnix-recap-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 14px;
}
.frnix-recap-question { color: #39383F; }
.frnix-recap-reponse  { font-weight: 700; }
.frnix-rep-pour       { color: #276749; }
.frnix-rep-contre     { color: #991b1b; }
.frnix-rep-abstention { color: #9C9C9C; }

.frnix-recap-candidats { list-style: none; padding: 0; margin: 0; }
.frnix-recap-candidats li { padding: 6px 0; color: #276749; font-weight: 600; font-size: 14px; }
.frnix-recap-empty    { color: #9C9C9C; font-size: 14px; }
.frnix-recap-comment  { background: #f8fafc; border-left: 3px solid #0099FF; padding: 8px 14px; color: #39383F; font-size: 14px; }

/* CTA fiche */
.frnix-vote-profile-cta {
    text-align: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}
.frnix-vote-profile-cta p { color: #1E3F70; margin-bottom: 14px; }

/* ============================================================
   DESCRIPTION DE RÉSOLUTION (v1.1.0)
   ============================================================ */
.frnix-question-description {
    background: #f8fafc;
    border-left: 3px solid #0099FF;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #39383F;
    line-height: 1.6;
    border-radius: 0 6px 6px 0;
}

/* Anti-Elementor — boutons FRNIX */
.elementor [class*="frnix-"] button,
.elementor-widget [class*="frnix-"] button,
[class*="frnix-"] button {
    color: #1E3F70 !important;
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    border-radius: 4px !important;
    font-family: inherit !important;
}

/* Bio readmore + modale (v1.4.5) */
.frnix-bio-readmore {
    color: #0099FF;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 2px;
}
.frnix-bio-readmore:hover { text-decoration: underline; }

/* Section intro + num résolution (v1.5.2) */
.frnix-section-intro {
    overflow: hidden; /* contient les floats hérités de TinyMCE */
    margin-bottom: 16px;
    color: #39383F;
    font-size: 14px;
    line-height: 1.6;
}
.frnix-resolution-num {
    color: #0099FF;
    font-weight: 600;
    font-size: 13px;
    margin-right: 6px;
}

/* ============================================================
   NOTICE REDIRECTION POST-VOTE (v1.9.11)
   ============================================================ */
.frnix-vote-redirect-notice,
[class*="frnix-vote-redirect-notice"],
.elementor [class*="frnix-vote-redirect-notice"],
.elementor-widget [class*="frnix-vote-redirect-notice"] {
    background: #fff;
    border-left: 3px solid #64CA8C;
    border-radius: 0 !important;
    padding: 20px;
    font-family: 'LATO', Arial, sans-serif;
    font-size: 1.1rem;
    color: #1E3F70;
    margin: 20px 0;
}
