/* =========================================================
   CONTACT MODAL
========================================================= */

.contact-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    visibility: hidden;
    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.4s ease,
        visibility 0.4s ease;
}

.contact-modal.is-open {
    visibility: visible;
    opacity: 1;

    pointer-events: auto;
}


/* =========================================================
   BACKDROP
========================================================= */

.contact-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(12, 12, 16, 0.65);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    opacity: 0;

    transition: opacity 0.4s ease;
}

.contact-modal.is-open
.contact-modal__backdrop {
    opacity: 1;
}


/* =========================================================
   PANEL
========================================================= */

.contact-modal__panel {
    position: absolute;

    top: 0;
    right: 0;

    width: min(620px, 92vw);
    height: 100%;

    overflow-y: auto;

    padding: 70px 55px 50px;

    background: var(--color-white);

    box-shadow:
        -20px 0 60px rgba(0, 0, 0, 0.12);

    transform: translateX(100%);

    transition:
        transform 0.5s cubic-bezier(.2, .7, .2, 1);
}

.contact-modal.is-open
.contact-modal__panel {
    transform: translateX(0);
}


/* =========================================================
   CLOSE
========================================================= */

.contact-modal__close {
    position: absolute;

    top: 24px;
    right: 26px;

    display: flex;

    width: 44px;
    height: 44px;

    align-items: center;
    justify-content: center;

    border: 1px solid rgba(30, 30, 36, 0.12);

    border-radius: 50%;

    background: transparent;

    color: var(--color-charcoal);

    font-size: 17px;

    cursor: pointer;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.contact-modal__close:hover {
    background: var(--color-indigo);

    color: var(--color-white);

    transform: rotate(90deg);
}


/* =========================================================
   HEADER
========================================================= */

.contact-modal__header {
    margin-bottom: 42px;
}

.contact-modal__kicker {
    margin: 0 0 18px;

    color: var(--color-indigo);

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.13em;

    text-transform: uppercase;
}

.contact-modal__header h2 {
    margin: 0;

    color: var(--color-charcoal);

    font-family: var(--font-heading);

    font-size: clamp(42px, 4vw, 58px);
    font-weight: 500;

    letter-spacing: -0.05em;
    line-height: 0.98;
}

.contact-modal__header > p:last-child {
    max-width: 500px;

    margin: 22px 0 0;

    color: rgba(30, 30, 36, 0.62);

    font-size: 15px;
    line-height: 1.65;
}


/* =========================================================
   FORM
========================================================= */

.contact-modal__form {
    display: flex;

    flex-direction: column;

    gap: 25px;
}

.contact-modal__field {
    display: flex;

    flex-direction: column;

    gap: 9px;
}

.contact-modal__field label {
    color: var(--color-charcoal);

    font-size: 12px;
    font-weight: 500;
}

.contact-modal__field label span {
    color: var(--color-indigo);
}

.contact-modal__field input,
.contact-modal__field select,
.contact-modal__field textarea {
    width: 100%;

    border: 0;
    border-bottom: 1px solid rgba(30, 30, 36, 0.18);

    border-radius: 0;

    padding: 11px 0 13px;

    background: transparent;

    color: var(--color-charcoal);

    font-family: inherit;
    font-size: 15px;

    outline: none;

    transition:
        border-color 0.3s ease;
}

.contact-modal__field textarea {
    resize: vertical;

    min-height: 100px;
}

.contact-modal__field input::placeholder,
.contact-modal__field textarea::placeholder {
    color: rgba(30, 30, 36, 0.35);
}

.contact-modal__field input:focus,
.contact-modal__field select:focus,
.contact-modal__field textarea:focus {
    border-color: var(--color-indigo);
}


/* =========================================================
   SUBMIT
========================================================= */

.contact-modal__actions {
    display: flex;

    justify-content: flex-end;

    padding-top: 8px;
}

.contact-modal__submit {
    display: inline-flex;

    align-items: center;

    gap: 14px;

    border: 0;

    padding: 8px 8px 8px 22px;

    border-radius: 60px;

    background: var(--color-indigo);

    color: var(--color-white);

    font-family: inherit;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        transform 0.3s ease,
        background-color 0.3s ease;
}

.contact-modal__submit:hover {
    transform: translateY(-2px);
}

.contact-modal__submit-icon {
    display: flex;

    width: 46px;
    height: 46px;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.14);

    transition: transform 0.3s ease;
}

.contact-modal__submit:hover
.contact-modal__submit-icon {
    transform: rotate(45deg);
}


/* =========================================================
   BODY LOCK
========================================================= */

body.contact-modal-open {
    overflow: hidden;
}

.contact-modal__spinner {
    display: none;

    width: 16px;
    height: 16px;

    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;

    animation: contact-spin .7s linear infinite;
}

.contact-modal__submit.is-loading
.contact-modal__spinner {
    display: inline-block;
}

.contact-modal__submit:disabled {
    opacity: .75;
    cursor: wait;
}

@keyframes contact-spin {
    to {
        transform: rotate(360deg);
    }
}


/* Response */

.contact-modal__response {
    margin-bottom: 22px;

    padding: 13px 15px;

    border-radius: 9px;

    font-size: 13px;
    line-height: 1.5;
}

.contact-modal__response.is-success {
    background: #eaf8ef;
    color: #207a42;
}

.contact-modal__response.is-error {
    background: #fff0f0;
    color: #b42318;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .contact-modal__panel {
        width: 100%;
        height: 100%;

        padding: 75px 24px 40px;
    }

    .contact-modal__header {
        margin-bottom: 35px;
    }

    .contact-modal__header h2 {
        font-size: 43px;
    }

    .contact-modal__form {
        gap: 22px;
    }

    .contact-modal__actions {
        justify-content: stretch;
    }

    .contact-modal__submit {
        width: 100%;

        justify-content: space-between;
    }

}