/* 
 * Estilos para Modales de Autenticación - Aerolistados
 * Mantiene consistencia con formularios existentes
 */

/* ===== MODALES BASE ===== */
.aerolistados-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.aerolistados-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.aerolistados-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

/* ===== HEADER DEL MODAL ===== */
.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    background: linear-gradient(135deg, #12437c 0%, #1a5490 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    font-size: 18px;
    opacity: 0.9;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* ===== FORMULARIOS ===== */
.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fff !important;
    background-color: #fff !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #12437c;
    box-shadow: 0 0 0 3px rgba(18, 67, 124, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

/* ===== CHECKBOX GROUPS ===== */
.checkbox-group {
    margin: 25px 0;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400 !important;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: auto;
    flex-shrink: 0;
    accent-color: #12437c;
}

/* ===== BOTONES ===== */
.aerolistados-modal .form-actions {
    margin-top: 30px;
    display: block;
    gap: initial;
    justify-content: initial;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 50px;
    width: 100%;
}

.btn-primary {
    background: #12437c !important;
    color: white;
}

.btn-primary:hover {
    background: #38587d !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(18, 67, 124, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-spinner {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== ENLACES DEL FORMULARIO ===== */
.aerolistados-modal .form-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-links a {
    color: #12437c;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-links a:hover {
    color: #38587d;
    text-decoration: underline;
}

.forgot-link {
    font-weight: 500;
}

/* ===== MENSAJES ===== */
.form-message {
    margin: 20px 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== TEXTO DE AYUDA ===== */
.field-help {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.form-note {
    margin-top: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #12437c;
}

.form-note small {
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-note i {
    color: #12437c;
}

/* ===== BOTONES EN MENÚ ===== */
.auth-menu-item .auth-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.auth-menu-item .auth-link:hover {
    color: #12437c;
    background: rgba(18, 67, 124, 0.1);
}

.auth-menu-item .login-link {
    color: #12437c;
}

.auth-menu-item .register-link {
    background: #12437c;
    color: white;
}

.auth-menu-item .register-link:hover {
    background: #38587d;
    color: white;
}

/* ===== RECAPTCHA ===== */
.g-recaptcha {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 20px 25px 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .auth-form {
        padding: 25px 20px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group input[type="tel"] {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn {
        padding: 16px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        background: #fff;
    }
    
    .modal-header {
        border-radius: 0;
    }
    
    .form-links {
        gap: 15px;
    }
    
    .checkbox-label {
        font-size: 14px;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

.aerolistados-modal.entering .modal-content {
    animation: modalSlideIn 0.3s ease forwards;
}

.aerolistados-modal.leaving .modal-content {
    animation: modalSlideOut 0.3s ease forwards;
}

/* ===== CAMPO TELÉFONO INTERNACIONAL ===== */
.iti {
    position: relative;
    width: 100%;
}

.iti__flag-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 5;
}

.iti input[type="tel"] {
    padding-left: 52px !important;
}

/* Específico para modales */
.auth-form .iti__flag-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    z-index: 5 !important;
}

.auth-form .iti input[type="tel"] {
    padding-left: 52px !important;
}


/* ===== SOCIAL LOGIN ===== */
.social-login-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.social-login-divider {
    text-align: center;
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 14px;
}

.btn-social-google {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 2px solid #dadce0;
    border-radius: 8px;
    color: #3c4043;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social-google:hover {
    background: #f8f9fa;
    border-color: #12437c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-social-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn-social-google svg {
    flex-shrink: 0;
}