/* Estilos generales modernizados */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc;
    color: #334155;
    font-size: 16px;
    line-height: 1.6;
}

/* Encabezado moderno */
header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: #fff;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#imgLogo {
    max-height: 55px;
    height: auto;
}

h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Contenedor de autenticación */
.auth-container {
    max-width: 480px;
    width: 90%;
    margin: 2rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Título de la autenticación */
.auth-container h2 {
    color: #1e3a8a;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Estilo de los grupos de formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Estilo del botón de envío */
button {
    width: 100%;
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

.button-container {
    display: flex;
    justify-content: center;
}

button {
    width: 100%;
    /* resto de estilos... */
}

/* Modal de persistencia - Versión optimizada */
#persistencyModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    font-family: 'Segoe UI', system-ui, sans-serif;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

#persistencyModal .box {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: min(500px, 95vw);
    max-height: 90vh;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    scrollbar-width: thin;
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#persistencyModal h2 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.3;
}

#persistencyModal p {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #475569;
    line-height: 1.5;
}

#persistencyModal .button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

#persistencyModal button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin: 0;
    pointer-events: auto;
}

#persistencyModal button:not(.secondary) {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

#persistencyModal button:not(.secondary):hover {
    background-color: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

#persistencyModal button:not(.secondary):active {
    transform: translateY(0);
}

#persistencyModal .secondary {
    background-color: #cbd5df;
    color: #334155;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

#persistencyModal .secondary:hover {
    background-color: rgb(161, 166, 172);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

#persistencyModal .status {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mejora para dispositivos pequeños */
@media (max-width: 480px) {
    #persistencyModal .box {
        padding: 1.5rem;
        border-radius: 12px;
    }

    #persistencyModal h2 {
        font-size: 1.3rem;
    }

    #persistencyModal button {
        padding: 0.875rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .auth-container {
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .auth-container h2 {
        font-size: 1.5rem;
        text-align: center;
    }
}