.contact-hero {
    position: relative;
    isolation: isolate;
    height: 350px;
    overflow: hidden;
    background: #f2f1ee url("/assets/images/banners/contact.png") center / cover no-repeat;
}

.contact-hero::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgb(245 243 239 / 96%) 0%,
        rgb(245 243 239 / 94%) 22%,
        rgb(245 243 239 / 82%) 34%,
        rgb(245 243 239 / 45%) 44%,
        rgb(245 243 239 / 12%) 52%,
        rgb(245 243 239 / 0%) 60%
    );
    content: "";
    pointer-events: none;
}

.contact-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.contact-hero__text {
    width: fit-content;
    max-width: 680px;
}

.contact-hero__text > p {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.contact-hero__text h1 {
    margin: 0;
    font-size: clamp(2.7rem, 4.4vw, 4.3rem);
    line-height: 1.1;
    letter-spacing: -.055em;
}

.contact-hero__text > span {
    display: block;
    margin-top: 22px;
    color: #454545;
    font-size: 1.05rem;
    line-height: 1.75;
    word-break: keep-all;
}

.contact-form-intro h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.2;
    letter-spacing: -.045em;
    word-break: keep-all;
}

.contact-form-section {
    padding-block: 80px;
    background: var(--color-bg);
}

.contact-form-layout {
    display: grid;
    grid-template-columns: minmax(240px, 27fr) minmax(0, 73fr);
    align-items: start;
    gap: clamp(36px, 4vw, 56px);
}

.contact-page .site-footer__grid {
    grid-template-columns: 1.1fr 1.3fr;
}

.contact-form-intro {
    position: sticky;
    top: 110px;
}

.contact-form-intro > p:last-child {
    margin: 20px 0 0;
    color: var(--color-text-sub);
    font-size: var(--font-size-copy-small);
}

.contact-form-intro > p:last-child span,
.contact-form label > span[aria-hidden="true"],
.contact-form legend > span,
.contact-privacy b {
    color: var(--color-primary);
}

.contact-form-panel {
    min-width: 0;
}

.contact-alert {
    margin-bottom: 28px;
    padding: 18px 20px;
    border-left: 3px solid;
    font-size: .9rem;
    line-height: 1.7;
}

.contact-alert--success {
    border-color: #14804a;
    background: #f1faf5;
    color: #11673d;
}

.contact-alert--error {
    border-color: var(--color-primary);
    background: rgb(230 0 19 / 4%);
    color: #6e1119;
}

.contact-alert strong {
    display: block;
}

.contact-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.contact-alert a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-form {
    position: relative;
}

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

.contact-form__types {
    margin: 0 0 30px;
    padding: 0;
    border: 0;
}

.contact-form__types legend,
.contact-field > label {
    display: block;
    margin-bottom: 10px;
    font-size: var(--font-size-copy-small);
    font-weight: 750;
}

.contact-form__types > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.contact-form__types label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.contact-form__types input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.contact-form__types label > span {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    background: var(--color-bg);
    color: #444;
    font-size: var(--font-size-copy-small);
    font-weight: 700;
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.contact-form__types input:checked + span {
    border-color: var(--color-primary);
    background: rgb(230 0 19 / 5%);
    color: var(--color-primary);
}

.contact-form__types input:focus-visible + span {
    outline: 3px solid rgb(230 0 19 / 22%);
    outline-offset: 2px;
}

.contact-as-notice {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-bg-soft);
}

.contact-as-notice[hidden] {
    display: none;
}

.contact-as-notice__heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--color-text);
    font-size: .92rem;
}

.contact-as-notice__heading svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex: 0 0 20px;
}

.contact-as-notice ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-as-notice li {
    position: relative;
    padding-left: 14px;
    color: var(--color-text-sub);
    font-size: var(--font-size-copy-small);
    line-height: 1.55;
}

.contact-as-notice li::before {
    position: absolute;
    top: .65em;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-primary);
    content: "";
}

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

.contact-field--full {
    margin-top: 24px;
}

.contact-field input,
.contact-field textarea {
    width: 100%;
    border: 1px solid #dcdfe3;
    border-radius: 7px;
    background: #fff;
    color: var(--color-text);
    font: inherit;
    font-size: .94rem;
    appearance: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.contact-field input {
    height: 50px;
    padding: 0 15px;
}

.contact-field textarea {
    min-height: 210px;
    padding: 14px 15px;
    line-height: 1.7;
    resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
    color: #aaa;
}

.contact-field input:focus,
.contact-field textarea:focus {
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(230 0 19 / 9%);
}

.contact-field input[aria-invalid="true"],
.contact-field textarea[aria-invalid="true"] {
    border-color: var(--color-primary);
}

.contact-field-error {
    margin: 7px 0 0;
    color: #b0000e;
    font-size: .78rem;
    line-height: 1.5;
}

.contact-privacy {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    background: var(--color-bg-soft);
}

.contact-privacy.has-error {
    border-color: var(--color-primary);
}

.contact-privacy strong {
    font-size: .9rem;
}

.contact-privacy dl {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 12px 0 0;
}

.contact-privacy dl > div {
    display: flex;
    gap: 9px;
    font-size: .78rem;
}

.contact-privacy dt {
    color: #444;
    font-weight: 750;
}

.contact-privacy dd {
    margin: 0;
    color: var(--color-text-sub);
}

.contact-privacy__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    color: var(--color-primary);
    font-size: .8rem;
    font-weight: 800;
}

