/* Project request modal */
.ProjectModal[hidden] {
    display: none;
}

.ProjectModal {
    display: grid;
    place-items: center;
    background: rgba(13, 22, 16, 0.76);
    opacity: 0;
    transition: opacity 180ms ease;

    position: fixed;
    z-index: 11000;
    inset: 0;

    padding: 28px;
}

.ProjectModal.IsOpen {
    opacity: 1;
}

.ProjectModal__Backdrop {
    position: absolute;
    inset: 0;
}

.ProjectModal__Dialog {
    display: grid;
    grid-template-columns: minmax(250px, 0.68fr) minmax(560px, 1.32fr);
    gap: 44px;
    background: var(--color-surface-soft);
    border: 1px solid rgba(77, 177, 77, 0.3);
    border-radius: 28px;
    box-shadow: 0 34px 100px rgba(5, 15, 8, 0.3);
    transform: translateY(18px) scale(0.985);
    transition: transform 180ms ease;

    position: relative;
    width: min(1180px, 100%);
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    padding: 42px;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: none;
}

.ProjectModal.IsOpen .ProjectModal__Dialog {
    transform: translateY(0) scale(1);
}

.ProjectModal__Header {
    position: absolute;
    z-index: 5;
    top: 18px;
    right: 18px;
}

.ProjectModal__HeaderTitle {
    display: none;
}

