/* ========================================================================= */
/* VARIABLES Y RESET BÁSICO */
/* ========================================================================= */
:root {
    --primary-color: #d9230f; /* Color principal: Rojo/Naranja */
    --secondary-color: #ffffff; /* Color secundario: Blanco */
    --text-color: #333333;
    --light-gray: #f4f7f6; /* Fondo de página suave */
    --border-color: #dddddd; /* Borde sutil */
}

* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10pt;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 120px; /* Espacio para el footer fijo en escritorio */
}

/* ========================================================================= */
/* HEADER */
/* ========================================================================= */
.section-up {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 30px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.columnaimg {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--secondary-color);
}

/* AJUSTE: Aumentar el tamaño del texto de la versión */
#version_casilla {
    font-size: 1.2em; /* ¡Nuevo tamaño más grande! */
    font-weight: 500;
    opacity: 0.9;
    color: var(--secondary-color);
}

/* ========================================================================= */
/* CONTENEDOR PRINCIPAL Y FORMULARIO */
/* ========================================================================= */

.login-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: var(--light-gray);
}

.login-box {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 380px; /* Ancho en escritorio */
    border: none;
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-logo {
    max-width: 80px;
    height: auto;
    margin-bottom: 10px;
}

.login-header h2 {
    font-size: 1.5em;
    color: var(--text-color);
    margin-top: 10px;
}

/* Título del formulario */
.formtitulo {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    padding-left: 0;
}

/* Campo de entrada */
.login-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 1em;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(217, 35, 15, 0.3);
    outline: none;
}

/* Botón de Enviar */
.btn-primary-custom {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s, transform 0.1s;
    margin-bottom: 20px;
}

.btn-primary-custom:hover {
    background-color: #b81c0c;
    transform: translateY(-1px);
}

/* Enlaces */
.forgot-password-link {
    text-align: right;
    margin-bottom: 20px;
}

/* AJUSTE: Estilo para el enlace "¿Olvidó su contraseña?" (más grande y visual) */
.forgot-password-link a {
    color: var(--primary-color); /* Color rojo para destacar */
    text-decoration: none;
    font-size: 1.0em; /* Un poco más grande */
    font-weight: 600; /* Negrita */
    transition: color 0.3s;
}

.forgot-password-link a:hover {
    color: #b81c0c; /* Color más oscuro al pasar el ratón */
    text-decoration: underline;
}

/* Estilo para el enlace "¿Cómo crear una cuenta...?" */
.create-account-link a {
    color: #555;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.create-account-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.create-account-link {
    text-align: center;
    margin-top: 15px;
}

/* ========================================================================= */
/* FOOTER PROFESIONAL */
/* ========================================================================= */