.contact-privacy__link:hover,
.contact-privacy__link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-page.is-privacy-modal-open {
    overflow: hidden;
}

.privacy-modal {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.privacy-modal[hidden] {
    display: none;
}

.privacy-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(8 15 21 / 58%);
}

.privacy-modal__dialog {
    position: relative;
    width: min(880px, 100%);
    max-height: 80vh;
    max-height: 80dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 10px;
    background: var(--color-bg);
    box-shadow: 0 18px 48px rgb(0 0 0 / 22%);
}

.privacy-modal__dialog:focus {
    outline: none;
}

.privacy-modal__header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 18px 12px 24px;
    border-bottom: 1px solid var(--color-border);
}

.privacy-modal__header h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -.025em;
}

.privacy-modal__close {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.privacy-modal__close:hover,
.privacy-modal__close:focus-visible {
    background: var(--color-bg-soft);
    color: var(--color-primary);
}

.privacy-modal__close:focus-visible,
.privacy-modal__footer button:focus-visible {
    outline: 3px solid rgb(230 0 19 / 22%);
    outline-offset: 2px;
}

.privacy-modal__scroll {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px 30px;
}

.privacy-modal__document {
    width: 100%;
    max-width: none;
    margin: 0;
}

.privacy-modal__document .privacy-document__intro {
    padding-bottom: 32px;
}

.privacy-modal__document .privacy-clause {
    padding-block: 28px;
}

.privacy-modal__footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.privacy-modal__footer button {
    min-width: 112px;
    min-height: 44px;
    padding-inline: 20px;
    border: 1px solid var(--color-primary);
    border-radius: 7px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
}

.contact-privacy > label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    color: #333;
    font-size: var(--font-size-copy-small);
    font-weight: 700;
    cursor: pointer;
}

.contact-privacy input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 2px 0 0;
    accent-color: var(--color-primary);
}

.contact-privacy input:focus-visible {
    outline: 3px solid rgb(230 0 19 / 22%);
    outline-offset: 2px;
}

.contact-submit {
    min-width: 220px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-top: 30px;
    padding: 0 22px;
    border: 1px solid var(--color-primary);
    border-radius: 7px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease;
}

.contact-submit:hover,
.contact-submit:focus-visible {
    border-color: var(--color-primary-dark);
    background: var(--color-primary-dark);
}

.contact-submit:focus-visible {
    outline: 3px solid rgb(230 0 19 / 24%);
    outline-offset: 3px;
}

.contact-submit:disabled {
    cursor: wait;
    opacity: .68;
}

@media (max-width: 1024px) {
    .contact-form-layout {
        grid-template-columns: minmax(200px, 27fr) minmax(0, 73fr);
        gap: 36px;
    }
}

@media (max-width: 820px) {
    .contact-hero {
        height: clamp(220px, 30vh, 300px);
        background-position: 58% center;
    }

    .contact-hero::before {
        background: linear-gradient(
            90deg,
            rgb(245 243 239 / 98%) 0%,
            rgb(245 243 239 / 96%) 34%,
            rgb(245 243 239 / 82%) 52%,
            rgb(245 243 239 / 42%) 72%,
            rgb(245 243 239 / 0%) 100%
        );
    }

    .contact-hero__text > span {
        margin-top: 16px;
        font-size: .96rem;
    }

    .contact-form-layout {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .contact-form-intro {
        position: static;
    }
}

@media (max-width: 640px) {
    .contact-hero__text {
        max-width: min(90%, 400px);
    }

    .contact-hero__text h1 {
        font-size: clamp(2.6rem, 13vw, 3.65rem);
    }

    .contact-hero__text > span {
        font-size: var(--font-size-copy-small);
        line-height: 1.65;
    }

    .contact-form-section {
        padding-block: 48px;
    }

    .contact-as-notice ul {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .contact-as-notice {
        padding: 18px;
    }

    .contact-form__types > div {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .contact-form__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-field--full {
        margin-top: 20px;
    }

    .contact-field input {
        height: 48px;
    }

    .contact-field textarea {
        min-height: 190px;
    }

    .contact-privacy {
        padding: 17px;
    }

    .privacy-modal {
        padding: 16px;
    }

    .privacy-modal__dialog {
        max-height: 85vh;
        max-height: 85dvh;
    }

    .privacy-modal__header {
        min-height: 60px;
        padding: 8px 10px 8px 18px;
    }

    .privacy-modal__header h2 {
        font-size: 1.12rem;
    }

    .privacy-modal__scroll {
        padding: 22px 18px;
    }

    .privacy-modal__document .privacy-document__intro {
        padding-bottom: 26px;
    }

    .privacy-modal__document .privacy-clause {
        padding-block: 24px;
    }

    .privacy-modal__footer {
        padding: 12px 16px;
    }

    .privacy-modal__footer button {
        width: 100%;
    }

    .contact-privacy dl,
    .contact-privacy dl > div {
        display: grid;
        gap: 3px;
    }

    .contact-submit {
        width: 100%;
    }

    .contact-page .site-footer__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-form__types label > span,
    .contact-field input,
    .contact-field textarea,
    .contact-submit {
        transition: none;
    }
}
