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

.mtd-form-wrap {
    --mtd-yellow: #ffb20f;
    --mtd-yellow-dark: #e99b00;
    --mtd-black: #202020;
    --mtd-gray: #636363;
    --mtd-line: #d9d9d9;
    --mtd-soft: #f3f3f3;
    width: min(1160px, calc(100% - 32px));
    margin: clamp(36px, 6vw, 76px) auto;
    color: var(--mtd-black);
    font-family: inherit;
}

.mtd-form-head {
    min-height: 188px;
    padding: clamp(26px, 4vw, 48px);
    border: 0;
    border-radius: 12px 12px 0 0;
    background: var(--mtd-black);
    color: #fff;
}

.mtd-form-head > span {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--mtd-yellow);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mtd-form-head h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4.2vw, 52px);
    font-weight: 800;
    line-height: 1.05;
}

.mtd-form-head p {
    max-width: 720px;
    margin: 18px 0 0;
    color: #e8e8e8;
    font-size: clamp(16px, 1.8vw, 19px);
    line-height: 1.6;
}

.mtd-form {
    padding: clamp(22px, 4vw, 48px);
    border: 1px solid var(--mtd-line);
    border-top: 6px solid var(--mtd-yellow);
    border-radius: 0 0 12px 12px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .08);
}

.mtd-form-alert {
    margin-bottom: 24px;
    padding: 14px 16px;
    border-left: 5px solid #17833b;
    background: #effaf2;
    color: #174a26;
    font-weight: 700;
}

.mtd-form-alert.is-error {
    border-left-color: #b42318;
    background: #fff1f0;
    color: #8f1d15;
}

.mtd-form-section {
    min-width: 0;
    margin: 0;
    padding: 0 0 clamp(30px, 5vw, 54px);
    border: 0;
}

.mtd-form-section + .mtd-form-section {
    padding-top: clamp(30px, 5vw, 54px);
    border-top: 1px solid var(--mtd-line);
}

.mtd-form-section:last-child {
    padding-bottom: 0;
}

.mtd-form-section legend {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 24px;
    padding: 0;
    color: var(--mtd-black);
    font-size: clamp(21px, 2.6vw, 30px);
    font-weight: 800;
    line-height: 1.2;
}

.mtd-form-section legend span {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    height: 36px;
    padding: 0 10px;
    border-radius: 7px;
    background: var(--mtd-yellow);
    color: var(--mtd-black);
    font-size: 14px;
    letter-spacing: .08em;
}

.mtd-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.mtd-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.mtd-field > span {
    color: var(--mtd-gray);
    font-size: 15px;
    font-weight: 800;
}

.mtd-field b,
.mtd-consents b,
.mtd-required b {
    color: #bb1e10;
}

.mtd-field input,
.mtd-field select,
.mtd-field textarea {
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #bdbdbd;
    border-radius: 8px;
    background: #fff;
    color: var(--mtd-black);
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    box-shadow: none;
}

.mtd-field select:disabled {
    cursor: not-allowed;
    background: #eee;
    color: #777;
}

.mtd-field textarea {
    min-height: 112px;
    resize: vertical;
}

.mtd-field input:focus,
.mtd-field select:focus,
.mtd-field textarea:focus,
.mtd-photo__picker:focus-within,
.mtd-submit:focus-visible,
.mtd-photo button:focus-visible {
    outline: 3px solid rgba(255, 178, 15, .42);
    outline-offset: 2px;
    border-color: var(--mtd-yellow-dark);
}

.mtd-field--wide {
    grid-column: 1 / -1;
}

.mtd-section-note {
    margin: -10px 0 24px;
    color: var(--mtd-gray);
    line-height: 1.55;
}

.mtd-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.mtd-photo {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--mtd-line);
    border-radius: 10px;
    background: #fff;
}

.mtd-photo__picker {
    display: block;
    cursor: pointer;
}

