/* --- Contenedor Inline --- */
.ez-iframe-wrapper-inline {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #f9fafb;
}

.ez-iframe-inline {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Botón del Modal --- */
.ez-button-container {
    width: 100%;
}

.ez-open-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.ez-open-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.ez-open-modal-btn:active {
    transform: translateY(0);
}

/* --- Estructura del Modal Flotante --- */
.ez-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.85); /* Slate 900 con opacidad */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ez-modal-overlay.ez-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.ez-modal-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ez-modal-overlay.ez-active .ez-modal-container {
    opacity: 1;
}

.ez-iframe-modal {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- Botón Cerrar Modal --- */
.ez-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000000 !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    outline: none !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
}

.ez-modal-close:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1) !important;
    color: #ffffff !important;
}

.ez-modal-close svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
    display: block !important;
}

/* --- Spinner de Carga Premium --- */
.ez-loader-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.ez-spinner {
    animation: ez-rotate 2s linear infinite;
    width: 48px;
    height: 48px;
}

.ez-spinner .path {
    stroke: #3b82f6;
    stroke-linecap: round;
    animation: ez-dash 1.5s ease-in-out infinite;
}

@keyframes ez-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ez-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* --- Marcadores del Editor y Errores --- */
.ez-editor-placeholder {
    padding: 30px;
    text-align: center;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
}

.ez-error-message {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}

/* --- Botón Continuar --- */
.ez-continue-container {
    width: 100%;
    opacity: 0;
    transform: translateY(8px);
    animation: ez-fade-in-up 0.4s ease forwards;
}

.ez-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.ez-continue-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.ez-continue-btn:hover::before {
    left: 100%;
}

.ez-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

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

@keyframes ez-fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Control de Scroll del Fondo --- */
html.ez-modal-open,
body.ez-modal-open {
    overflow: hidden !important;
}

/* --- Responsividad Pantallas Pequeñas --- */
@media (max-width: 768px) {
    .ez-modal-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .ez-modal-close {
        top: 12px;
        right: 12px;
    }
}
