body.has-consult-modal {
    overflow: hidden;
}

.consult-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    transition: visibility 0s linear 420ms;
    pointer-events: none;
}

.consult-modal.is-open {
    visibility: visible;
    transition: visibility 0s;
    pointer-events: auto;
}

.consult-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 220ms ease;
}

.consult-modal.is-open .consult-modal-backdrop {
    opacity: 1;
}

.consult-modal-dialog {
    position: relative;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    /* Giữ hàng lưới cao bằng khung modal để cột phải tự cuộn khi form dài */
    grid-template-rows: minmax(0, 1fr);
    width: 1024px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 10px 20px -5px rgba(15, 23, 42, 0.04);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    /* Trượt từ dưới màn hình lên khi mở, trượt xuống khi đóng */
    transform: translateY(100vh);
    transition: opacity 300ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.consult-modal.is-open .consult-modal-dialog {
    opacity: 1;
    transform: none;
}

/* Left column */

.consult-modal-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 48px 30px;
    border-right: 1px solid #E5E7EB;
    background-color: lightgray;
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: cover;
}

.consult-modal-side-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.consult-modal-side h2 {
    margin: 0;
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    line-height: 36px;
}

.consult-modal-side p {
    margin: 0;
    color: #ffffff;
    text-align: justify;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

.consult-modal-side-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.30);
    color: #94A3B8;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.consult-modal-side-bottom svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

/* Right column */

/* Không đặt position ở cột form: nút X bám theo khung modal nên đứng yên khi form cuộn */
.consult-modal-main {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 68px 48px 32px;
    overscroll-behavior: contain;
}

.consult-modal-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background 160ms ease;
}

.consult-modal-close:hover,
.consult-modal-close:focus-visible {
    background: #F1F5F9;
}

.consult-modal-close svg {
    width: 20px;
    height: 20px;
}

.consult-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
}

.consult-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.consult-field-full {
    grid-column: 1 / -1;
}

.consult-field label {
    color: #1E293B;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.consult-required {
    color: #EF0032;
}

.consult-input,
.consult-input-group {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #CBD5E1;
    background: rgba(248, 250, 252, 0.50);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.consult-input {
    padding: 11px 14px;
    color: #1E293B;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    outline: none;
}

.consult-input::placeholder,
.consult-input-group input::placeholder {
    color: #6B7280;
    opacity: 1;
}

.consult-input:focus,
.consult-input-group:focus-within {
    border-color: #EF0032;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(239, 0, 50, 0.10);
}

textarea.consult-input {
    min-height: 92px;
    resize: vertical;
}

.consult-select,
.consult-input-addon {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23334155' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    cursor: pointer;
}

.consult-select {
    padding-right: 40px;
    background-position: right 14px center;
    text-overflow: ellipsis;
}

.consult-select.is-placeholder {
    color: #6B7280;
}

.consult-select option {
    color: #1E293B;
}

.consult-input-group {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.consult-input-addon {
    flex: 0 0 auto;
    padding: 0 30px 0 12px;
    border: 0;
    border-right: 1px solid #CBD5E1;
    border-radius: 0;
    background-color: transparent;
    background-position: right 8px center;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    outline: none;
}

.consult-input-group input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    color: #1E293B;
    font: inherit;
    font-size: 14px;
    line-height: normal;
    outline: none;
}

.consult-error {
    color: #EF0032;
    font-size: 12px;
    line-height: 16px;
}

.consult-error:empty {
    display: none;
}

/* Agreement */

.consult-agree {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 24px;
}

.consult-checkbox {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #545963;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    cursor: pointer;
}

.consult-checkbox input {
    position: absolute;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    opacity: 0;
}

.consult-checkbox-box {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 4px;
    border: 1px solid #CBD5E1;
    background: #ffffff;
    transition: background 160ms ease, border-color 160ms ease;
}

.consult-checkbox input:checked + .consult-checkbox-box {
    border-color: #EF0032;
    background: #EF0032 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2L4.8 8.5L9.5 3.5' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.consult-checkbox input:focus-visible + .consult-checkbox-box {
    box-shadow: 0 0 0 3px rgba(239, 0, 50, 0.15);
}

.consult-checkbox a,
.consult-note a {
    color: #EF0032;
    font-weight: 500;
    text-decoration: none;
}

.consult-checkbox a:hover,
.consult-note a:hover {
    text-decoration: underline;
}

.consult-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Submit */

.consult-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 164px;
    margin-top: 24px;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: #EF0032;
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 17px;
    text-align: center;
    cursor: pointer;
    transition: background 180ms ease;
}

.consult-submit svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.consult-submit:hover,
.consult-submit:focus-visible {
    background: #FFA228;
}

.consult-submit:disabled,
.consult-submit.oc-loading {
    opacity: 0.7;
    cursor: wait;
}

.consult-note {
    margin: 46px 0 0;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
    color: #6B7280;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

/* Success state */

.consult-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 0;
    text-align: center;
}

.consult-success[hidden] {
    display: none;
}

.consult-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: #059669;
}

.consult-success h3 {
    margin: 0 0 10px;
    color: #1E293B;
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
}

.consult-success p {
    max-width: 420px;
    margin: 0;
    color: #545963;
    font-size: 15px;
    line-height: 22px;
}

@media (max-width: 900px) {
    .consult-modal-dialog {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        overflow-y: auto;
    }

    .consult-modal-side {
        gap: 0;
        padding: 24px 20px;
        border-right: 0;
    }

    .consult-modal-side h2 {
        font-size: 24px;
        line-height: 30px;
    }

    .consult-modal-side h2 br,
    .consult-modal-side p,
    .consult-modal-side-bottom {
        display: none;
    }

    .consult-modal-side-top {
        gap: 0;
    }

    .consult-modal-main {
        position: relative;
        overflow: visible;
        padding: 28px 24px 24px;
    }

    .consult-modal-close {
        position: absolute;
        top: -64px;
        right: 8px;
    }

    .consult-modal-close svg path {
        stroke: #ffffff;
    }

    .consult-modal-close:hover,
    .consult-modal-close:focus-visible {
        background: rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 640px) {
    .consult-modal {
        padding: 10px;
    }

    .consult-modal-dialog {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .consult-form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .consult-modal-main {
        padding: 24px 16px 20px;
    }

    .consult-submit {
        width: 100%;
    }

    .consult-note {
        margin-top: 28px;
    }
}

/* Ô dự án hiện sẵn, không sửa được */
.consult-input.is-readonly {
    background: #F1F5F9;
    color: #1E293B;
    cursor: default;
}

.consult-input.is-readonly:focus {
    border-color: #CBD5E1;
    box-shadow: none;
}

/* Ô "Chức vụ" đứng cạnh "Người liên hệ": nhãn trống để thẳng hàng */
.consult-label-spacer {
    visibility: hidden;
}

input[type="date"].consult-input,
input[type="time"].consult-input {
    min-height: 44px;
    cursor: pointer;
}

@media (max-width: 640px) {
    .consult-label-spacer {
        display: none;
    }
}