.ProjectModal__Close {
    background: var(--color-surface-base);
    border: 1px solid var(--color-border-default);
    border-radius: 50%;

    position: relative;

    width: 46px;
    height: 46px;
    padding: 0;

    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ProjectModal__Close span {
    display: block;
    position: absolute;
    inset: 50% auto auto 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    font-size: 0;
}

.ProjectModal__Close span::before,
.ProjectModal__Close span::after {
    content: '';
    background: var(--color-text-primary);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    transition: background-color 160ms ease;
}

.ProjectModal__Close span::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.ProjectModal__Close span::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.ProjectModal__Close:hover {
    background: var(--color-brand-primary);
    border-color: var(--color-brand-primary);
}

.ProjectModal__Close:hover span::before,
.ProjectModal__Close:hover span::after {
    background: var(--color-surface-base);
}

.ProjectModal__Close:focus-visible {
    outline: 3px solid var(--color-brand-primary-focus);
    outline-offset: 3px;
}

.ProjectModal__Intro {
    align-self: start;
    position: sticky;
    top: 0;
    padding: 7px 0;
}

.ProjectModal__Intro h2 {
    margin: 0 0 16px;
    max-width: 390px;
    font-size: clamp(34px, 3vw, 48px);
    line-height: 1.04;
}

.ProjectModal__Intro > p:not(.Eyebrow) {
    margin: 0;
    max-width: 390px;
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

.ProjectModal__Contacts {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 25px;
    font-size: 16px;
}

.ProjectModal__Contacts a {
    color: var(--color-brand-logo-dark);
    font-weight: 750;
}

.ProjectModal__Form {
    min-width: 0;
    padding-top: 7px;
}

body.ProjectModalOpen {
    overflow: hidden;
}

/* Shared form layout inside the modal */
.ProjectModal .LeadForm {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.ProjectModal .LeadForm label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.ProjectModal .LeadForm > label:not(.LeadForm__Half):not(.LeadForm__Wide) {
    grid-column: span 2;
}

.ProjectModal .LeadForm__Half {
    grid-column: span 3;
}

.ProjectModal .LeadForm label > span:first-child {
    font-size: 14px;
    font-weight: 650;
}

.ProjectModal .LeadForm input,
.ProjectModal .LeadForm select,
.ProjectModal .LeadForm textarea {
    background: var(--color-surface-base);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    width: 100%;
    min-height: 50px;
    padding: 11px 13px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ProjectModal .LeadForm input:hover,
.ProjectModal .LeadForm select:hover,
.ProjectModal .LeadForm textarea:hover {
    background-color: rgba(65, 174, 76, 0.06);
    border-color: rgba(65, 174, 76, 0.48);
}

.ProjectModal .LeadForm input:focus,
.ProjectModal .LeadForm select:focus,
.ProjectModal .LeadForm textarea:focus {
    background-color: var(--color-surface-base);
    border-color: var(--color-brand-primary);
    box-shadow: inset 0 0 0 1px var(--color-brand-primary);
}

.ProjectModal .LeadForm textarea {
    min-height: 104px;
    resize: vertical;
}

.ProjectModal .LeadForm__Wide {
    grid-column: 1 / -1;
}

.ProjectModal .LeadForm__Trap {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.ProjectModal .LeadForm__File input[type="file"] {
    position: absolute;
    width: 1px;
    min-height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ProjectModal .LeadForm__FileControl {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px dashed rgba(65, 174, 76, 0.58);
    border-radius: 10px;
    min-height: 70px;
    padding: 11px 15px;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ProjectModal .LeadForm__FileControl:hover,
.ProjectModal .LeadForm__FileControl:focus,
.ProjectModal .LeadForm__FileControl.IsDragOver {
    background: rgba(65, 174, 76, 0.08);
    border-color: var(--color-brand-primary);
    box-shadow: inset 0 0 0 1px var(--color-brand-primary);
    outline: none;
}

.ProjectModal .LeadForm__FileIcon {
    display: grid;
    place-items: center;
    background: var(--color-brand-primary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: var(--color-surface-base);
    font-size: 25px;
    line-height: 1;
}

.ProjectModal .LeadForm__FileControl strong,
.ProjectModal .LeadForm__FileControl small {
    display: block;
}

.ProjectModal .LeadForm__FileControl strong {
    font-size: 16px;
}

.ProjectModal .LeadForm__FileControl small,
.ProjectModal .LeadForm__FileMeta,
.ProjectModal .LeadForm__FileList {
    color: var(--color-text-secondary);
    font-size: 13px;
}

.ProjectModal .LeadForm__FileMeta {
    text-align: right;
}

.ProjectModal .LeadForm__FileList {
    display: none;
    margin-top: 3px;
}

.ProjectModal .LeadForm__FileList.HasFiles {
    display: block;
}

.ProjectModal .LeadForm__FileList.IsError,
.ProjectModal .LeadForm__Status.IsError {
    color: rgb(159, 45, 45);
}

.ProjectModal .LeadForm .LeadForm__Consent {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    align-items: start;
    column-gap: 9px;
    row-gap: 0;
}

.ProjectModal .LeadForm .LeadForm__Consent input {
    width: 17px;
    height: 17px;
    min-height: 17px;
    margin-top: 3px;
    padding: 0;
}

.ProjectModal .LeadForm .LeadForm__Consent > span {
    min-width: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.ProjectModal .LeadForm__Consent a {
    color: var(--color-brand-logo-dark);
    text-decoration: underline;
}

.ProjectModal .LeadForm__Footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ProjectModal .LeadForm__Footer .Button {
    min-height: 50px;
    font-size: 16px;
}

.ProjectModal .LeadForm__Status {
    margin: 0;
    font-size: 14px;
}

.ProjectModal .LeadForm__Status.IsSuccess {
    color: var(--color-brand-logo-dark);
}

/* Custom selects inside the modal */
.ProjectModal .CustomSelect {
    position: relative;
    width: 100%;
}

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

.ProjectModal .CustomSelect__Button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-surface-base);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    width: 100%;
    min-height: 50px;
    padding: 11px 13px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
}

.ProjectModal .CustomSelect__Button::after {
    content: '';
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
}

.ProjectModal .CustomSelect__Arrow {
    display: none;
}

.ProjectModal .CustomSelect__Button:focus-visible,
.ProjectModal .CustomSelect.IsOpen .CustomSelect__Button {
    border-color: var(--color-brand-primary);
    box-shadow: inset 0 0 0 1px var(--color-brand-primary);
    outline: none;
}

.ProjectModal .CustomSelect__List {
    display: none;
    background: var(--color-surface-base);
    border: 1px solid var(--color-border-default);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(31, 51, 37, 0.16);
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 250px;
    padding: 6px;
    overflow-y: auto;
}

.ProjectModal .CustomSelect.IsOpen .CustomSelect__List {
    display: grid;
}

.ProjectModal .CustomSelect__Option {
    background: transparent;
    border: 0;
    border-radius: 7px;
    padding: 10px 11px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.ProjectModal .CustomSelect__Option:hover,
.ProjectModal .CustomSelect__Option.IsSelected {
    background: var(--color-brand-primary);
    color: var(--color-surface-base);
}

@media screen and (max-width: 960px){
    .ProjectModal__Dialog {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 36px;
    }

    .ProjectModal__Intro {
        position: static;
        padding-right: 50px;
    }

    .ProjectModal__Intro h2,
    .ProjectModal__Intro > p:not(.Eyebrow) {
        max-width: 720px;
    }

    .ProjectModal__Contacts {
        margin-top: 16px;
    }
}

@media screen and (max-width: 620px){
    .ProjectModal {
        align-items: stretch;
        padding: 0;
    }

    .ProjectModal__Dialog {
        display: block;
        border: 0;
        border-radius: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: 0;
    }

    .ProjectModal__Header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: rgba(240, 248, 240, 0.98);
        border-bottom: 1px solid var(--color-border-default);
        position: sticky;
        z-index: 30;
        top: 0;
        right: auto;
        width: 100%;
        min-height: 70px;
        padding: 12px 18px;
    }

    .ProjectModal__HeaderTitle {
        display: block;
        font-size: 18px;
        line-height: 1.2;
    }

    .ProjectModal__Close {
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
    }

    .ProjectModal__Intro {
        padding: 26px 18px 0;
    }

    .ProjectModal__Intro h2 {
        margin-bottom: 12px;
        font-size: 33px;
    }

    .ProjectModal__Contacts {
        font-size: 15px;
    }

    .ProjectModal__Form {
        padding: 0 18px 24px;
        margin-top: 24px;
    }

    .ProjectModal .LeadForm {
        grid-template-columns: 1fr;
    }

    .ProjectModal .LeadForm__Wide {
        grid-column: auto;
    }

    .ProjectModal .LeadForm__Half,
    .ProjectModal .LeadForm > label:not(.LeadForm__Half):not(.LeadForm__Wide) {
        grid-column: auto;
    }

    .ProjectModal .LeadForm__FileControl {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .ProjectModal .LeadForm__FileIcon {
        width: 40px;
        height: 40px;
    }

    .ProjectModal .LeadForm__FileMeta {
        grid-column: 1 / -1;
        text-align: left;
    }

    .ProjectModal .LeadForm__Footer {
        align-items: stretch;
        flex-direction: column;
    }

    .ProjectModal .LeadForm__Footer .Button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce){
    .ProjectModal,
    .ProjectModal__Dialog {
        transition-duration: 0.01ms;
    }
}
