﻿/* ==== Fondo del Modal ==== */
#registroClienteModal.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;
}

/* ==== Contenedor del Modal ==== */
#registroClienteModal .modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #fafbff 50%, #f8fafc 100%);
    border-radius: 20px;
    padding: 32px 24px 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 24px 48px rgba(59, 130, 246, 0.15), 0 12px 24px rgba(14, 165, 233, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #3b82f6;
}

/* ==== Botón de Cierre ==== */
#registroClienteModal .close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

    #registroClienteModal .close-modal:hover {
        color: #dc2626;
        background: linear-gradient(135deg, #fef2f2, #fee2e2);
        transform: scale(1.05);
    }

/* ==== Título Principal ==== */
#registroClienteModal h2 {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==== Formulario ==== */
#registroClienteModal form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
}

/* ==== Grupo de Input ==== */
#registroClienteModal .input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==== Label ==== */
#registroClienteModal .input-label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

/* ==== Inputs y Select ==== */
#registroClienteModal input,
#registroClienteModal select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #bae6fd;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
    color: #1e293b;
}

    #registroClienteModal input:focus,
    #registroClienteModal select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        background: #f8fafc;
    }

/* ==== Botón Principal ==== */
#registroClienteModal button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    #registroClienteModal button:hover:not(:disabled) {
        background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }

    #registroClienteModal button:disabled {
        background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    #registroClienteModal button:active {
        transform: translateY(0);
    }

/* ==== Estilos para los pasos del modal ==== */
.paso-activo {
    display: block;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.paso-oculto {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==== Estilos para la verificación de correo ==== */
.verificacion-contenido {
    text-align: center;
    width: 100%;
}

.info-verificacion {
    margin-bottom: 25px;
}

    .info-verificacion i {
        font-size: 2.5em;
        color: #3b82f6;
        margin-bottom: 15px;
        background: #e0f2fe;
        padding: 15px;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
    }

    .info-verificacion p {
        color: #64748b;
        margin-bottom: 8px;
        font-size: 14px;
        line-height: 1.4;
    }

.correo-destino {
    font-weight: 700;
    color: #1e40af;
    margin: 10px 0 0 0;
    font-size: 15px;
    background: #f0f9ff;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #bae6fd;
}

.grupo-codigo {
    margin: 25px 0;
}

.label-codigo {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 15px;
    font-size: 14px;
}

.contenedor-codigos {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.input-codigo {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 700;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    color: #1e293b;
}

    .input-codigo:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        transform: scale(1.05);
        background: #f8fafc;
    }

    .input-codigo.filled {
        border-color: #16a34a;
        background: #f0fdf4;
        color: #166534;
    }

.acciones-verificacion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.btn-verificar {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3) !important;
}

    .btn-verificar:hover:not(:disabled) {
        background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
        box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4) !important;
    }

.btn-secundario {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3) !important;
}

    .btn-secundario:hover {
        background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4) !important;
    }

.btn-volver {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3) !important;
}

    .btn-volver:hover {
        background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
        box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4) !important;
    }

/* ==== Responsive ==== */
@media (max-width: 480px) {
    #registroClienteModal .modal-content {
        width: 95%;
        padding: 24px 16px 20px;
    }

    #registroClienteModal h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    #registroClienteModal input,
    #registroClienteModal select {
        font-size: 13px;
        padding: 10px 12px;
    }

    .input-codigo {
        width: 45px;
        height: 55px;
        font-size: 1.3em;
    }

    .contenedor-codigos {
        gap: 8px;
    }

    #registroClienteModal button {
        font-size: 14px;
        padding: 12px;
    }
}





