/* Popup de Contáctanos */
.contact-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeInPopup 0.3s ease-out;
}

.contact-popup.show {
    display: flex;
}

/* POPUP PRINCIPAL DE OPCIONES */
.popup-content {
    background: linear-gradient(135deg, #0039A6 0%, #8a8282 50%, #D52B1E 100%);
    border-radius: 20px;
    text-align: center;
    color: white;
    position: relative;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    animation: popupScale 0.3s ease-out forwards;
    padding: 2rem;
}

/* POPUP CON FORMULARIO */
.popup-with-form {
    max-width: 95vw !important;
    max-height: 95vh !important;
    width: 95vw !important;
    height: 95vh !important;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #0039A6 0%, #8a8282 50%, #D52B1E 100%) !important;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

/* POPUP CON IMAGEN LATERAL */
.popup-with-image {
    flex-direction: row !important;
}

.popup-form-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

.popup-image-col {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.popup-form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* En móvil ocultar la imagen para que el form no quede aplastado */
@media (max-width: 640px) {
    .popup-image-col {
        display: none;
    }
    .popup-with-image {
        flex-direction: column !important;
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

.popup-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: bounceIcon 2s infinite;
}

.popup-icon i {
    font-size: 2.5rem;
    color: white;
}

.popup-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.popup-content p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    color: white;
}

/* HEADER DEL POPUP CON FORMULARIO */
.popup-header {
    background: linear-gradient(135deg, #0039A6 0%, #2c5aa0 50%, #8a8282 100%);
    text-align: center;
    padding: 1.5rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-header .popup-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.15);
}

.popup-header h5 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
}

.popup-header p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* CONTENEDOR DEL FORMULARIO */
.iframe-container {
    background: white;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 0;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    max-height: none !important;
}

.iframe-container p {
    margin: 0;
}

/* ESTILOS DEL FORMULARIO */
.iframe-container .container-fluid {
    padding: 1.5rem 1rem;
}

.iframe-container .alert {
    margin-bottom: 1.5rem;
    border: none;
    border-left: 4px solid #ff9800;
    background: #fff3e0;
    color: #e65100;
}

.iframe-container h5 {
    color: #0039A6;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.iframe-container h6 {
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}

.iframe-container .form-label {
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.iframe-container .form-control,
.iframe-container .form-control-sm {
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.iframe-container .form-control:focus,
.iframe-container .form-control-sm:focus {
    border-color: #0039A6;
    box-shadow: 0 0 0 3px rgba(0, 57, 166, 0.1);
}

.iframe-container .progress {
    border-radius: 10px;
    background: #e9ecef;
}

.iframe-container .progress-bar {
    background: linear-gradient(90deg, #0039A6 0%, #2c5aa0 100%);
    transition: width 0.3s;
}

/* BOTONES DEL FORMULARIO */
.iframe-container .btn-info {
    background: linear-gradient(135deg, #0039A6 0%, #2c5aa0 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s;
}

.iframe-container .btn-info:hover {
    background: linear-gradient(135deg, #002d7d 0%, #1f4380 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 57, 166, 0.3);
}

.iframe-container .btn-success {
    background: #28a745;
    border: none;
    color: white;
    font-weight: 600;
}

.iframe-container .btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.iframe-container .btn-outline-secondary {
    color: #666;
    border-color: #ddd;
    font-weight: 600;
}

.iframe-container .btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

.iframe-container .btn-outline-danger {
    color: #dc3545;
    border-color: #ddd;
    font-weight: 600;
}

.iframe-container .btn-outline-danger:hover {
    background: #fff5f5;
    border-color: #dc3545;
}

.iframe-container .btn-secondary {
    background: #6c757d;
    border: none;
}

.iframe-container .btn-secondary:disabled {
    background: #c0c0c0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* EQUIPO BLOCK */
.iframe-container .equipo-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
}

.iframe-container .equipo-block h6 {
    color: #0039A6;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ALERTAS */
.iframe-container .alert-warning {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.iframe-container .alert-info {
    border-left-color: #0039A6;
    background: #e3f2fd;
    color: #01579b;
}

/* Modal de resultado por encima de los popups */
#formResultModal {
    z-index: 99999 !important;
}
#formResultModal + .modal-backdrop,
.modal-backdrop {
    z-index: 99998 !important;
}

/* ANIMACIONES */
@keyframes fadeInPopup {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupScale {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

@keyframes bounceIcon {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* OPCIONES DE CONTACTO */
.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-align: left;
    width: 100%;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.option-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-icon i {
    font-size: 1.5rem;
    color: white;
}

.option-text {
    flex: 1;
}

.option-text h5 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.option-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
}

.register-btn:hover .option-icon {
    background: #0039A6;
}

.register-btn:hover {
    border-color: #0039A6;
}

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .popup-with-form {
        max-width: 98vw !important;
        max-height: 98vh !important;
        width: 98vw !important;
        height: 98vh !important;
    }

    .popup-header {
        padding: 1rem;
    }

    .popup-header .popup-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 0.8rem;
    }

    .popup-header h5 {
        font-size: 1.2rem;
    }

    .popup-header p {
        font-size: 0.9rem;
    }

    .iframe-container {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .iframe-container .container-fluid {
        padding: 1rem 0.8rem;
    }

    .contact-options {
        gap: 0.8rem;
    }

    .option-btn {
        padding: 1rem;
    }

    .option-icon {
        width: 45px;
        height: 45px;
    }

    .option-icon i {
        font-size: 1.3rem;
    }

    .option-text h5 {
        font-size: 1rem;
    }

    .option-text p {
        font-size: 0.8rem;
    }
}

/* LANDSCAPE MÓVIL */
@media (max-width: 768px) and (orientation: landscape) {
    .popup-header {
        padding: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .popup-header .popup-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.3rem;
    }

    .popup-header h5 {
        font-size: 1.1rem;
    }

    .iframe-container .container-fluid {
        padding: 0.8rem 0.6rem;
    }
}

/* PANTALLAS GRANDES */
@media (min-width: 1400px) {
    .popup-with-form {
        max-width: 90vw !important;
        max-height: 90vh !important;
        width: 90vw !important;
        height: 90vh !important;
    }
}