/* Contact section layout */

.contact-section {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 5rem);
    overflow: hidden;
}

.contact-section::after {
    position: absolute;
    top: -5rem;
    right: -4rem;
    z-index: 0;
    width: 15rem;
    height: 15rem;
    border: 1px solid rgba(46, 118, 87, 0.12);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.contact-intro,
.contact-form {
    position: relative;
    z-index: 1;
}

.contact-intro .section-eyebrow {
    margin-bottom: 0.9rem;
}

.contact-intro h2 {
    max-width: 440px;
    margin-bottom: 1rem;
}

.contact-intro > p:last-child {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* Form layout */

.contact-form {
    display: grid;
    gap: 1.15rem;
    padding: clamp(1.2rem, 3vw, 1.8rem);
    border: 1px solid rgba(21, 60, 49, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 16px 40px rgba(21, 60, 49, 0.07);
    backdrop-filter: blur(12px);
}

.contact-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.contact-field {
    display: grid;
    gap: 0.45rem;
}

.contact-field label {
    color: var(--forest);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.contact-field label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
}

.contact-field .form-control,
.contact-field .form-select {
    min-height: 3rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(21, 60, 49, 0.16);
    border-radius: 0.65rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--forest);
    font-family: inherit;
    font-size: 0.86rem;
    box-shadow: none;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.contact-field .form-control::placeholder {
    color: #89948d;
    opacity: 1;
}

.contact-field .form-control:hover,
.contact-field .form-select:hover {
    border-color: rgba(46, 118, 87, 0.4);
}

.contact-field .form-control:focus,
.contact-field .form-select:focus {
    border-color: var(--green);
    background-color: var(--white);
    box-shadow: 0 0 0 0.22rem rgba(46, 118, 87, 0.12);
}

.contact-field textarea.form-control {
    min-height: 8rem;
    resize: vertical;
    line-height: 1.55;
}

.contact-submit {
    justify-self: start;
    min-height: 3.1rem;
    margin-top: 0.2rem;
    cursor: pointer;
}

.contact-submit .bi {
    transition: transform 180ms ease;
}

.contact-submit:hover .bi {
    transform: translate(2px, -2px);
}

.contact-form-note {
    margin: -0.55rem 0 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.5;
}

.contact-field .form-control:invalid:not(:placeholder-shown) {
    border-color: #b65a4a;
}

.contact-field .form-control:invalid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 0.22rem rgba(182, 90, 74, 0.11);
}

.contact-field .form-control:valid:not(:placeholder-shown) {
    border-color: rgba(46, 118, 87, 0.55);
}

.contact-form :focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

/* Responsive layout */

@media (max-width: 767.98px) {
    .contact-section {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }

    .contact-intro h2 {
        max-width: 560px;
    }

    .contact-form {
        gap: 1rem;
    }
}

@media (max-width: 575.98px) {
    .contact-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .contact-form {
        padding: 1rem;
        border-radius: 0.85rem;
    }

    .contact-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-field .form-control,
    .contact-field .form-select,
    .contact-submit .bi {
        transition: none;
    }
}