/* Estilos para las alertas */
.alerta {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.alerta-contenido {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alerta-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alerta-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alerta-cerrar {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    color: inherit;
}

    .alerta-cerrar:hover {
        opacity: 0.7;
    }



/* ===== MEJORAS ESPECÍFICAS PARA MÓVILES - CREAR SESIÓN CON TECLADO ===== */
@media (max-width: 768px) {
    /* MODAL OPTIMIZADO PARA MÓVILES */
    #registroClienteModal.modal {
        align-items: flex-start; /* Alinear arriba para teclado */
        padding: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* CONTENEDOR MÁS COMPACTO */
    #registroClienteModal .modal-content {
        width: 95%;
        max-width: 380px;
        padding: 25px 20px 20px;
        margin: 20px auto;
        border-radius: 16px;
        max-height: 90vh; /* Limitar altura */
        overflow-y: auto; /* Scroll interno */
        border-width: 1px;
    }

    /* BOTÓN DE CIERRE MÁS ACCESIBLE */
    #registroClienteModal .close-modal {
        top: 12px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 8px;
    }

    /* TÍTULO MÁS COMPACTO */
    #registroClienteModal h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* FORMULARIO MÁS COMPACTO */
    #registroClienteModal form {
        gap: 14px;
    }

    /* INPUTS OPTIMIZADOS PARA TECLADO */
    #registroClienteModal input,
    #registroClienteModal select {
        padding: 14px 16px;
        font-size: 16px !important; /* Prevenir zoom en iOS */
        min-height: 48px; /* Altura mínima para toques */
        border-radius: 10px;
        border-width: 1.5px;
    }

        #registroClienteModal input:focus,
        #registroClienteModal select:focus {
            transform: none; /* Evitar saltos con teclado */
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        }

    /* LABELS MÁS COMPACTOS */
    #registroClienteModal .input-label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    /* BOTÓN PRINCIPAL OPTIMIZADO */
    #registroClienteModal button {
        padding: 14px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 50px; /* Altura mínima para toques */
        margin-top: 10px;
    }

        #registroClienteModal button:hover:not(:disabled) {
            transform: none; /* Eliminar hover en móviles */
        }

    /* VERIFICACIÓN DE CÓDIGO OPTIMIZADA */
    .contenedor-codigos {
        gap: 8px;
        margin: 0 auto;
    }

    .input-codigo {
        width: 45px;
        height: 55px;
        font-size: 1.3em;
        border-radius: 10px;
        min-height: auto;
    }

        .input-codigo:focus {
            transform: scale(1.02); /* Efecto más sutil */
        }

    /* INFORMACIÓN DE VERIFICACIÓN COMPACTA */
    .info-verificacion {
        margin-bottom: 20px;
    }

        .info-verificacion i {
            width: 50px;
            height: 50px;
            padding: 12px;
            font-size: 1.8em;
            margin-bottom: 12px;
        }

        .info-verificacion p {
            font-size: 13px;
            margin-bottom: 6px;
        }

    .correo-destino {
        font-size: 14px;
        padding: 8px 12px;
        margin: 8px 0 0 0;
    }

    .label-codigo {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* ACCIONES DE VERIFICACIÓN COMPACTAS */
    .acciones-verificacion {
        margin-top: 20px;
        gap: 10px;
    }

    /* ALERTAS MÓVILES */
    .alerta {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        margin: 0 10px;
    }

    .alerta-contenido {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* VERSIÓN AÚN MÁS COMPACTA */
    #registroClienteModal.modal {
        padding: 5px;
    }

    #registroClienteModal .modal-content {
        padding: 20px 16px 16px;
        width: 98%;
        margin: 10px auto;
    }

    #registroClienteModal h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    #registroClienteModal form {
        gap: 12px;
    }

    #registroClienteModal input,
    #registroClienteModal select {
        padding: 12px 14px;
        min-height: 44px;
        font-size: 15px;
    }

    #registroClienteModal button {
        padding: 12px;
        min-height: 46px;
        font-size: 14px;
    }

    .input-codigo {
        width: 40px;
        height: 50px;
        font-size: 1.2em;
    }

    .contenedor-codigos {
        gap: 6px;
    }

    .info-verificacion i {
        width: 45px;
        height: 45px;
        padding: 10px;
        font-size: 1.6em;
    }
}

