* {
    box-sizing: border-box;
}

body{
    font-family:'Poppins',sans-serif;
    margin:0;
    padding:0;
    background:#f8f9fb;
}

html, body{
    overflow-x:hidden;
}

/* ==========================
   HEADER
========================== */

.page-header{
    padding:120px 20px 40px;
    text-align:center;
}

.page-header h1{
    font-size:2.5rem;
    font-weight:700;
}

.page-header p{
    opacity:0.7;
    margin-top:10px;
}

/* ==========================
   GRID CANDIDATS
========================== */

.candidates-grid{
    max-width:1200px;
    margin:auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:25px;
    padding:40px 20px;
}

/* ==========================
   CARD
========================== */

.candidate-card{
    background:white;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
    transition:0.3s ease;
}

.candidate-card:hover{
    transform:translateY(-6px);
}

.candidate-card img{
    width:100%;
    height:260px;
    object-fit:cover;
}

/* ==========================
   INFO
========================== */

.candidate-info{
    padding:15px;
    text-align:center;
}

.candidate-info h3{
    font-size:1.1rem;
    margin-bottom:5px;
}

.candidate-info p{
    font-size:0.9rem;
    opacity:0.7;
}

/* ==========================
   CATEGORIES
========================== */

.categories-section{
    padding:20px 20px 80px;
}

.category-block{
    background:rgb(0, 0, 0);
    border-radius:20px;
    padding:30px;
    margin-bottom:40px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
    color :white;
    width:100%;
    max-width:100%;
    overflow:hidden; /* empêche dépassement */


    margin:0 auto 40px auto;
    box-sizing:border-box;
}

.category-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:25px;
    flex-wrap:wrap;
    gap:15px;
}

.category-title{
    font-size:1.8rem;
    font-weight:700;
    color:#C8A45D;
}

.category-description{
    color:#777;
    margin-top:5px;
}

.category-candidates{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    justify-content:center;
    gap:22px;

    width:100%;
    max-width:100%;
    min-width: 0;
}

.candidate-card {
    width:100%;
    max-width:100%;
    overflow:hidden;
    color:black;
}

.candidate-card img{
    width:100%;
    display:block;
    max-width: 100%;
    height: 240px;
    object-fit: cover;
}

.categories-section,
.container{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
}

/* ==========================
   LOADER
========================== */

.loader-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(255,255,255,0.95);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:99999;
}

.loader-box{
    text-align:center;
}

.spinner{
    width:60px;
    height:60px;
    border:5px solid #eee;
    border-top:5px solid #C8A45D;
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin:auto;
}

.loader-box p{
    margin-top:15px;
    font-weight:600;
    color:#333;
}

@keyframes spin{
    from{
        transform:rotate(0deg);
    }
    to{
        transform:rotate(360deg);
    }
}

/* ==========================
   TOAST NOTIFICATION
========================== */

.toast{
    position:fixed;
    top:30px;
    right:30px;
    background:#111827;
    color:white;
    padding:15px 20px;
    border-radius:10px;
    box-shadow:0 10px 30px rgba(0,0,0,.25);
    z-index:999999;
    opacity:0;
    visibility:hidden;
    transform:translateY(-20px);
    transition:.3s;
    max-width:350px;
}

.toast.show{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}

.toast.success{
    border-left:5px solid #22c55e;
}

.toast.error{
    border-left:5px solid #ef4444;
}

.toast.warning{
    border-left:5px solid #f59e0b;
}

@media(max-width:768px){

    .toast{
        right:15px;
        left:15px;
        max-width:none;
    }

}

/* ==========================
   BUTTON
========================== */

.vote-btn-card{
    display:inline-block;
    margin-top:12px;
    padding:10px 18px;
    background:#C8A45D;
    color:white;
    border-radius:25px;
    cursor:pointer;
    text-decoration:none;
    font-weight:600;
    transition:0.3s;
}

.vote-btn-card:hover{
    background:#A67C3D;
    transform:scale(1.05);
}

/* ==========================
   MODAL (DESKTOP)
========================== */

.modal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.6);
    justify-content:center;
    align-items:center;
    padding:20px;
    z-index:999;
}

