﻿/* ==== VARIABLES CSS PARA CONSISTENCIA ==== */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --background-light: #f8fafc;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #64748b;
    --border-color: #bae6fd;
    --border-radius: 10px;
    --shadow-light: 0 2px 6px rgba(59, 130, 246, 0.3);
    --shadow-medium: 0 4px 12px rgba(59, 130, 246, 0.4);
    --transition: all 0.3s ease;
    --modal-max-width: 360px;
}

/* ==== Fondo del Modal - Recuperación ==== */
#recoveryModal.modal,
#recoveryPasswordModal.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1)), rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 0.5rem;
    box-sizing: border-box;
}

/* ==== Contenedor del Modal - Recuperación ==== */
#recoveryModal .modal-content,
#recoveryPasswordModal .modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #fafbff 50%, #f8fafc 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem 1rem 1rem;
    width: 100%;
    max-width: var(--modal-max-width);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15), 0 8px 16px rgba(14, 165, 233, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1.5px solid var(--primary-color);
    box-sizing: border-box;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==== Botón de Cierre - Recuperación ==== */
#recoveryModal .close-modal,
#recoveryPasswordModal .close-modal {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(248, 250, 252, 0.8);
    transition: var(--transition);
    z-index: 10;
}

    #recoveryModal .close-modal:hover,
    #recoveryPasswordModal .close-modal:hover {
        color: var(--danger-color);
        background: linear-gradient(135deg, #fef2f2, #fee2e2);
        transform: scale(1.05);
    }

/* ==== Título Principal - Recuperación ==== */
#recoveryModal h2,
#recoveryPasswordModal h2 {
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    padding: 0 0.25rem;
}

/* ==== Contenedor de Pasos ==== */
.paso-activo {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
    gap: 0.5rem;
}

.paso-oculto {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==== Formulario - Recuperación ==== */
#recoveryModal form,
#recoveryForm,
#verificacionForm,
#contrasenaForm {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

/* ==== Grupo de Input - Recuperación ==== */
#recoveryModal .input-group,
.grupo-codigo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

/* ==== Label - Recuperación ==== */
#recoveryModal .input-label,
.label-codigo {
    font-weight: 600;
    color: var(--text-medium);
    font-size: 0.7rem;
}

/* ==== Inputs - Recuperación ==== */
#recoveryModal input,
.input-codigo {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border-radius: var(--border-radius);
    border: 1.5px solid var(--border-color);
    font-size: 0.7rem;
    transition: var(--transition);
    box-sizing: border-box;
    background: white;
    color: var(--text-dark);
}

    #recoveryModal input:focus,
    .input-codigo:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        background: var(--background-light);
    }

/* ==== Botones Principales ==== */
#recoveryModal .btn-principal,
.btn-verificar {
    width: 100%;
    padding: 0.625rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    text-decoration: none;
    text-align: center;
    min-height: 36px;
}

    #recoveryModal .btn-principal:hover:not(:disabled),
    .btn-verificar:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
        transform: translateY(-1px);
        box-shadow: var(--shadow-medium);
    }

    #recoveryModal .btn-principal:disabled,
    .btn-verificar:disabled {
        background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* ==== Botones Secundarios ==== */
.btn-secundario {
    width: 100%;
    padding: 0.625rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-medium);
    border: 1.5px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 36px;
}

    .btn-secundario:hover {
        background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
        border-color: #94a3b8;
        transform: translateY(-1px);
        box-shadow: 0 1px 4px rgba(148, 163, 184, 0.2);
    }

/* ==== Botón Volver ==== */
.btn-volver {
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 36px;
}

    .btn-volver:hover {
        background: rgba(248, 250, 252, 0.8);
        color: var(--text-medium);
        border-color: #cbd5e1;
        transform: translateY(-1px);
        box-shadow: 0 1px 4px rgba(148, 163, 184, 0.1);
    }

/* ==== Enlaces Adicionales - Recuperación ==== */
#recoveryModal .additional-links {
    margin-top: 0.75rem;
    text-align: center;
    width: 100%;
}

    #recoveryModal .additional-links p {
        color: var(--text-light);
        margin-bottom: 0.375rem;
        font-size: 0.7rem;
    }

    #recoveryModal .additional-links a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        transition: var(--transition);
    }

        #recoveryModal .additional-links a:hover {
            color: var(--primary-dark);
            transform: translateX(-1px);
        }

/* ==== Alertas - Recuperación ==== */
#recoveryModal .alert {
    padding: 0.5rem 0.625rem;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    margin-top: 0.375rem;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    box-sizing: border-box;
}

#recoveryModal .alert-danger {
    background: #fef2f2;
    color: var(--danger-color);
    border-color: #fecaca;
}

#recoveryModal .alert-success {
    background: #f0fdf4;
    color: var(--success-color);
    border-color: #bbf7d0;
}

