/* ===== POPUP OVERLAY (затемнение фона) ===== */
.masha-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999; /* очень высокий z-index, чтобы быть поверх всего */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.masha-popup-overlay.active {
    display: flex;
}

/* ===== POPUP КОНТЕЙНЕР ===== */
.masha-popup {
    background: #ffffff; /* полностью белый фон */
    border: 1px solid #735842;
    border-radius: 12px;
    padding: 40px 35px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    font-family: 'Alegreya SC', serif;
    color: #333333;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Скролл внутри попапа */
.masha-popup::-webkit-scrollbar {
    width: 6px;
}
.masha-popup::-webkit-scrollbar-thumb {
    background: #735842;
    border-radius: 3px;
}

/* ===== КРЕСТИК ЗАКРЫТИЯ ===== */
.masha-popup-close {
    position: absolute;
    top: 15px;
    right: 18px;
    font-size: 36px;
    line-height: 36px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    color: #735842;
    background: rgba(255,255,255,0.9);
    border: 2px solid #735842;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    padding: 0;
    font-family: Arial, sans-serif;
}

.masha-popup-close:hover {
    background: #735842;
    color: #ffffff;
}

/* ===== ЗАГОЛОВОК ===== */
.masha-popup h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 75px;
    color: #735842;
    margin: 0 0 30px 0;
    text-align: center;
    line-height: 1.0;
    word-wrap: break-word;
}

/* ===== ФОРМА ===== */
.masha-popup-form {
    background: #ffffff; /* полностью белый */
}

.masha-popup-form label {
    font-family: 'Alegreya SC', serif;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: #333;
}

.masha-popup-form input[type="text"],
.masha-popup-form input[type="tel"],
.masha-popup-form input[type="email"],
.masha-popup-form textarea,
.masha-popup-form select {
    font-family: 'Alegreya SC', serif;
    font-size: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #735842;
    border-radius: 6px;
    background: #ffffff;
    box-sizing: border-box;
    margin-bottom: 16px;
    color: #333;
}

.masha-popup-form textarea {
    resize: vertical;
    min-height: 70px;
}

.masha-popup-form input::placeholder,
.masha-popup-form textarea::placeholder {
    font-family: 'Alegreya SC', serif;
    color: #a08576;
    opacity: 1;
}

/* ===== ЧЕКБОКСЫ И РАДИО ===== */
.masha-options-group {
    margin-bottom: 16px;
    background: #ffffff;
}

.masha-options-group label {
    font-weight: 400;
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 6px;
    font-size: 13px;
}

.masha-options-group input[type="checkbox"],
.masha-options-group input[type="radio"] {
    margin-right: 5px;
}

/* ===== КАПЧА ===== */
.masha-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #ffffff;
}

.masha-captcha span {
    font-family: 'Alegreya SC', serif;
    font-size: 14px;
    color: #333;
}

.masha-captcha input {
    width: 80px;
    flex-shrink: 0;
}

/* ===== КНОПКА ОТПРАВИТЬ ===== */
.masha-popup-submit {
    font-family: 'Great Vibes', cursive;
    font-size: 36px; /* уменьшили на 40% от 60px ~ 36px */
    background: transparent;
    border: 2px solid #735842;
    color: #735842;
    border-radius: 12px;
    padding: 10px 30px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    line-height: 1.2;
}

.masha-popup-submit:hover {
    background: #735842;
    color: #fff;
}

/* ===== СООБЩЕНИЕ ОБ УСПЕХЕ ===== */
.masha-popup-success {
    text-align: center;
    font-family: 'Alegreya SC', serif;
    font-size: 18px;
    padding: 40px 20px;
    color: #735842;
    background: #ffffff;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
<span style="color: hsl(var(--primary)); font-weight: 500;">@media</span> (max-width: 768px) {
    .masha-popup {
        padding: 30px 20px;
        max-width: 100%;
        border-radius: 8px;
        margin: 10px;
    }

    .masha-popup h2 {
        font-size: 48px; /* уменьшаем заголовок на мобильных */
        margin-bottom: 20px;
    }

    .masha-popup-close {
        font-size: 30px;
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }

    .masha-popup-form input[type="text"],
    .masha-popup-form input[type="tel"],
    .masha-popup-form input[type="email"],
    .masha-popup-form textarea {
        font-size: 16px; /* чтобы не было зума на iOS */
        padding: 14px 12px;
    }

    .masha-popup-submit {
        font-size: 28px;
        padding: 12px 20px;
    }

    .masha-captcha {
        flex-direction: column;
        align-items: flex-start;
    }

    .masha-captcha input {
        width: 100%;
    }

    .masha-options-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 15px;
    }

    .masha-popup-overlay {
        padding: 10px;
        align-items: flex-start; /* чтобы попап был ближе к центру на iOS с SafeArea */
        padding-top: 5vh;
    }
}

/* Для очень маленьких экранов */
<span style="color: hsl(var(--primary)); font-weight: 500;">@media</span> (max-width: 400px) {
    .masha-popup h2 {
        font-size: 36px;
    }

    .masha-popup-submit {
        font-size: 24px;
    }

    .masha-popup {
        padding: 20px 15px;
    }
}