.modal-content{
    background:white;
    padding:25px;
    border-radius:12px;
    width:100%;
    max-width:420px;
    text-align:center;
    box-shadow:0 10px 30px rgba(0,0,0,0.2);
}

.modal-content input{
    width:100%;
    padding:12px;
    margin:12px 0;
    border:1px solid #ddd;
    border-radius:8px;
    outline:none;
}

.modal-content input:focus{
    border-color:#C8A45D;
}

.modal-content button{
    width:100%;
    padding:12px;
    background:#C8A45D;
    color:white;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-weight:600;
    transition:0.3s;
}

.modal-content button:hover{
    background:#A67C3D;
}

/* ==========================
   RESPONSIVE TABLET
========================== */

@media (max-width:992px){

    .page-header h1{
        font-size:2rem;
    }

    .candidate-card img{
        height:240px;
    }
}

/* ==========================
   RESPONSIVE MOBILE
========================== */

@media (max-width:768px){

    .page-header{
        padding:100px 15px 30px;
    }

    .page-header h1{
        font-size:1.8rem;
    }

    .candidates-grid{
        grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
        gap:18px;
        padding:20px 15px;
    }

    .candidate-card img{
        height:220px;
    }

    .modal-content{
        padding:20px;
        border-radius:10px;
    }
}

/* ==========================
   PETITS TELEPHONES
========================== */

@media (max-width:480px){

    .page-header h1{
        font-size:1.5rem;
    }

    .page-header p{
        font-size:0.9rem;
    }

    .candidate-card img{
        height:200px;
    }

    .vote-btn-card{
        padding:8px 14px;
        font-size:0.9rem;
    }

    .modal-content{
        padding:18px;
    }

    .modal-content button{
        padding:10px;
    }
}


/* ==========================================
   RECHERCHE PROFESSIONNELLE DES CANDIDATS
========================================== */

/* ==========================================
   RECHERCHE DES CANDIDATS — CORRECTION
========================================== */

.candidate-search-tools {
    position: relative;
    top: auto;
    z-index: auto;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    padding: 28px;
    margin: 0 0 35px;

    background: #F8F9FB;
    border: 1px solid rgba(200, 164, 93, 0.2);
    border-radius: 20px;

    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);

    /* Empêche le contenu de déborder */
    box-sizing: border-box;
}

.candidate-search-heading {
    text-align: center;
    margin-bottom: 18px;
}

.search-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #A67C3D;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;

    margin-bottom: 8px;
}

.candidate-search-heading h2 {
    color: #172033;
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    font-weight: 700;
    margin-bottom: 7px;
}

