:root {
    --pef-primary: var(--e-global-color-primary, #ff5a1f);
    --pef-text: var(--e-global-color-text, #1f2937);
}

html.pef-popup-open,
html.pef-popup-open body { overflow: hidden; }

.pef-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: .2s ease;
}

.pef-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pef-popup-dialog {
    position: relative;
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 34px;
    border-radius: 18px;
    background: #fff;
    color: var(--pef-text);
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
    font-family: inherit;
}

.pef-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 29px;
    cursor: pointer;
}

.pef-form,
.pef-form * { box-sizing: border-box; }

.pef-grid,
.pef-doc-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 18px;
}

.pef-form label {
    display: block;
    font-weight: 600;
}

.pef-form input[type="text"],
.pef-form input[type="email"],
.pef-form input[type="tel"],
.pef-form input[type="file"],
.pef-form select {
    width: 100%;
    min-height: 48px;
    margin-top: 7px;
    padding: 11px 13px;
    border: 1px solid #d9dde3;
    border-radius: 9px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.pef-form select:disabled {
    background: #f3f4f6;
    color: #777;
}

.pef-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #eceff3;
}

.pef-doc-group[hidden],
#pef-docs-box[hidden] {
    display: none !important;
}

.pef-privacy {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    font-weight: 500 !important;
}

.pef-submit {
    margin-top: 24px;
    padding: 13px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--pef-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.pef-alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 9px;
}

.pef-success { background: #e9f8ed; color: #17632c; }
.pef-error { background: #fdeaea; color: #9c1d1d; }

@media (max-width: 767px) {
    .pef-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .pef-popup-dialog {
        width: 100%;
        max-height: 94vh;
        padding: 26px 18px;
        border-radius: 18px 18px 0 0;
    }

    .pef-grid,
    .pef-doc-group {
        grid-template-columns: 1fr;
    }
}