@media (max-width: 360px) {
    /* VERSIÓN MÍNIMA PERO FUNCIONAL */
    #registroClienteModal .modal-content {
        padding: 16px 12px 12px;
    }

    #registroClienteModal h2 {
        font-size: 16px;
    }

    #registroClienteModal input,
    #registroClienteModal select {
        padding: 10px 12px;
        min-height: 42px;
    }

    #registroClienteModal button {
        padding: 10px;
        min-height: 44px;
        font-size: 13px;
    }

    .input-codigo {
        width: 35px;
        height: 45px;
        font-size: 1.1em;
    }

    .contenedor-codigos {
        gap: 4px;
    }
}

/* OPTIMIZACIONES ESPECÍFICAS PARA TECLADO */
@media (max-width: 768px) and (max-height: 500px) {
    /* Cuando el teclado ocupa mucho espacio */
    #registroClienteModal.modal {
        align-items: flex-start;
        padding-top: 5px;
    }

    #registroClienteModal .modal-content {
        margin: 5px auto;
        max-height: 95vh;
    }

    #registroClienteModal h2 {
        margin-bottom: 10px;
        font-size: 18px;
    }

    #registroClienteModal form {
        gap: 10px;
    }

    /* Reducir elementos no esenciales con teclado visible */
    .info-verificacion p:last-child {
        display: none;
    }
}

/* MEJORAS PARA FORMULARIOS EN MÓVILES */
@media (max-width: 768px) {
    /* Prevenir zoom en todos los inputs */
    #registroClienteModal input[type="text"],
    #registroClienteModal input[type="email"],
    #registroClienteModal input[type="password"],
    #registroClienteModal input[type="number"],
    #registroClienteModal select {
        font-size: 16px !important;
    }

    /* Mejorar áreas táctiles */
    #registroClienteModal input,
    #registroClienteModal select,
    #registroClienteModal button,
    #registroClienteModal .close-modal {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

        /* Estados táctiles con feedback */
        #registroClienteModal button:active,
        #registroClienteModal .close-modal:active {
            transform: scale(0.98);
            opacity: 0.9;
            transition: transform 0.1s ease, opacity 0.1s ease;
        }

    /* Inputs de código con mejor feedback */
    .input-codigo:active {
        transform: scale(0.95);
    }

    /* Eliminar efectos que no funcionan bien en móviles */
    #registroClienteModal button:hover:not(:disabled),
    #registroClienteModal .close-modal:hover {
        transform: none;
    }

    /* Scroll suave para iOS */
    #registroClienteModal .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* MEJORAS DE ACCESIBILIDAD */
@media (max-width: 768px) {
    #registroClienteModal input:focus,
    #registroClienteModal select:focus,
    #registroClienteModal button:focus,
    #registroClienteModal .close-modal:focus,
    .input-codigo:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 1px;
    }

    /* Asegurar contraste en exteriores */
    #registroClienteModal .modal-content {
        background: #ffffff;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    }
}

/* SOPORTE PARA DISPOSITIVOS CON NOTCH */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        #registroClienteModal.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));
        }
    }
}

/* ANIMACIONES OPTIMIZADAS PARA MÓVILES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paso-activo {
    animation: fadeIn 0.2s ease-in-out;
}

/* ESTILOS PARA CÓDIGOS DE VERIFICACIÓN EN MÓVILES */
@media (max-width: 768px) {
    .grupo-codigo {
        margin: 20px 0;
    }

    /* Asegurar que los inputs de código sean fáciles de tocar */
    .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;
        }
}

/* MEJORAS PARA SELECT EN MÓVILES */
@media (max-width: 768px) {
    #registroClienteModal select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
}