/* ==== Contenido de Cambio de Contraseña ==== */
.cambio-contrasena-contenido,
.verificacion-contenido {
    text-align: center;
    width: 100%;
}

.info-contrasena,
.info-verificacion {
    margin-bottom: 0.75rem;
}

    .info-contrasena i,
    .info-verificacion i {
        font-size: 1.25rem;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
        background: #e0f2fe;
        padding: 0.5rem;
        border-radius: 50%;
        width: 2.25rem;
        height: 2.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 0.5rem;
    }

    .info-contrasena p,
    .info-verificacion p {
        color: var(--text-light);
        margin-bottom: 0.25rem;
        font-size: 0.7rem;
        line-height: 1.3;
    }

.texto-ayuda {
    font-size: 0.65rem !important;
    color: #94a3b8 !important;
    font-style: italic;
}

/* ==== Indicador de Fuerza de Contraseña ==== */
.password-strength {
    margin-top: 0.25rem;
    height: 3px;
    background: #e2e8f0;
    border-radius: 1.5px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: var(--transition);
    border-radius: 1.5px;
}

    .strength-bar.debil {
        background: var(--danger-color);
        width: 25%;
    }

    .strength-bar.medio {
        background: var(--warning-color);
        width: 50%;
    }

    .strength-bar.fuerte {
        background: var(--success-color);
        width: 100%;
    }

/* ==== Mensajes de Coincidencia ==== */
.text-success {
    color: var(--success-color);
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.text-danger {
    color: var(--danger-color);
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ==== Botones Específicos de Cambio de Contraseña ==== */
.acciones-contrasena,
.acciones-verificacion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    width: 100%;
}

/* ==== Estilos para el grupo de código ==== */
.grupo-codigo {
    margin-bottom: 0.375rem;
}

.contenedor-codigos {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
}

.input-codigo {
    width: 2rem;
    height: 2.25rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    transition: var(--transition);
}

    .input-codigo:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        transform: scale(1.03);
    }

    .input-codigo.filled {
        border-color: var(--primary-color);
        background: #f0f9ff;
        box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2);
    }

/* ==== Correo Destino ==== */
.correo-destino {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.7rem;
    margin: 0.375rem 0;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    border-left: 2px solid var(--primary-color);
    word-break: break-all;
}

/* ==== Mensajes Container ==== */
.mensajes-container {
    width: 100%;
    margin-top: 0.5rem;
}

    .mensajes-container .alert {
        width: 100%;
        box-sizing: border-box;
    }

/* ==== Contador de Tiempo ==== */
.contador-tiempo {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    text-align: center;
    font-style: italic;
}

/* ==== Estados de Botón Enviando ==== */
.btn-enviando {
    position: relative;
    color: transparent !important;
}

    .btn-enviando::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        border: 1.5px solid transparent;
        border-top: 1.5px solid #ffffff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

.btn-secundario.btn-enviando::after {
    border-top: 1.5px solid var(--text-medium);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==== Animación de Pulso para Botones ==== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.btn-verificar:not(:disabled) {
    animation: pulse 2s infinite;
}

/* ==== RESPONSIVE ADAPTACIONES MEJORADAS ==== */
@media (max-width: 480px) {
    #recoveryModal.modal,
    #recoveryPasswordModal.modal {
        padding: 0.25rem;
    }

    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        padding: 1rem 0.75rem 0.75rem;
        max-width: 98%;
    }

    .contenedor-codigos {
        gap: 0.25rem;
    }

    .input-codigo {
        width: 1.75rem;
        height: 2rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 320px) {
    .contenedor-codigos {
        gap: 0.2rem;
    }

    .input-codigo {
        width: 1.5rem;
        height: 1.75rem;
        font-size: 0.7rem;
    }

    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        padding: 0.75rem 0.5rem 0.5rem;
    }
}

/* ==== Soporte para orientación horizontal en móviles ==== */
@media (max-height: 500px) and (orientation: landscape) {
    #recoveryModal.modal,
    #recoveryPasswordModal.modal {
        align-items: flex-start;
        padding-top: 0.5rem;
    }

    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .paso-activo {
        gap: 0.375rem;
    }
}

/* ==== Mejoras de accesibilidad ==== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==== Mejora de contraste para modo oscuro del sistema ==== */
@media (prefers-color-scheme: dark) {
    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        background: linear-gradient(145deg, #1e293b 0%, #334155 50%, #475569 100%);
        color: #f1f5f9;
    }

    #recoveryModal input,
    .input-codigo {
        background: #374151;
        color: #f1f5f9;
        border-color: #4b5563;
    }

        #recoveryModal input:focus,
        .input-codigo:focus {
            background: #4b5563;
        }

    .texto-ayuda {
        color: #9ca3af !important;
    }
}



