:root {
    --contact-blue: #0366d6;
    --contact-blue-dark: #024c9f;
    --contact-ink: #222222;
    --contact-muted: #606060;
    --contact-error: #b42318;
    --contact-success: #087a3e;
}

html.contact-lock,
html.contact-lock body {
    overflow: hidden;
}

.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-modal,
.contact-modal * {
    box-sizing: border-box;
}

.contact-modal.is-open {
    display: flex;
}

.contact-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 24, 36, 0.72);
    backdrop-filter: blur(4px);
}

.contact-modal__card {
    position: relative;
    z-index: 1;
    width: min(100%, 590px);
    max-width: 590px;
    max-height: calc(100vh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 34px;
    border-top: 7px solid var(--contact-blue);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    color: var(--contact-ink);
    font-family: inherit;
}

.contact-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f3f6;
    cursor: pointer;
}

.contact-modal__close span::before,
.contact-modal__close span::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 11px;
    width: 20px;
    height: 2px;
    background: #222222;
}

.contact-modal__close span::before {
    transform: rotate(45deg);
}

.contact-modal__close span::after {
    transform: rotate(-45deg);
}

.contact-modal__close:hover,
.contact-modal__close:focus-visible {
    background: #e2e8ef;
    outline: 2px solid var(--contact-blue);
    outline-offset: 2px;
}

.contact-modal__header {
    padding: 0 38px 22px 0;
}

.contact-modal__eyebrow {
    margin: 0 0 8px;
    color: var(--contact-blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.contact-modal__header h2 {
    margin: 0 0 10px;
    color: var(--contact-ink);
    font-size: clamp(27px, 5vw, 38px);
    font-weight: 800;
    line-height: 1.08;
}

.contact-modal__header > p:last-child {
    margin: 0;
    color: var(--contact-muted);
    font-size: 16px;
    line-height: 1.5;
}

.contact-form,
.contact-form__field {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.contact-form__field {
    margin-bottom: 15px;
    color: #333333;
    font-size: 13px;
    font-weight: 700;
}

.contact-form__field > span {
    display: block;
    margin-bottom: 6px;
}

.contact-form__field input {
    width: 100%;
    min-height: 50px;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #bcc5cf;
    border-radius: 6px;
    background: #ffffff;
    color: #171717;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
}

.contact-form__field input:focus {
    border-color: var(--contact-blue);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.14);
    outline: 0;
}

.contact-form__field.has-error input {
    border-color: var(--contact-error);
}

.contact-form__field.has-error::after {
    content: attr(data-error);
    display: block;
    margin-top: 5px;
    color: var(--contact-error);
    font-size: 12px;
    font-weight: 600;
}

.contact-form .iti {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.contact-form .iti input,
.contact-form .iti input[type="tel"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.contact-form .iti__flag-container {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    pointer-events: none;
}

.contact-form .iti__selected-flag {
    width: max-content;
    max-width: 100%;
    pointer-events: auto;
}

.contact-form .iti__country-list {
    z-index: 20;
    left: 0;
    right: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    overflow-x: hidden;
    white-space: normal;
    font-size: 14px;
    font-weight: 400;
    pointer-events: auto;
}

.contact-form .iti__country {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.contact-form .iti__country-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.contact-form .iti__dial-code {
    flex: 0 0 auto;
    margin-left: auto;
}

/* The open list is mounted on <body> so it cannot enlarge or sideways-scroll
   the modal card. contact.js sizes it to the phone field on desktop. */
.iti--container {
    z-index: 10020;
    min-width: 0;
    max-width: calc(100vw - 24px);
}

.iti--container .iti__country-list {
    left: 0;
    right: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    overflow-x: hidden;
    white-space: normal;
    font-size: 14px;
    font-weight: 400;
}

.iti--container .iti__country {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.iti--container .iti__country-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.iti--container .iti__dial-code {
    flex: 0 0 auto;
    margin-left: auto;
}

.iti--container .iti__flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 22px !important;
    background: none !important;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}

.contact-form .iti__selected-dial-code {
    color: #222222;
    font-weight: 600;
}

.contact-form .iti__flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 22px !important;
    background: none !important;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}

.contact-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0;
    color: #3f3f3f;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    cursor: pointer;
}

.contact-form__consent input {
    width: 19px;
    height: 19px;
    min-width: 19px;
    margin: 0;
    accent-color: var(--contact-blue);
}

.contact-form__message {
    display: none;
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 6px;
    background: #fff1f0;
    color: var(--contact-error);
    font-size: 14px;
    line-height: 1.45;
}

.contact-form__message.is-visible {
    display: block;
}

.contact-form__message.is-success {
    border: 1px solid #a6e1bf;
    background: #effaf4;
    color: var(--contact-success);
}

.contact-form__submit {
    width: 100%;
    margin-top: 14px;
    padding: 17px 22px;
    border: 0;
    border-radius: 7px;
    background: var(--contact-blue);
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.contact-form__submit:hover {
    background: var(--contact-blue-dark);
    transform: translateY(-1px);
}

.contact-form__submit:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

@media (max-width: 620px) {
    .contact-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .contact-modal__card {
        max-height: calc(100dvh - 20px);
        padding: 26px 20px 22px;
        border-radius: 10px;
    }

    .contact-modal__header {
        padding-right: 34px;
    }

    .contact-form__row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

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