/* Оболочка форм с настраиваемым фоном */
.mz-form-shell {
    position: relative;
    overflow: hidden;
}

.mz-form-shell--plain {
    background: transparent;
}

.mz-form-shell--styled {
    border-radius: 10px;
}

.mz-form-shell__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.mz-form-shell__content {
    position: relative;
    z-index: 1;
}

/* Узоры */
.mz-form-shell--pattern-dots {
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 18px 18px;
}

.mz-form-shell--pattern-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 22px 22px;
}

.mz-form-shell--pattern-diagonal {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.06) 0,
        rgba(255, 255, 255, 0.06) 1px,
        transparent 1px,
        transparent 12px
    );
}

/* Светлый текст на тёмном фоне */
.mz-form-shell--light {
    color: #fff;
}

.mz-form-shell--light .mz-contacts-feedback__title,
.mz-form-shell--light .mz-modal__title,
.mz-form-shell--light .mz-cat-lead__title,
.mz-form-shell--light h1,
.mz-form-shell--light h2 {
    color: #fff;
}

.mz-form-shell--light .mz-contacts-feedback__text,
.mz-form-shell--light .mz-modal__lead,
.mz-form-shell--light .mz-cat-lead__text,
.mz-form-shell--light .mz-contacts-card__label {
    color: rgba(255, 255, 255, 0.88);
}

.mz-form-shell--light .mz-contacts-feedback__icon {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.mz-form-shell--light .mz-modal__close {
    color: rgba(255, 255, 255, 0.85);
}

.mz-form-shell--light .mz-field span {
    color: rgba(255, 255, 255, 0.92);
}

.mz-form-shell--light .mz-consent,
.mz-form-shell--light .mz-consent a {
    color: rgba(255, 255, 255, 0.82);
}

.mz-form-shell--light .mz-consent a {
    text-decoration-color: rgba(255, 255, 255, 0.45);
}

/* Модалки с формами — шире phone-modal (400px) */
.mz-modal__dialog.mz-form-shell {
    width: min(680px, calc(100vw - 40px));
    max-width: min(680px, calc(100vw - 40px));
}

/* Модалки с фоном */
.mz-modal__dialog.mz-form-shell--styled {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.12);
    padding: 0;
}

.mz-modal__dialog.mz-form-shell--styled .mz-form-shell__content {
    padding: 24px 28px 22px;
}

.mz-modal__dialog.mz-form-shell--plain {
    background: #fff;
    padding: 24px 28px 22px;
}

.mz-form-shell .mz-modal__lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: none;
}

.mz-modal__dialog.mz-form-shell .mz-form-shell__grid {
    grid-template-columns: minmax(200px, 42%) minmax(0, 58%);
    gap: 18px 28px;
}

.mz-modal__dialog.mz-form-shell .mz-form-shell__col--fields .mz-field input,
.mz-modal__dialog.mz-form-shell .mz-form-shell__col--fields .mz-field select {
    max-width: none;
}

.mz-modal__dialog.mz-form-shell .mz-callback-form > .mz-form-shell__actions--stack {
    margin-top: 14px;
    width: 100%;
}