/* ===== MEJORAS ESPECÍFICAS PARA MÓVILES - RECUPERAR CONTRASEÑA CON TECLADO ===== */
@media (max-width: 768px) {
    /* MODALES OPTIMIZADOS PARA MÓVILES */
    #recoveryModal.modal,
    #recoveryPasswordModal.modal {
        align-items: flex-start; /* Alinear arriba para teclado */
        padding: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* CONTENEDORES MÁS COMPACTOS */
    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        width: 95%;
        max-width: 350px;
        padding: 20px 16px 16px;
        margin: 20px auto;
        border-radius: 12px;
        max-height: 90vh; /* Limitar altura */
        overflow-y: auto; /* Scroll interno */
        border-width: 1px;
    }

    /* BOTONES DE CIERRE MÁS ACCESIBLES */
    #recoveryModal .close-modal,
    #recoveryPasswordModal .close-modal {
        top: 10px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 6px;
    }

    /* TÍTULOS MÁS COMPACTOS */
    #recoveryModal h2,
    #recoveryPasswordModal h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* FORMULARIOS MÁS COMPACTOS */
    #recoveryModal form,
    #recoveryForm,
    #verificacionForm,
    #contrasenaForm {
        gap: 12px;
    }

    /* INPUTS OPTIMIZADOS PARA TECLADO */
    #recoveryModal input,
    .input-codigo {
        padding: 14px 12px;
        font-size: 16px !important; /* Prevenir zoom en iOS */
        min-height: 44px; /* Altura mínima para toques */
        border-radius: 8px;
        border-width: 1.5px;
    }

        #recoveryModal input:focus,
        .input-codigo:focus {
            transform: none; /* Evitar saltos con teclado */
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        }

    /* LABELS MÁS COMPACTOS */
    #recoveryModal .input-label,
    .label-codigo {
        font-size: 14px;
        margin-bottom: 4px;
    }

    /* BOTONES PRINCIPALES OPTIMIZADOS */
    #recoveryModal .btn-principal,
    .btn-verificar {
        padding: 14px;
        font-size: 15px;
        border-radius: 8px;
        min-height: 48px; /* Altura mínima para toques */
        margin-top: 8px;
    }

        #recoveryModal .btn-principal:hover:not(:disabled),
        .btn-verificar:hover:not(:disabled) {
            transform: none; /* Eliminar hover en móviles */
        }

    /* BOTONES SECUNDARIOS OPTIMIZADOS */
    .btn-secundario,
    .btn-volver {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 44px;
    }

        .btn-secundario:hover,
        .btn-volver:hover {
            transform: none;
        }

    /* VERIFICACIÓN DE CÓDIGO OPTIMIZADA */
    .contenedor-codigos {
        gap: 8px;
        margin: 0 auto;
    }

    .input-codigo {
        width: 45px;
        height: 55px;
        font-size: 18px;
        border-radius: 8px;
        min-height: auto;
    }

        .input-codigo:focus {
            transform: scale(1.02); /* Efecto más sutil */
        }

    /* INFORMACIÓN COMPACTA */
    .info-contrasena,
    .info-verificacion {
        margin-bottom: 15px;
    }

        .info-contrasena i,
        .info-verificacion i {
            width: 50px;
            height: 50px;
            padding: 12px;
            font-size: 20px;
            margin-bottom: 10px;
        }

        .info-contrasena p,
        .info-verificacion p {
            font-size: 14px;
            margin-bottom: 6px;
        }

    .texto-ayuda {
        font-size: 13px !important;
    }

    .correo-destino {
        font-size: 14px;
        padding: 8px 10px;
        margin: 8px 0;
    }

    /* ACCIONES COMPACTAS */
    .acciones-contrasena,
    .acciones-verificacion {
        margin-top: 15px;
        gap: 8px;
    }

    /* INDICADOR DE FUERZA MÁS VISIBLE */
    .password-strength {
        margin-top: 6px;
        height: 4px;
    }

    /* MENSAJES DE VALIDACIÓN */
    .text-success,
    .text-danger {
        font-size: 13px;
        margin-top: 4px;
    }

    /* ALERTAS MÓVILES */
    #recoveryModal .alert {
        padding: 10px 12px;
        font-size: 13px;
        margin-top: 8px;
    }

    /* ENLACES ADICIONALES */
    #recoveryModal .additional-links {
        margin-top: 12px;
    }

        #recoveryModal .additional-links p {
            font-size: 13px;
        }

        #recoveryModal .additional-links a {
            font-size: 13px;
        }

    /* CONTADOR DE TIEMPO */
    .contador-tiempo {
        font-size: 12px;
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    /* VERSIÓN AÚN MÁS COMPACTA */
    #recoveryModal.modal,
    #recoveryPasswordModal.modal {
        padding: 5px;
    }

    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        padding: 16px 12px 12px;
        width: 98%;
        margin: 10px auto;
    }

    #recoveryModal h2,
    #recoveryPasswordModal h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    #recoveryModal form,
    #recoveryForm,
    #verificacionForm,
    #contrasenaForm {
        gap: 10px;
    }

    #recoveryModal input,
    .input-codigo {
        padding: 12px 10px;
        min-height: 42px;
        font-size: 15px;
    }

    #recoveryModal .btn-principal,
    .btn-verificar {
        padding: 12px;
        min-height: 44px;
        font-size: 14px;
    }

    .btn-secundario,
    .btn-volver {
        padding: 10px;
        min-height: 42px;
        font-size: 13px;
    }

    .input-codigo {
        width: 40px;
        height: 50px;
        font-size: 16px;
    }

    .contenedor-codigos {
        gap: 6px;
    }

    .info-contrasena i,
    .info-verificacion i {
        width: 45px;
        height: 45px;
        padding: 10px;
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    /* VERSIÓN MÍNIMA PERO FUNCIONAL */
    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        padding: 14px 10px 10px;
    }

    #recoveryModal h2,
    #recoveryPasswordModal h2 {
        font-size: 15px;
    }

    #recoveryModal input,
    .input-codigo {
        padding: 10px 8px;
        min-height: 40px;
    }

    #recoveryModal .btn-principal,
    .btn-verificar {
        padding: 10px;
        min-height: 42px;
        font-size: 13px;
    }

    .input-codigo {
        width: 35px;
        height: 45px;
        font-size: 15px;
    }

    .contenedor-codigos {
        gap: 4px;
    }
}

