/**
 * Form Popup: Slide-in Panel
 *
 * Opens when a user clicks a tooltip-enabled form link. Shows a preview
 * panel with title, description, and optional screenshot. The Continue
 * button opens the external URL in a new tab. Overlay or × dismisses.
 * Applies to KRS (Kelly Solutions) and WinWam online forms.
 */

/* ─── Overlay (dims page + click-catcher — cancels redirect on click) ────── */

.form-popup-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9998;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.form-popup-overlay.is-open {
    background-color: rgba(0, 0, 0, 0.35);
    pointer-events: all;
}

/* ─── Centered panel ────────────────────────────────────────────────────── */

.form-popup-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 512px;
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 80px);
    background-color: var(--color-white);
    border-radius: 8px;
    z-index: 9999;
    transform: translate(-50%, calc(-50% + 20px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow-y: auto;
    box-shadow: 0px 0px 6px rgba(66, 66, 66, 0.25);
    display: flex;
    flex-direction: column;
}

.form-popup-panel.is-open {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: all;
}

/* ─── Body content ───────────────────────────────────────────────────────── */

.form-popup-body {
    padding: 40px 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.form-popup-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.form-popup-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-black);
    margin: 0;
    text-align: center;
    line-height: 1.4;
    text-transform: none !important;
    letter-spacing: normal;
}

.form-popup-description {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    color: var(--color-black);
    line-height: normal;
    margin: 0;
    text-align: center;
}

/* ─── Screenshot preview ─────────────────────────────────────────────────── */

.form-popup-screenshot-wrap {
    width: 100%;
    background-color: #FAFAFD;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-popup-screenshot {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    object-position: top;
    border: 1px solid #E9ECF1;
    border-radius: 4px;
}

/* ─── Continue button ───────────────────────────────────────────────────── */

.form-popup-btn {
    width: 100%;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

/* ─── Close (×) button ──────────────────────────────────────────────────── */

.form-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-scda-grey);
    cursor: pointer;
    padding: 4px 8px;
}

.form-popup-close:hover {
    color: var(--color-black);
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */

@media screen and (max-width: 600px) {
    .form-popup-panel {
        max-height: calc(100dvh - 40px);
    }

    .form-popup-body {
        padding: 40px 24px 30px;
    }
}