.site-footer {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    background-color: var(--light-gray);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Franja de la marca con la imagen */
.footer-brand-strip {
    width: 100%;
    padding: 0;
    background-color: var(--secondary-color);
}

.footer-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Contenedor del texto (Contacto y Marco Legal) */
.footer-content {
    background-color: var(--secondary-color);
    padding: 15px 30px;
    font-size: 0.8em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid #eeeeee;
    color: var(--text-color);
}

.footer-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-content a:hover {
    color: #b81c0c;
    text-decoration: underline;
}

.contact-info {
    flex-basis: 40%;
    margin-left: 20px;
    font-size: 8pt;
}

.contact-info p {
    margin: 0;
}

.legal-info {
    flex-basis: 60%;
    padding-left: 20px;
    text-align: justify;
    font-size: 8pt;
}

.legal-info p {
    margin: 0;
}

/* ========================================================================= */
/* CLASES ANTIGUAS/MISCELÁNEAS */
/* ========================================================================= */

.flex-container {
    display: flex;
    flex-direction: row;
    width: 100%;
}
.flex-container > .flex-item {
    flex: 1;
}
.flex-container > .raw-item {
    width: auto;
    max-width: 60rem;
}
.flex-container > .raw-item2 {
    width: auto;
    max-width: 30rem;
}

hr {
    display: none;
}

.cuadro, .cuadritos {
    display: none;
}

/* ========================================================================= */
/* ESTILOS ESPECÍFICOS DEL MODAL DE REGISTRO (AJUSTES FINALES) */
/* ========================================================================= */

/* Fondo de la barra de título del modal en color primario (rojo) */
.ui-dialog .ui-dialog-titlebar {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important; /* Para asegurar que los botones de cerrar sean visibles */
    padding: 10px 15px; /* Ajuste el padding para centrar mejor el contenido de la barra */
    display: flex; /* Usar flexbox para alinear el título y los botones */
    align-items: center; /* Centrar verticalmente */
}

/* Título "Atención" de Mayor Tamaño y BLANCO */
.ui-dialog .ui-dialog-title {
    font-size: 1.5em; /* Aumentar el tamaño del título */
    font-weight: bold;
    color: var(--secondary-color) !important; /* Texto BLANCO para distinguirse del fondo rojo */
    flex-grow: 1; /* Permitir que el título ocupe el espacio restante */
    display: flex; /* Usar flexbox para el ícono y el texto */
    align-items: center;
}

/* Insertar ícono de Font Awesome antes del título */
.ui-dialog .ui-dialog-title::before {
    font-family: "Font Awesome 5 Free"; /* Asegúrate de que Font Awesome esté cargado */
    font-weight: 900; /* Para iconos solidos */
    content: "\f0a1"; /* Icono de campana/alerta de Font Awesome */
    color: white !important; /* Color blanco para el ícono */
    margin-right: 10px; /* Espacio entre el ícono y el texto */
    font-size: 1em; /* Tamaño del icono relativo al título */
}

/* Contenido de texto del modal más grande */
#modal-registro p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Estilo para el botón de registro */
.btn-manual-registro {
    display: inline-block;
    background-color: var(--primary-color);
    color: white !important; /* Letras del botón de registro en color blanco */
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.0em;
    font-weight: bold;
    text-decoration: none !important;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-manual-registro:hover {
    background-color: #b81c0c;
    transform: translateY(-1px);
}


/* ========================================================================= */
/* MEDIA QUERIES PARA PANTALLAS PEQUEÑAS (Responsividad) */
/* ========================================================================= */

@media screen and (max-width: 768px) {
    
    /* 1. Formulario de acceso: Ocupar todo el ancho */
    .login-wrapper {
        padding: 0; /* Elimina padding para que la caja ocupe el 100% */
    }
    .login-box {
        max-width: 100%; /* Permite que ocupe el ancho total */
        width: 100%;
        border-radius: 0; /* Bordes rectos para diseño móvil de ancho completo */
        box-shadow: none; /* Eliminar sombra en móviles */
        padding: 20px;
        min-height: calc(100vh - 100px); /* Ajuste de altura para que se vea el footer y header */
    }
    
    /* 2. Título "Sistema de Casilla Electrónica UGEL SAN IGNACIO" (Se mantiene) */
    .section-up {
        padding: 10px 15px;
    }
    /* Ocultar la versión del sistema */
    #version_casilla {
        display: none;
    }
    
    /* 3. Footer: Mostrar solo el texto específico */
    
    /* Ajuste del padding del body para el footer en móvil */
    body {
        padding-bottom: 70px; /* Menor padding para un footer más compacto */
    }
    
    .site-footer {
        /* Se mantiene fixed y 100% de ancho */
    }
    
    /* Ocultar la imagen corporativa */
    .footer-brand-strip {
        display: none;
    }
    
    /* Mostrar solo la información de contacto y ocultar el marco legal */
    .footer-content {
        flex-direction: column; /* Apilar elementos verticalmente */
        align-items: flex-start;
        padding: 10px 15px; /* Reducir padding horizontal */
        border-top: none;
        text-align: left;
    }
    
    .contact-info {
        flex-basis: 100%;
        margin-left: 0;
        font-size: 8pt;
        text-align: left;
    }
    
    /* Ocultar el Marco Legal */
    .legal-info {
        display: none;
    }
}