/* Fuente moderna */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* ======== AJUSTES DE PÁGINA ======== */
body {
    font-family: 'Poppins', sans-serif;
    background: url("/prueba/fondo.svg") center center / cover no-repeat fixed;
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center; /* centramos el contenedor */
    padding: 40px 20px;
    color: #333;
}

/* ======== CONTENEDORES ======== */
#auth-container, 
#voting-container {
    background: rgba(255, 255, 255, 0.85);
    padding: 50px 60px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 1200px;
    width: 100%;
    backdrop-filter: blur(8px);
}

/* ======== TITULOS ======== */
.page-title,
#voting-container h1 {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    color: #002855;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

#voting-container p {
    color: #555;
    font-size: 1.1rem;
    max-width: 750px;
    margin: 0 auto 40px;
}

/* ======== BOTÓN LOGIN ======== */
#google-login-btn {
    background-color: #002855;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#google-login-btn img {
    width: 22px;
    height: 22px;
}

#google-login-btn:hover {
    background-color: #004aad;
    transform: scale(1.05);
}

/* ======== GRID DE CANDIDATAS ======== */
#candidates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
    margin-bottom: 40px;
    width: 100%;
}

/* FORZAR 3 ARRIBA Y 2 ABAJO (para 5 candidatas) */
@media (min-width: 900px) {
    #candidates-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ======== TARJETAS ======== */
.candidate-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 320px;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ======== FOTOS RECTANGULARES AJUSTADAS ======== */
.candidate-photo {
    width: 100%;
    height: 400px; /* Altura reducida */
    object-fit: cover;
    object-position: center top; /* Centra el rostro */
    border-bottom: 4px solid #002855;
}

/* ======== TARJETAS ======== */
.candidate-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 300px; /* Tamaño más compacto */
}
.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ======== BOTÓN VOTAR ======== */
.vote-btn {
    background-color: #002855;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px auto 20px;
    width: fit-content;
}

.vote-btn:hover {
    background-color: #004aad;
    transform: scale(1.05);
}

/* ======== BOTÓN CERRAR SESIÓN ======== */
#logout-btn {
    background-color: #777;
    color: white;
    border: none;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-btn:hover {
    background-color: #555;
}
/* ======== RESPONSIVE ======== */

/* Tablets: 2 columnas, más aire y tamaños equilibrados */
@media (max-width: 900px) {
    body {
        background-attachment: scroll; /* Evita el recorte en móviles */
        background-position: center top;
        background-size: cover;
    }
    #candidates-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .candidate-card {
        max-width: 260px;
    }

    .candidate-photo {
        height: 360px;
    }
}

/* Celulares: 1 columna centrada, todo bien ajustado */
@media (max-width: 600px) {
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.4); /* capa suave para legibilidad */
        backdrop-filter: blur(2px);
        z-index: -1;
    }

    #auth-container,
    #voting-container {
        padding: 30px 25px;
        border-radius: 15px;
    }

    #candidates-list {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .candidate-card {
        max-width: 280px;
    }

    .candidate-photo {
        height: 380px;
    }

    .page-title,
    #voting-container h1 {
        font-size: 1.8rem;
    }

    #voting-container p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .vote-btn {
        padding: 8px 20px;
    }

    #logout-btn {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
        display: block;
    }
}