.candidate-search-heading p {
    color: #64748B;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Barre de recherche */

.candidate-search-bar {
    width: 100%;
    max-width: 760px;
    min-height: 60px;

    display: flex;
    align-items: center;
    gap: 12px;

    margin: 0 auto;

    padding: 0 17px;

    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;

    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.candidate-search-bar:focus-within {
    border-color: #C8A45D;
    box-shadow: 0 0 0 4px rgba(200, 164, 93, 0.13);
}

.candidate-search-bar .search-icon {
    flex-shrink: 0;
    color: #A67C3D;
    font-size: 1.1rem;
}

.candidate-search-bar input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 58px;

    padding: 0;
    margin: 0;

    border: none;
    outline: none;
    box-shadow: none;

    background: transparent;
    color: #172033;

    font-family: inherit;
    font-size: 0.95rem;
}

.candidate-search-bar input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.candidate-search-bar input::placeholder {
    color: #94A3B8;
}

.candidate-search-bar input::-webkit-search-cancel-button {
    display: none;
}

/* Bouton effacer */

.search-clear {
    width: 36px;
    height: 36px;
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    color: #64748B;
    background: #F1F5F9;
    border: none;
    border-radius: 50%;

    cursor: pointer;
    transition: 0.2s ease;
}

.search-clear:hover {
    background: #E2E8F0;
    color: #172033;
}

.search-clear[hidden] {
    display: none !important;
}

/* Nombre de résultats */

.search-results-info {
    min-height: 20px;
    margin-top: 12px;

    text-align: center;
    color: #64748B;

    font-size: 0.85rem;
}

/* Aucun résultat */

.no-search-results {
    max-width: 650px;
    margin: 20px auto 40px;
    padding: 40px 24px;

    text-align: center;

    background: #FFFFFF;
    border: 1px solid #E8ECF2;
    border-radius: 20px;

    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.no-search-results[hidden] {
    display: none !important;
}

.no-results-icon {
    width: 68px;
    height: 68px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    background: #F8F1E4;
    color: #A67C3D;

    border-radius: 50%;
    font-size: 1.6rem;
}

.no-search-results h3 {
    color: #172033;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.no-search-results p {
    color: #64748B;
    line-height: 1.7;
    margin-bottom: 20px;
}

.no-search-results button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: auto;
    max-width: 100%;

    padding: 12px 18px;

    border: none;
    border-radius: 10px;

    background: #C8A45D;
    color: #FFFFFF;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;
    transition: background 0.2s ease;
}

.no-search-results button:hover {
    background: #A67C3D;
}

/* Masquer les éléments filtrés */

.candidate-card[hidden],
.category-block[hidden] {
    display: none !important;
}

/* Responsive tablette */

@media (max-width: 768px) {

    .categories-section {
        padding: 25px 15px 60px;
    }

    .candidate-search-tools {
        position: relative;
        top: auto;
        padding: 20px 15px;
        margin-bottom: 25px;
        border-radius: 15px;
    }

    .candidate-search-heading {
        margin-bottom: 14px;
    }

    .candidate-search-heading p {
        font-size: 0.85rem;
    }

    .candidate-search-bar {
        min-height: 54px;
        padding: 0 12px;
        gap: 10px;
        border-radius: 12px;
    }

    .candidate-search-bar input {
        height: 52px;
        font-size: 0.9rem;
    }

    .search-results-info {
        font-size: 0.8rem;
    }

    .no-search-results {
        padding: 30px 18px;
    }
}

/* Responsive petits téléphones */

@media (max-width: 480px) {

    .categories-section {
        padding: 20px 12px 45px;
    }

    .candidate-search-tools {
        position: relative;
        top: auto;

        width: 100%;
        padding: 16px 12px;
        margin-bottom: 20px;

        border-radius: 13px;
    }

    .candidate-search-heading h2 {
        font-size: 1.15rem;
    }

    .candidate-search-heading p {
        font-size: 0.82rem;
    }

    .candidate-search-bar {
        gap: 8px;
        padding: 0 10px;
    }

    .candidate-search-bar input {
        font-size: 0.85rem;
    }

    .search-clear {
        width: 32px;
        height: 32px;
    }

    .no-search-results h3 {
        font-size: 1.05rem;
    }

    .no-search-results button {
        width: 100%;
    }
}

/* ==========================================
   INTÉGRATION WORDPRESS — ABDHOUL EVENT
========================================== */
.ae-vote-modal-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:18px}
.modal-content .ae-cancel-vote{background:#303846;color:#fff}
.modal-content .ae-cancel-vote:hover{background:#1f2937}
.ae-vote-modal-note{font-size:.82rem;line-height:1.5;color:#667085;margin-top:12px}
.candidate-card [hidden],[hidden]{display:none!important}
.ae-public-toast{position:fixed;right:20px;bottom:20px;z-index:100000;max-width:min(420px,calc(100vw - 40px));padding:14px 18px;background:#111827;color:#fff;border-left:4px solid #C8A45D;border-radius:10px;box-shadow:0 12px 36px rgba(0,0,0,.2);opacity:0;transform:translateY(10px);pointer-events:none;transition:opacity .2s ease,transform .2s ease}
.ae-public-toast.show{opacity:1;transform:translateY(0)}
.ae-public-toast.error{border-color:#ef4444}.ae-public-toast.success{border-color:#22c55e}.ae-public-toast.warning{border-color:#f59e0b}
.ae-standalone-page{margin:0;padding:0}
.newsletter-message{margin-top:12px;font-size:.9rem}
.vote-btn-card{border:0;cursor:pointer;font-family:inherit}
.modal{display:none}
.modal[aria-hidden="false"]{display:flex}
@media(max-width:480px){.ae-vote-modal-actions{flex-direction:column}.ae-vote-modal-actions button{width:100%}}
