/* ==================== MODAL DE AUTENTICACIÓN ==================== */
.modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 20, 0.26);
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal_overlay.modal_activo {
    opacity: 1;
    visibility: visible;
}

.modal_contenido {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(64px) saturate(180%) brightness(1.04);
    -webkit-backdrop-filter: blur(64px) saturate(180%) brightness(1.04);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 28px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 36px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition:
        transform 0.52s cubic-bezier(0.34, 1.38, 0.64, 1),
        opacity 0.32s ease;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.92),
        inset 0 -1px 0 rgba(255, 255, 255, 0.22),
        0 48px 100px rgba(0, 0, 0, 0.22),
        0 16px 40px rgba(0, 0, 0, 0.12),
        0 0 0 0.5px rgba(255, 255, 255, 0.38);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.modal_contenido::-webkit-scrollbar {
    width: 4px;
}

.modal_contenido::-webkit-scrollbar-track {
    background: transparent;
}

.modal_contenido::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.modal_activo .modal_contenido {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal_cerrar {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.modal_cerrar:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: scale(1.08);
}

.modal_cerrar svg {
    width: 24px;
    height: 24px;
    color: #6b7280;
}

/* ==================== TABS ==================== */
.auth_tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.auth_tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.auth_tab:hover {
    color: var(--azul);
}

.auth_tab-activo {
    color: var(--azul);
    border-bottom-color: var(--azul);
}

/* ==================== FORMULARIOS ==================== */
.auth_form {
    display: none;
}

.auth_form-activo {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth_titulo {
    font-size: 2.4rem;
    margin-bottom: 16px;
    color: var(--negro);
}

.form_grupo {
    margin-bottom: 14px;
}

.form_label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 1.4rem;
    font-weight: 500;
}

.form_input {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1.5rem;
    font-family: inherit;
    transition: border-color var(--transicion), box-shadow var(--transicion);
    background: #fafafa;
}

.form_input:focus {
    outline: none;
    border-color: var(--negro);
    background: var(--blanco);
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

.input_password {
    position: relative;
    display: flex;
    align-items: center;
}

.btn_ver_password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.btn_ver_password svg {
    width: 20px;
    height: 20px;
}

.form_ayuda {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 1.2rem;
}

.form_extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.checkbox_label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox_label input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.checkbox_label input::before {
    content: "";
    width: 11px;
    height: 11px;
    transform: scale(0);
    transition: transform 0.15s ease-in-out;
    box-shadow: inset 1em 1em white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox_label input:checked {
    background: var(--azul);
    border-color: var(--azul);
}

.checkbox_label input:checked::before {
    transform: scale(1);
}

.checkbox_texto {
    font-size: 1.5rem;
}

.link_terminos {
    color: var(--azul);
    text-decoration: none;
}

.btn_submit {
    width: 100%;
    padding: 14px;
    background: var(--azul);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transicion);
    letter-spacing: 0.01em;
}

.btn_submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(53, 119, 177, 0.4);
}

.auth_divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #6b7280;
    font-size: 1.3rem;
}

.auth_divider::before,
.auth_divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth_divider span {
    padding: 0 16px;
}

.auth_redes {
    display: flex;
    gap: 12px;
}

.btn_red {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.2s;
}

.btn_red:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.btn_red svg {
    width: 20px;
    height: 20px;
}

/* ==================== MFA ==================== */
.modal_mfa {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal_mfa_login {
    max-width: 380px;
    text-align: center;
}

.mfa_header {
    text-align: center;
    margin-bottom: 2rem;
}

.mfa_icon_wrap {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mfa_subtitulo {
    color: #666;
    font-size: 1.4rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.mfa_pasos {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.mfa_paso {
    display: flex;
    gap: 1.4rem;
    align-items: flex-start;
}

.paso_numero {
    min-width: 3rem;
    height: 3rem;
    background: #3577b1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.paso_contenido h3 {
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
}

.apps_lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.app_chip {
    background: #e8f0fb;
    color: #3577b1;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 1.2rem;
}

.qr_container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.qr_loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: #666;
    font-size: 1.3rem;
}

.spinner_mfa {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e8f0fb;
    border-top-color: #3577b1;
    border-radius: 50%;
    animation: spinMfa 0.8s linear infinite;
}

@keyframes spinMfa {
    to {
        transform: rotate(360deg);
    }
}

#qr-code-div img, #qr-code-div canvas {
    border-radius: 8px;
}

.clave_manual_wrap {
    margin-top: 1rem;
    font-size: 1.3rem;
}

.clave_manual_wrap summary {
    cursor: pointer;
    color: #3577b1;
}

.clave_manual {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
    background: #f3f4f6;
    padding: 0.8rem 1rem;
    border-radius: 6px;
}

.clave_manual code {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    flex: 1;
    word-break: break-all;
}

.btn_copiar {
    background: #3577b1;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    white-space: nowrap;
}

.btn_copiar:hover {
    background: #2a5f96;
}

.codigo_totp_input {
    text-align: center !important;
    font-size: 2.4rem !important;
    letter-spacing: 0.4em;
    font-weight: bold;
}

.mfa_error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #dc2626;
    padding: 1rem 1.4rem;
    border-radius: 6px;
    font-size: 1.3rem;
    margin-top: 1rem;
}

.mfa_nota {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-top: 1.5rem;
}


/* ==================== FORMULARIOS ==================== */
.btn_link {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.4rem;
    margin-top: 1rem;
    padding: 0.8rem;
}

.btn_link:hover {
    color: #3577b1;
    text-decoration: underline;
}

.btn_link_inline {
    background: none;
    border: none;
    color: #3577b1;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0;
}

.btn_link_inline:hover {
    text-decoration: underline;
}


/* ==================== VERIFICACIÓN EMAIL ==================== */
.verificacion_icono {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.spinner_verificacion {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e8f0fb;
    border-top-color: #3577b1;
    border-radius: 50%;
    animation: spinMfa 0.8s linear infinite;
    margin: 1.5rem auto;
}


/* ==================== PERFIL ==================== */
.modal_perfil_contenido {
    max-width: 380px;
    text-align: center;
}

.perfil_avatar {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: #3577b1;
    color: white;
    font-size: 3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-family: "Nunito", sans-serif;
}

.perfil_nombre_texto {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.perfil_email_texto {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2.5rem;
}

.perfil_opciones {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.perfil_opcion {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1.4rem;
    color: #374151;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
}

.perfil_opcion:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.perfil_opcion_peligro {
    color: #ef4444;
    border-color: #fecaca;
}

.perfil_opcion_peligro:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.perfil_mfa_activo {
    color: #10b981 !important;
    border-color: #a7f3d0 !important;
}

.perfil_mfa_activo:hover {
    background: #f0fdf4 !important;
}

/* ==================== NOTIFICACIONES ==================== */
.notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    z-index: 10000;
    max-width: 400px;
    font-size: 1.4rem;
    animation: slideIn .3s ease-out;
}

.notificacion_exito {
    border-left: 4px solid #10b981;
}

.notificacion_error {
    border-left: 4px solid #ef4444;
}

.notificacion_info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 750px) {
    .modal_contenido {
        width: 92%;
        padding: 20px 20px 24px;
        border-radius: 22px;
    }

    .modal_cerrar {
        top: 12px;
        right: 12px;
    }

    .auth_tabs {
        padding-right: 44px;
    }

    .auth_titulo {
        font-size: 2rem;
    }
}

@media (max-width: 380px) {
    .modal_contenido {
        padding: 20px;
    }
}
