/* Variables de Color y Tipografía */
:root {
    --color-bg: #e9e7de;
    --color-primary: #04295c;
    --font-titles: 'Times New Roman', Times, serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-family: var(--font-body);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header h1 {
    font-family: var(--font-titles);
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 5px;
    margin-bottom: 0;
}
header a {
    text-decoration: none;
    color: var(--color-primary);
}

header h2 {
    font-family: var(--font-titles);
    font-size: 1.5rem;
    font-style: italic;
    margin-top: 5px;
    font-weight: bold;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
    border: none;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    margin: 20px 0;
    transition: 0.3s;
}
.btn-secondary {
    background-color: var(--color-bg);
    color: var(--color-primary);
    border: none;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    margin: 20px 0;
    transition: 0.3s;
}
.btn-primary:hover { opacity: 0.9; }

/* Grid del Anuario */
.grid-anuario {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.fan-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fan-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background-color: #ccc; /* Placeholder color */
}

.fan-name {
    font-family: var(--font-titles);
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 41, 92, 0.9); /* Azul oscuro con opacidad */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--color-bg);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--color-primary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-header h3 {
    font-family: var(--font-titles);
    font-size: 2rem;
    letter-spacing: 3px;
    margin: 0;
}
.modal-header h4 {
    font-family: var(--font-titles);
    font-style: italic;
    margin: 0 0 20px 0;
}

/* Formulario */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #cfcaba; /* Un tono más oscuro que el fondo */
    box-sizing: border-box;
    font-family: var(--font-body);
}

.file-upload-box {
    background-color: #cfcaba;
    height: 150px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.file-upload-box input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-family: var(--font-body);
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}
/* Paginación del Anuario */
.paginacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Obliga al contenedor a estirarse */
    max-width: 1000px; /* Mantiene la misma alineación que la cuadrícula de fotos */
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box; /* Evita que el padding genere scroll horizontal */
}

.btn-paginacion {
    display: flex;
    align-items:center;
    text-decoration: none;
    color: var(--color-primary);
    font-family: var(--font-titles);
    font-size: 18px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn-paginacion:hover {
    opacity: 0.7;
}

.flecha-circulo {
    font-size: 24px;
    font-weight: normal;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.btn-paginacion.oculto {
    visibility: hidden; /* Mantiene la estructura para que el otro botón no se mueva al centro */
}
/* Espaciado del header (ya que le quitamos el padding al body) */
header {
    padding: 20px 20px 0 20px;
    text-align: center;
}

/* El main ocupará todo el espacio disponible */
main.grid-anuario {
    flex-grow: 1; 
    width: 100%;
    box-sizing: border-box;
}

/* Estilos del Footer */
footer {
    text-align: center;
    padding: 20px 20px;
    margin-top: auto; /* Empuja el footer estrictamente hacia el final */
}

footer img {
    max-width: 172px; /* Asegura que no sobrepase el tamaño que indicaste */
    height: auto;
}
/* Efecto de clic en las tarjetas del grid */
.fan-card {
    cursor: pointer;
    transition: transform 0.2s;
}
.fan-card:hover {
    transform: scale(1.05); /* Pequeño efecto de zoom al pasar el mouse */
}

/* Modal de visualización de foto con marco */
.modal-content-frame {
    position: relative;
    width: 90%;
    max-width: 500px; /* Tamaño máximo de la portada */
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close-frame {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.frame-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Mantiene la proporción cuadrada de tu portada */
    background-color: transparent;
}

.frame-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* El recuadro donde va la foto del fan superpuesta */
.user-photo-wrapper {
    position: absolute;
    /* Ajustes calculados para coincidir con el recuadro negro */
    top: 23%; 
    left: 29.5%;
    width: 41%;
    height: 54%;
    z-index: 2;
    overflow: hidden;
}

#modal-user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Texto del nombre sobre la portada */
.frame-name {
    position: absolute;
    bottom: 7%; /* Ajusta este valor si quieres subir o bajar el texto */
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 3;
    font-family: var(--font-titles);
    font-size: 1.8rem;
    color: var(--color-primary); /* Letra azul oscuro */
    margin: 0;
}
/* --- Contador (Countdown) --- */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.time-box {
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 10px;
    border-radius: 8px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-box span {
    font-family: var(--font-titles);
    font-size: 1.8rem;
    font-weight: bold;
}

.time-box small {
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Botón Pre-save --- */
.btn-presave {
    display: inline-block;
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 10px 30px;
    font-family: var(--font-body);
    font-weight: bold;
    text-decoration: none;
    border-radius: 20px;
    margin-bottom: 20px;
    transition: 0.3s;
}
.btn-presave:hover {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

/* --- Caja de Instrucciones --- */
.instrucciones-box {
    background-color: #cfcaba; /* Mismo color de fondo de tus inputs */
    max-width: 400px;
    margin: 0 auto 15px auto;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: left;
}

.instrucciones-box ul {
    margin: 0;
    padding-left: 20px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-primary);
}

.instrucciones-box li {
    margin-bottom: 5px;
}

/* --- Estilo del Checkbox --- */
.form-group-terms {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    text-align: left;
}
.form-group-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.form-group-terms label {
    font-size: 14px;
    cursor: pointer;
}
/* --- Página de Aviso de Privacidad --- */
.privacy-container {
    max-width: 800px; /* Evita que el texto se estire demasiado en monitores grandes */
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    flex-grow: 1; 
}

.privacy-content p {
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.6;
}

.contact-link {
    color: var(--color-primary);
    font-weight: bold;
    text-decoration: underline;
}

.btn-container {
    text-align: center;
    margin-top: 40px;
}
/* --- Footer (Frase Generaciones Adorando) --- */
footer p:first-child {
    font-family: var(--font-titles);
    font-size: 1rem;
    font-style: italic;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--color-primary);
}
.footer-legal {
    margin-bottom: 20px;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.footer-legal a {
    color: var(--color-primary);
    text-decoration: none;
    margin: 0 10px;
    transition: 0.3s;
}

.footer-legal a:hover {
    text-decoration: underline;
}

.footer-legal span {
    color: var(--color-primary);
    opacity: 0.5;
}

@media screen and (max-width: 768px) {
    .frame-name {
        font-size: 1.2rem;
    }
}