/* Interactive demo launcher + fullscreen dialog — integration pages */

/* ---- Launch button (full-width band) ---- */
.demo-launch {
    --demo-accent: #3f51b5;
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin: 10px 0;
    padding: 15px;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(135deg, #f4f6ff 0%, #ffffff 65%);
    border: 1.5px solid #dfe3f7;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.demo-launch:hover {
    border-color: var(--demo-accent);
    transform: translateY(-2px);
}

.demo-launch:focus-visible {
    outline: 3px solid rgba(63, 81, 181, .45);
    outline-offset: 3px;
}

.demo-launch-icon {
    flex: 0 0 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--demo-accent);
    color: #fff;
}

.demo-launch-icon svg {
    width: 22px;
    height: 22px;
}

.demo-launch-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.demo-launch-text strong {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.demo-launch-text small {
    font-size: .88rem;
    line-height: 1.45;
    color: #5b6270;
}

.demo-launch-cue {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(63, 81, 181, .09);
    color: var(--demo-accent);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.demo-launch-cue svg {
    width: 15px;
    height: 15px;
    transition: transform .2s ease;
}

.demo-launch:hover .demo-launch-cue svg {
    transform: translateX(3px);
}

/* Second variant: the demo of Connect itself, not of the third-party app */
.demo-launch--connect {
    --demo-accent: #12152a;
    background: linear-gradient(135deg, #f7f7f9 0%, #ffffff 65%);
    border-color: #dcdfea;
    border-style: dashed;
}

.demo-launch--connect:hover {
    border-color: var(--demo-accent);
    border-style: solid;
}

.demo-launch--connect .demo-launch-cue {
    background: rgba(18, 21, 42, .07);
}

@media (max-width: 640px) {
    .demo-launch { padding: 16px; gap: 14px; }
    .demo-launch-cue { display: none; }
}

/* ---- Dialog ---- */
.demo-modal {
    /* inset + auto margins keep it centred whatever the viewport */
    inset: 0;
    margin: auto;
    width: min(1440px, 96vw);
    height: min(900px, 92vh);
    max-width: none;
    max-height: none;
    padding: 0;
    border: 1px solid #3f51b5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}

.demo-modal::backdrop {
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(3px);
}

.demo-modal[open] { animation: demoModalIn .22s ease-out; }
.demo-modal[open]::backdrop { animation: demoBackdropIn .22s ease-out; }

@keyframes demoModalIn {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@keyframes demoBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.demo-modal-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    padding: 0 10px 0 14px;
    border-bottom: 1px solid #e8eaef;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
}

.demo-modal-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.demo-modal-brand-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: #4b5563;
}

.demo-modal-label {
    font-size: .84rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

/* Pill carrying the demo name */
.demo-modal-title {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border: 1px solid #d7dae1;
    border-radius: 999px;
    background: #fff;
    font-size: .84rem;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-modal-title[hidden] { display: none; }

.demo-modal-close {
    flex: 0 0 30px;
    height: 30px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8eaef;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.demo-modal-close:hover { background: #f3f4f7; border-color: #d7dae1; color: #111827; }
.demo-modal-close:focus-visible { outline: 2px solid #3f51b5; outline-offset: 2px; }

@media (max-width: 560px) {
    .demo-modal-label { display: none; }
}

.demo-modal-body {
    position: relative;
    height: calc(100% - 48px);
    background: #fff;
}

.demo-modal iframe {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border: 1px solid #e9ebf3;
    opacity: 0;
    transition: opacity .25s ease;
}

.demo-modal.is-ready iframe { opacity: 1; }

/* Loader shown until the demo has painted */
.demo-modal-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.demo-modal.is-ready .demo-modal-loader { display: none; }

.demo-modal-loader span {
    width: 34px;
    height: 34px;
    border: 3px solid #e3e6f2;
    border-top-color: #3f51b5;
    border-radius: 50%;
    animation: demoSpin .8s linear infinite;
}

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

@media (max-width: 760px) {
    .demo-modal {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-launch,
    .demo-launch-cue svg,
    .demo-modal iframe { transition: none; }
    .demo-launch:hover { transform: none; }
    .demo-modal[open],
    .demo-modal[open]::backdrop { animation: none; }
    .demo-modal-loader span { animation-duration: 2s; }
}
.earlyseo-article p {
    margin: 0;
}