/**
 * MiGuía10 Leads — Popup Styles
 *
 * Estilos del popup frontend.
 * Todos los selectores usan prefijo .mg10- para evitar conflictos.
 * Variables CSS inyectadas dinámicamente desde PHP.
 *
 * @package MiGuia10Leads
 */

/* ─── Variables (fallbacks, los reales se inyectan inline) ─── */
:root {
    --mg10-primary: #2563eb;
    --mg10-button: #dc2626;
}

/* ─── Overlay ─── */
.mg10-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Evitar que Elementor o temas muevan el overlay con transforms */
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mg10-overlay.mg10-active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ─── Modal ─── */
.mg10-modal-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 32px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.mg10-overlay.mg10-active .mg10-modal-box {
    transform: scale(1) translateY(0);
}


/* ─── Botón cerrar ─── */
.mg10-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.mg10-close-btn:hover {
    color: #333;
    transform: scale(1.2);
}


/* ─── Título y descripción ─── */
.mg10-popup-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    line-height: 1.3;
}


.mg10-popup-desc {
    font-size: 14px;
    text-align: center;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}


/* ─── Plan badge ─── */
.mg10-plan-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--mg10-primary), #6366f1);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 25px 4px;
    border-radius: 20px;
    text-align: center;
    margin: 0 auto 20px;
    display: block;
    width: fit-content;
}

/* ─── Form ─── */
.mg10-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mg10-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mg10-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}


.mg10-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background: #f8fafc;
    color: #1a1a1a;
    box-sizing: border-box;
    font-family: inherit;
}

.mg10-input:focus {
    border-color: var(--mg10-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #fff;
}

.mg10-input::placeholder {
    color: #9ca3af;
}

.mg10-input.mg10-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ─── Error message ─── */
.mg10-error-msg {
    color: #ef4444;
    font-size: 12px;
    margin-top: 2px;
    display: none;
}

.mg10-error-msg.mg10-visible {
    display: block;
}

/* ─── Botón enviar ─── */
.mg10-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--mg10-button);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.mg10-submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

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

.mg10-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ─── WhatsApp icon ─── */
.mg10-wa-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ─── Spinner ─── */
.mg10-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: mg10Spin 0.6s linear infinite;
}

.mg10-submit-btn.mg10-loading .mg10-spinner {
    display: inline-block;
}

.mg10-submit-btn.mg10-loading .mg10-btn-text,
.mg10-submit-btn.mg10-loading .mg10-wa-icon {
    display: none;
}

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

/* ─── Success state ─── */
.mg10-success {
    text-align: center;
    padding: 20px;
}

.mg10-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.mg10-success-text {
    font-size: 16px;
    color: #22c55e;
    font-weight: 600;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .mg10-modal-box {
        max-width: 95%;
        padding: 24px 20px;
        margin: 10px;
        border-radius: 12px;
    }

    .mg10-popup-title {
        font-size: 20px;
    }

    .mg10-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevent iOS zoom */
    }
}

@media (max-width: 360px) {
    .mg10-modal-box {
        padding: 20px 16px;
    }

    .mg10-popup-title {
        font-size: 18px;
    }
}
