/* --- Variables de Marca --- */
:root {
    --po-primary: #1D9E75;
    --po-primary-hover: #15803d;
    --po-bg-upload: #f0fdf4;
    --po-text-main: #0f172a;
    --po-text-muted: #64748b;
    --po-text-light: #94a3b8;
    --po-radius: 24px;
    --po-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Estructura Base --- */
.po-hidden { display: none !important; }

#po-modal-container {
    position: fixed;
    inset: 0;
    z-index: 99999999;
    display: flex;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

#po-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    transition: var(--po-transition);
}

#po-window {
    position: relative;
    width: 100%;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transition: var(--po-transition);
    overflow: hidden;
}

/* --- UI: Logo y Cabecera --- */
.po-logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--po-text-main);
}

/* --- UI: Instrucciones y Disclaimer --- */
.po-instructions {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.po-instructions li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.po-disclaimer {
    font-size: 11px;
    color: var(--po-text-light);
    text-align: center;
    margin-top: 18px;
    padding: 0 10px;
}

/* --- UI: Componentes --- */
.po-upload-area {
    border: 2px dashed var(--po-primary);
    background: var(--po-bg-upload);
    padding: 40px 20px;
    border-radius: 20px;
    display: block;
    text-align: center;
    cursor: pointer;
    transition: var(--po-transition);
}

.po-upload-area:hover {
    background: #dcfce7;
    transform: scale(1.02);
}

.po-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--po-primary);
    border-radius: 50%;
    animation: po-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes po-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Lógica Responsive --- */

/* MOBILE: Bottom Sheet */
@media (max-width: 768px) {
    #po-modal-container { 
        align-items: flex-end; 
    }
    
    #po-window { 
        border-radius: var(--po-radius) var(--po-radius) 0 0; 
        padding: 16px 20px 32px 20px;
        transform: translateY(0);
        animation: po-slide-up 0.4s ease-out;
    }

    .po-drag-handle {
        width: 48px;
        height: 5px;
        background: #e2e8f0;
        border-radius: 10px;
        margin: 0 auto 20px;
    }

    #po-close-modal { display: none; } /* Se cierra tocando el overlay */
}

/* DESKTOP: Modal Central */
@media (min-width: 769px) {
    #po-modal-container { 
        align-items: center; 
    }

    #po-window { 
        max-width: 420px;
        border-radius: var(--po-radius);
        padding: 48px 40px;
        animation: po-fade-in 0.3s ease-out;
    }

    .po-drag-handle { display: none; }

    #po-close-modal {
        position: absolute;
        top: 24px;
        right: 24px;
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: var(--po-text-muted);
        transition: color 0.2s;
        line-height: 1;
    }

    #po-close-modal:hover { color: var(--po-text-main); }
}

/* --- Animaciones --- */
@keyframes po-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes po-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.browser-mockup {
    transition: transform 0.3s ease;
}

/* Evita problemas de scroll dentro del iframe en móviles */
.browser-content iframe {
    overflow: hidden;
}

/* Efecto opcional: un poco de profundidad al pasar el mouse */
.browser-mockup:hover {
    transform: translateY(-5px);
}