.mpt-form,
.mpt-enquiry-form {
    display: grid;
    gap: 1.25rem;
    max-width: 880px;
    width: 100%;
    min-width: 0;
}

.mpt-form__section,
.mpt-enquiry-form fieldset {
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    padding: 1.25rem;
    /* Chromium fieldsets default to min-width:min-content and overflow narrow viewports */
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.mpt-form__section legend,
.mpt-enquiry-form legend {
    font-weight: 700;
    padding: 0 .35rem;
    max-width: 100%;
}

.mpt-form__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
}

.mpt-form__field,
.mpt-enquiry-field {
    display: grid;
    gap: .4rem;
    margin: 0 0 1rem;
    min-width: 0;
    max-width: 100%;
}

.mpt-form__field--full {
    grid-column: 1 / -1;
}

.mpt-form__label {
    font-weight: 600;
}

.mpt-form__required {
    color: #b42318;
}

.mpt-form__field input,
.mpt-form__field select,
.mpt-form__field textarea,
.mpt-enquiry-field input,
.mpt-enquiry-field select,
.mpt-enquiry-field textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid #c7d2e3;
    border-radius: 8px;
    min-height: 48px;
    padding: .75rem;
    font-size: 16px; /* prevent iOS focus zoom */
    box-sizing: border-box;
}

.mpt-form__field textarea,
.mpt-enquiry-field textarea {
    min-height: 140px;
}

.mpt-form__field input:focus-visible,
.mpt-form__field select:focus-visible,
.mpt-form__field textarea:focus-visible,
.mpt-form__consent input:focus-visible {
    outline: 3px solid rgba(18, 48, 90, .22);
    outline-offset: 2px;
    border-color: #12305a;
}

.mpt-enquiry-field.has-error input,
.mpt-enquiry-field.has-error select,
.mpt-enquiry-field.has-error textarea,
.mpt-form__field.has-error input,
.mpt-form__field.has-error select,
.mpt-form__field.has-error textarea,
.mpt-form__consent.has-error,
.mpt-enquiry-consent.has-error {
    border-color: #b42318;
}

.mpt-form__error-summary,
.mpt-enquiry-errors {
    border: 1px solid #fecdca;
    background: #fffbfa;
    color: #7a271a;
    border-radius: 10px;
    padding: 1rem;
}

.mpt-form__error-summary a {
    color: inherit;
    font-weight: 700;
}

.mpt-form__honeypot,
.mpt-enquiry-hp {
    position: absolute;
    left: -10000px;
}

.mpt-enquiry-help {
    color: #667085;
    font-size: .9rem;
}

.mpt-quote-context {
    margin-bottom: 1rem;
    max-width: 100%;
    min-width: 0;
}

.mpt-quote-context__product {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
}

.mpt-quote-context__product > div {
    min-width: 0;
    flex: 1 1 auto;
}

.mpt-quote-context__product img {
    flex: 0 0 auto;
    max-width: 64px;
    height: auto;
}

.mpt-form__consent,
.mpt-enquiry-consent {
    border-radius: 8px;
    padding: .75rem;
    min-width: 0;
    max-width: 100%;
}

.mpt-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 0;
    min-width: 0;
    max-width: 100%;
}

.mpt-form__actions .mpt-button {
    max-width: 100%;
}

.mpt-enquiry-thanks,
.mpt-alternative-contact,
.mpt-contact-details {
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    padding: 1.25rem;
}

/* Align with MPT md breakpoint (--mpt-bp-md: 768px) */
@media (max-width: 768px) {
    .mpt-form__grid {
        grid-template-columns: 1fr;
    }

    .mpt-form__section,
    .mpt-enquiry-form fieldset {
        padding: 1rem 0.9rem;
    }

    .mpt-form__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mpt-form__actions .mpt-button {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .mpt-quote-context__product {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .mpt-form__section,
    .mpt-enquiry-form fieldset {
        padding: 0.85rem 0.75rem;
    }

    .mpt-form__field input,
    .mpt-form__field select,
    .mpt-form__field textarea,
    .mpt-enquiry-field input,
    .mpt-enquiry-field select,
    .mpt-enquiry-field textarea {
        min-height: 44px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mpt-form *,
    .mpt-enquiry-form * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