/* OPTIMIZACIONES ESPECÍFICAS PARA TECLADO */
@media (max-width: 768px) and (max-height: 500px) {
    /* Cuando el teclado ocupa mucho espacio */
    #recoveryModal.modal,
    #recoveryPasswordModal.modal {
        align-items: flex-start;
        padding-top: 5px;
    }

    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        margin: 5px auto;
        max-height: 95vh;
    }

    #recoveryModal h2,
    #recoveryPasswordModal h2 {
        margin-bottom: 8px;
        font-size: 16px;
    }

    #recoveryModal form,
    #recoveryForm,
    #verificacionForm,
    #contrasenaForm {
        gap: 8px;
    }

    .texto-ayuda {
        display: none;
    }

    .info-contrasena p:last-child,
    .info-verificacion p:last-child {
        display: none;
    }
}


@media (max-width: 768px) {
    #recoveryModal input[type="text"],
    #recoveryModal input[type="email"],
    #recoveryModal input[type="password"],
    #recoveryModal input[type="number"] {
        font-size: 16px !important;
    }


    #recoveryModal input,
    .input-codigo,
    #recoveryModal .btn-principal,
    .btn-verificar,
    .btn-secundario,
    .btn-volver,
    #recoveryModal .close-modal {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

        #recoveryModal .btn-principal:active,
        .btn-verificar:active,
        .btn-secundario:active,
        .btn-volver:active,
        #recoveryModal .close-modal:active {
            transform: scale(0.98);
            opacity: 0.9;
            transition: transform 0.1s ease, opacity 0.1s ease;
        }

        .input-codigo:active {
            transform: scale(0.95);
        }

        #recoveryModal .btn-principal:hover:not(:disabled),
        .btn-verificar:hover:not(:disabled),
        .btn-secundario:hover,
        .btn-volver:hover,
        #recoveryModal .close-modal:hover {
            transform: none;
        }

        .btn-verificar:not(:disabled) {
            animation: none;
        }


    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    #recoveryModal input:focus,
    .input-codigo:focus,
    #recoveryModal .btn-principal:focus,
    .btn-verificar:focus,
    .btn-secundario:focus,
    .btn-volver:focus,
    #recoveryModal .close-modal:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 1px;
    }


    #recoveryModal .modal-content,
    #recoveryPasswordModal .modal-content {
        background: #ffffff;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        #recoveryModal.modal,
        #recoveryPasswordModal.modal {
            padding-left: max(10px, env(safe-area-inset-left));
            padding-right: max(10px, env(safe-area-inset-right));
            padding-top: max(10px, env(safe-area-inset-top));
            padding-bottom: max(10px, env(safe-area-inset-bottom));
        }
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paso-activo {
    animation: fadeIn 0.2s ease-in-out;
}

@media (max-width: 768px) {
    .grupo-codigo {
        margin-bottom: 10px;
    }


    .input-codigo {
        -webkit-appearance: none;
        -moz-appearance: textfield;
    }

        .input-codigo::-webkit-outer-spin-button,
        .input-codigo::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
}

@media (max-width: 768px) {
    .btn-enviando::after {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) {
    #recoveryModal input[type="password"] {
        font-size: 16px !important;
        letter-spacing: 1px;
    }
}