/**
 * Mini App DEV — layout iframe corretora + gerador.
 * Carregado apenas pelo servidor dev (dev_page.py); produção não inclui este CSS.
 */

#step-content.dev-broker-embed-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: 100%;
}

#step-content.dev-broker-embed-layout > .back-btn {
    flex-shrink: 0;
    align-self: flex-start;
    margin-bottom: 8px;
}

.dev-broker-embed-panel {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--bg-card, #141414);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.dev-broker-embed-panel.dev-broker-embed-panel--visible {
    display: flex;
}

.dev-broker-embed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary, #a1a1aa);
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dev-broker-embed-title {
    font-weight: 600;
    color: var(--text-primary, #fafafa);
}

.dev-broker-embed-open {
    flex-shrink: 0;
    font-size: 12px;
    color: #60a5fa;
    text-decoration: none;
    white-space: nowrap;
}

.dev-broker-embed-open:hover {
    text-decoration: underline;
}

.dev-broker-embed-frame-wrap {
    position: relative;
    width: 100%;
    background: #0a0a0a;
}

.dev-broker-embed-frame-wrap--fallback .dev-broker-embed-frame {
    display: none !important;
}

.dev-broker-embed-fallback {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 38vh;
    padding: 24px 16px;
    text-align: center;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
}

.dev-broker-embed-fallback[hidden] {
    display: none !important;
}

.dev-broker-embed-fallback-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #a1a1aa);
    max-width: 320px;
}

.dev-broker-embed-fallback-btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.dev-broker-embed-fallback-btn:hover {
    filter: brightness(1.08);
}

.dev-broker-embed-frame {
    display: block;
    width: 100%;
    height: 38vh;
    min-height: 200px;
    max-height: 480px;
    border: 0;
    background: #000;
}

/* Telas largas (dev no desktop): gerador à esquerda, iframe à direita — alinhado ao fluxo atual do produto */
@media (min-width: 900px) {
    #step-content.dev-broker-embed-layout {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    #step-content.dev-broker-embed-layout > .back-btn {
        flex: 0 0 100%;
    }

    #step-content.dev-broker-embed-layout > #analysis-content {
        flex: 1 1 320px;
        min-width: 280px;
        max-width: 420px;
        order: 1;
    }

    #step-content.dev-broker-embed-layout > .dev-broker-embed-panel {
        flex: 1 1 55%;
        min-width: 360px;
        order: 2;
        margin-bottom: 0;
        margin-left: 16px;
        align-self: stretch;
    }

    .dev-broker-embed-frame {
        height: min(72vh, 720px);
        min-height: 360px;
        max-height: none;
    }

    .dev-broker-embed-fallback {
        min-height: min(72vh, 720px);
    }
}
