/* ============================================
   ACCESO.CSS - VERSIÓN PROFESIONAL MEJORADA
   Optimizado para personas mayores
   ============================================ */

/* ===== ANIMACIONES KEYFRAMES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== ESTILOS GLOBALES ===== */
body {
    margin: 0;
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Fondo animado con burbujas */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

/* Patrón de puntos decorativo */
body::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.access-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    z-index: 1;
    position: relative;
}

/* ===== TARJETA DE ACCESO ===== */
.access-content {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: fadeIn 0.8s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.access-content:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ===== LOGO ===== */
.access-logo {
    height: 120px;
    margin-bottom: 35px;
    animation: slideInFromTop 0.8s ease-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.access-logo:hover {
    transform: scale(1.05) rotate(2deg);
}

/* ===== TÍTULOS ===== */
.form-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInFromTop 0.8s ease-out 0.2s both;
}

.form-subtitle {
    color: #666;
    margin-top: 0;
    margin-bottom: 40px;
    font-size: 1.1rem;
    font-weight: 400;
    animation: slideInFromTop 0.8s ease-out 0.3s both;
}

/* ===== GRUPOS DE INPUT ===== */
.input-group {
    margin-bottom: 28px;
    text-align: left;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 16px 18px;
    font-size: 1.05rem;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    border-radius: 12px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', Arial, sans-serif;
}

.input-group input::placeholder {
    color: #aaa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #f8f9ff;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.15),
        0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.input-group input:hover:not(:focus) {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Estado de error */
.input-group input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.input-group input.error:focus {
    border-color: #dc3545;
    box-shadow: 
        0 0 0 4px rgba(220, 53, 69, 0.15),
        0 4px 12px rgba(220, 53, 69, 0.2);
}

/* ===== BOTÓN DE SUBMIT ===== */
.submit-button {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out 0.5s both;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-button:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.submit-button:hover::before {
    width: 300px;
    height: 300px;
}

.submit-button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Estado de carga */
.submit-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ===== MENSAJES DE ERROR/ÉXITO ===== */
.message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideInFromTop 0.4s ease-out;
}

.message.error {
    background-color: #fee;
    color: #c33;
    border: 2px solid #fcc;
}

.message.success {
    background-color: #efe;
    color: #3c3;
    border: 2px solid #cfc;
}

/* ===== ENLACES ADICIONALES ===== */
.additional-links {
    margin-top: 25px;
    font-size: 0.95rem;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.additional-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.additional-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.additional-links a:hover {
    color: #764ba2;
}

.additional-links a:hover::after {
    width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .access-content {
        padding: 40px 30px;
        max-width: 90%;
    }
    
    .form-title {
        font-size: 2rem;
    }
    
    .form-subtitle {
        font-size: 1rem;
    }
    
    .access-logo {
        height: 90px;
        margin-bottom: 25px;
    }
    
    .input-group input {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .submit-button {
        padding: 16px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .access-content {
        padding: 35px 25px;
    }
    
    .form-title {
        font-size: 1.8rem;
    }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Alto contraste para mejor legibilidad */
@media (prefers-contrast: high) {
    .access-content {
        background: #fff;
        border: 3px solid #000;
    }
    
    .form-title {
        -webkit-text-fill-color: #000;
    }
    
    .input-group input {
        border-width: 3px;
    }
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}