#dsp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#dsp-box {
    background: #fff;
    border-radius: 12px;
    width: 580px;
    max-width: 96vw;
    max-height: 90vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

#dsp-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    z-index: 10;
    padding: 0;
    transition: color 0.2s;
}

#dsp-close:hover {
    color: #333;
}

/* ── Шаг 1: форма ── */
#dsp-step1 {
    display: flex;
    flex-direction: column;
}

.dsp-image {
    width: 100%;
    position: relative;
}

.dsp-image img {
    width: 100%;
    height: auto;
    display: block;
}

.dsp-img-close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    z-index: 5;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dsp-img-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

#dsp-form-wrap {
    padding: 28px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.dsp-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.2;
}

.dsp-subtitle {
    font-size: 0.9rem;
    color: #777;
    margin: 0 0 18px;
}

.dsp-error {
    color: #c0392b;
    font-size: 0.85rem;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #fdf0ef;
    border-radius: 5px;
    border-left: 3px solid #c0392b;
}

#dsp-email {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 0.95rem;
    margin-bottom: 6px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    color: #333;
}

#dsp-email:focus {
    border-color: #2a9d8f;
}

.dsp-checkbox-wrap {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.dsp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.4;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.dsp-checkbox-label span {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    flex: 1;
}

.dsp-checkbox-label input[type="checkbox"] {
    margin: 2px 0 0;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #CEE4F1;
}

.dsp-privacy-link {
    color: #CEE4F1;
    text-decoration: underline;
}

.dsp-privacy-link:hover {
    color: #90ad91;
}

#dsp-submit {
    width: 100%;
    padding: 13px;
    background: #CEE4F1;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#dsp-submit:hover:not(:disabled) {
    background: #90ad91;
}

#dsp-submit:active:not(:disabled) {
    transform: scale(0.98);
}

#dsp-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Шаг 2: успех ── */
#dsp-step2 {
    display: flex;
    flex-direction: column;
}

#dsp-image2 {
    width: 100%;
    display: flex;
    justify-content: center;
}

#dsp-image2 img {
    width: 50%;
    height: auto;
    display: block;
}

#dsp-success-wrap {
    padding: 28px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dsp-success-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
    line-height: 1.4;
}

#dsp-messenger-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dsp-messenger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
}

.dsp-messenger-btn:hover {
    opacity: 0.88;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.dsp-tg {
    background: #26a5e4;
}

.dsp-max {
    background: #6f54ae;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    #dsp-overlay {
        align-items: flex-end;
    }

    #dsp-box {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }

    #dsp-form-wrap {
        padding: 20px 20px 28px;
    }

    #dsp-success-wrap {
        padding: 20px 20px 28px;
    }

    #dsp-messenger-btns {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dsp-messenger-btn {
        flex: 1;
        min-width: 120px;
    }
}