.mtd-photo__picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.mtd-photo__preview {
    display: grid;
    place-content: center;
    gap: 5px;
    aspect-ratio: 4 / 3;
    margin-bottom: 14px;
    border: 2px dashed #a9a9a9;
    border-radius: 8px;
    background-color: var(--mtd-soft);
    background-position: center;
    background-size: cover;
    color: var(--mtd-black);
    text-align: center;
}

.mtd-photo__preview b {
    font-size: 16px;
}

.mtd-photo__preview small {
    color: var(--mtd-gray);
}

.mtd-photo__preview.has-image {
    border-style: solid;
    border-color: var(--mtd-yellow);
}

.mtd-photo > strong {
    color: var(--mtd-black);
    font-size: 16px;
    line-height: 1.35;
}

.mtd-photo > small {
    margin-top: 6px;
    color: var(--mtd-gray);
    line-height: 1.45;
}

.mtd-photo button {
    align-self: flex-start;
    margin-top: 12px;
    padding: 7px 10px;
    border: 1px solid #b5b5b5;
    border-radius: 6px;
    background: #fff;
    color: var(--mtd-black);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.mtd-detail-field {
    margin-top: 24px;
}

.mtd-consents {
    display: grid;
    gap: 13px;
}

.mtd-consents label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--mtd-gray);
    font-size: 14px;
    line-height: 1.5;
}

.mtd-consents input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    accent-color: var(--mtd-yellow-dark);
}

.mtd-consents a {
    color: var(--mtd-black);
    font-weight: 800;
    text-decoration: underline;
}

.mtd-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(100%, 420px);
    min-height: 62px;
    margin-top: 28px;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: var(--mtd-yellow);
    color: var(--mtd-black);
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 900;
    transition: background-color .18s ease, transform .18s ease;
}

.mtd-submit:hover {
    background: var(--mtd-yellow-dark);
    transform: translateY(-1px);
}

.mtd-submit:disabled {
    cursor: wait;
    opacity: .62;
    transform: none;
}

.mtd-submit i {
    font-size: 27px;
    font-style: normal;
    line-height: 1;
}

.mtd-required {
    margin: 12px 0 0;
    color: var(--mtd-gray);
    font-size: 12px;
}

.mtd-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.mtd-success {
    padding: clamp(36px, 7vw, 76px);
    border: 1px solid var(--mtd-line);
    border-top: 6px solid var(--mtd-yellow);
    border-radius: 0 0 12px 12px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .08);
}

.mtd-success > span {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: var(--mtd-yellow);
    color: var(--mtd-black);
    font-size: 30px;
    font-weight: 900;
}

.mtd-success h3 {
    margin: 20px 0 10px;
    font-size: clamp(26px, 4vw, 38px);
}

.mtd-success p {
    margin: 0 auto 12px;
    max-width: 680px;
    color: var(--mtd-gray);
    line-height: 1.6;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 780px) {
    .mtd-form-wrap {
        width: min(100% - 20px, 620px);
        margin-block: 28px;
    }

    .mtd-form-head {
        min-height: 0;
        padding: 26px 22px;
    }

    .mtd-form {
        padding: 24px 18px;
    }

    .mtd-form-grid,
    .mtd-photo-grid {
        grid-template-columns: 1fr;
    }

    .mtd-photo {
        display: grid;
        grid-template-columns: minmax(118px, 38%) 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 2px 14px;
        align-items: start;
    }

    .mtd-photo__picker {
        grid-row: 1 / 4;
    }

    .mtd-photo__preview {
        margin: 0;
    }

    .mtd-photo > small {
        margin-top: 4px;
    }

    .mtd-photo button {
        margin-top: 8px;
    }
}

@media (max-width: 430px) {
    .mtd-form-section legend {
        align-items: flex-start;
    }

    .mtd-photo {
        display: flex;
    }

    .mtd-photo__preview {
        width: 100%;
        margin-bottom: 12px;
    }

    .mtd-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mtd-submit {
        transition: none;
    }
}