/* Контакты: обратная связь */
.mz-contacts-feedback.mz-form-shell--styled {
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.mz-contacts-feedback.mz-form-shell--plain {
    background: #fff;
    border: 1px solid var(--mz-border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Категория: лид-форма */
.mz-cat-lead.mz-form-shell--styled {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.mz-cat-lead.mz-form-shell--plain {
    background: #fff;
}

/* Поля ввода остаются светлыми для контраста */
.mz-form-shell--light .mz-field input,
.mz-form-shell--light .mz-field textarea,
.mz-form-shell--light .mz-field select {
    background: #fff;
    color: var(--mz-text);
    border-color: rgba(15, 23, 42, 0.12);
}

.mz-form-shell--light .mz-alert--success {
    background: rgba(232, 245, 233, 0.95);
    color: #1b5e20;
}

.mz-form-shell--light .mz-alert--error {
    background: rgba(255, 235, 238, 0.95);
    color: #b71c1c;
}

.mz-auth-form__shell.mz-form-shell--styled {
    padding: 20px;
    margin-top: 8px;
}

/* ── Компактная вёрстка полей ── */
.mz-form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.mz-form-shell .mz-cat-lead__form,
.mz-form-shell .mz-callback-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.mz-form-shell__grid {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    gap: 16px 20px;
    align-items: start;
}

.mz-form-shell__col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.mz-form-shell__col--fields .mz-field input,
.mz-form-shell__col--fields .mz-field select {
    max-width: 280px;
}

.mz-form-shell__col--message {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100%;
}

.mz-form-shell__col--message .mz-field--message {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.mz-form-shell__col--message .mz-field--message textarea {
    flex: 1 1 auto;
    min-height: 7.5em;
    max-height: none;
}

.mz-form-shell__field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mz-form-shell .mz-field {
    display: block;
    margin: 0;
}

.mz-form-shell .mz-field span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
}

.mz-form-shell .mz-field input,
.mz-form-shell .mz-field textarea,
.mz-form-shell .mz-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    color: var(--mz-text, #1e293b);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mz-form-shell .mz-field textarea {
    min-height: 0;
    max-height: 5.5em;
    resize: vertical;
    line-height: 1.4;
}

.mz-form-shell .mz-field input:focus,
.mz-form-shell .mz-field textarea:focus,
.mz-form-shell .mz-field select:focus {
    outline: none;
    border-color: var(--mz-primary, #1e3a5f);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12);
}

.mz-form-shell .mz-field--full {
    width: 100%;
}

.mz-form-shell__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 2px;
}

.mz-form-shell__actions--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.mz-form-shell .mz-cat-lead__submit,
.mz-form-shell .mz-callback-form__submit {
    min-width: 140px;
    padding: 9px 20px;
    font-size: 14px;
}

/* Заголовки */
.mz-form-shell__title,
.mz-form-shell .mz-cat-lead__title {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.mz-form-shell .mz-modal__title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

.mz-form-shell .mz-cat-lead__text {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
}

.mz-form-shell .mz-contacts-feedback__head {
    margin-bottom: 10px;
    gap: 10px;
}

.mz-form-shell .mz-contacts-feedback__title {
    margin: 0 0 2px;
    font-size: 22px;
    font-weight: 600;
}

.mz-form-shell .mz-contacts-feedback__text {
    font-size: 13px;
    line-height: 1.4;
}

.mz-form-shell .mz-contacts-feedback__icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* Оболочка: меньше внутренних отступов */
.mz-cat-lead.mz-form-shell--styled,
.mz-cat-lead.mz-form-shell--plain {
    padding: 16px 18px;
    margin-top: 24px;
}

.mz-contacts-feedback.mz-form-shell--styled,
.mz-contacts-feedback.mz-form-shell--plain {
    padding: 14px 16px;
}

.mz-contacts-feedback__form {
    max-width: none;
}

.mz-form-shell .mz-contacts-feedback__form .mz-consent {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
}

.mz-form-shell .mz-contacts-feedback__form .mz-field {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .mz-contacts-feedback.mz-form-shell--styled,
    .mz-contacts-feedback.mz-form-shell--plain {
        padding: 14px 12px;
    }

    .mz-modal__dialog.mz-form-shell--styled .mz-form-shell__content {
        padding: 20px 16px 16px;
    }

    .mz-cat-lead.mz-form-shell--styled,
    .mz-cat-lead.mz-form-shell--plain {
        padding: 14px 12px;
    }
}

@media (max-width: 640px) {
    .mz-form-shell__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mz-form-shell__col--fields .mz-field input,
    .mz-form-shell__col--fields .mz-field select {
        max-width: none;
    }

    .mz-form-shell__field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mz-form-shell__actions {
        justify-content: stretch;
    }

    .mz-form-shell .mz-cat-lead__submit,
    .mz-form-shell .mz-callback-form__submit {
        width: 100%;
        min-width: 0;
    }

    .mz-form-shell__title,
    .mz-form-shell .mz-cat-lead__title {
        font-size: 20px;
    }

    .mz-form-shell .mz-modal__title,
    .mz-form-shell .mz-contacts-feedback__title {
        font-size: 19px;
    }
}