/* Estilos para la sección de políticas */
.politica-group {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.politica-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.politica-checkbox {
    margin-top: 3px;
    transform: scale(1.1);
}

.politica-label {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    cursor: pointer;
}

.politica-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

    .politica-link:hover {
        text-decoration: underline;
    }

.politica-error {
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Estilo para el botón deshabilitado */
.btn-principal:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}


/* ===== SOLUCIÓN PARA SCROLL EN COMPUTADORAS ===== */
@media (min-width: 769px) {
    #registroClienteModal.modal {
        align-items: flex-start !important;
        padding: 40px 20px !important;
        overflow-y: auto !important;
    }

    #registroClienteModal .modal-content {
        margin: auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        position: relative !important;
    }

    /* Asegurar que el contenido sea scrollable */
    #registroClienteModal .paso-activo {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ===== MEJORAS ESPECÍFICAS PARA COMPUTADORAS ===== */
@media (min-width: 1024px) {
    #registroClienteModal .modal-content {
        max-width: 480px !important;
        width: 85% !important;
        padding: 40px 32px 32px !important;
        border-radius: 24px !important;
    }

    #registroClienteModal h2 {
        font-size: 28px !important;
        margin-bottom: 28px !important;
    }

    #registroClienteModal form {
        gap: 20px !important;
    }

    #registroClienteModal .input-group {
        gap: 8px !important;
    }

    #registroClienteModal .input-label {
        font-size: 15px !important;
    }

    #registroClienteModal input,
    #registroClienteModal select {
        padding: 14px 16px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }

    #registroClienteModal button {
        padding: 16px !important;
        font-size: 16px !important;
        border-radius: 14px !important;
        margin-top: 10px !important;
    }

    .politica-group {
        margin: 25px 0 !important;
        padding: 20px !important;
        border-radius: 12px !important;
    }

    .politica-label {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .politica-checkbox {
        transform: scale(1.2) !important;
        margin-top: 2px !important;
    }

    .verificacion-contenido {
        padding: 10px 0 !important;
    }

    .info-verificacion i {
        width: 70px !important;
        height: 70px !important;
        font-size: 2.8em !important;
        margin-bottom: 20px !important;
    }

    .info-verificacion p {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .correo-destino {
        font-size: 16px !important;
        padding: 12px 18px !important;
        margin: 12px 0 0 0 !important;
    }

    .contenedor-codigos {
        gap: 12px !important;
        margin: 20px auto !important;
    }

    .input-codigo {
        width: 55px !important;
        height: 65px !important;
        font-size: 1.6em !important;
        border-radius: 14px !important;
    }

    .acciones-verificacion {
        gap: 15px !important;
        margin-top: 30px !important;
    }

    #registroClienteModal .close-modal {
        top: 20px !important;
        right: 24px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
}

/* ===== MEJORAS PARA TABLETS ===== */
@media (min-width: 769px) and (max-width: 1023px) {
    #registroClienteModal.modal {
        padding: 30px 15px !important;
    }

    #registroClienteModal .modal-content {
        max-width: 440px !important;
        width: 90% !important;
        padding: 36px 28px 28px !important;
    }

    #registroClienteModal h2 {
        font-size: 26px !important;
        margin-bottom: 24px !important;
    }
}

/* ===== MEJORAS PARA COMPUTADORAS GRANDES ===== */
@media (min-width: 1440px) {
    #registroClienteModal.modal {
        padding: 50px 20px !important;
    }

    #registroClienteModal .modal-content {
        max-width: 520px !important;
        padding: 44px 36px 36px !important;
    }

    #registroClienteModal h2 {
        font-size: 30px !important;
        margin-bottom: 32px !important;
    }

    #registroClienteModal form {
        gap: 24px !important;
    }

    #registroClienteModal input,
    #registroClienteModal select {
        padding: 16px 18px !important;
        font-size: 16px !important;
    }

    .politica-group {
        margin: 30px 0 !important;
        padding: 24px !important;
    }

    .politica-label {
        font-size: 16px !important;
    }
}

/* ===== SCROLL SUAVE ===== */
#registroClienteModal.modal {
    scroll-behavior: smooth;
}

#registroClienteModal .modal-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

    #registroClienteModal .modal-content::-webkit-scrollbar {
        width: 6px;
    }

    #registroClienteModal .modal-content::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 10px;
    }

    #registroClienteModal .modal-content::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

        #registroClienteModal .modal-content::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

