:root {
    --mhq-teal: #01494b;
    --mhq-teal-2: #037376;
    --mhq-ink: #163f40;
    --mhq-muted: #657778;
    --mhq-border: #d9e1df;
    --mhq-surface: #ffffff;
    --mhq-warm: #f7f5ef;
    --mhq-error: #9f2d2d;
}

html.mhq-lock,
html.mhq-lock body {
    overflow: hidden !important;
}

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

.mhq-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    padding: 28px;
    font-family: Inter, Poppins, Arial, sans-serif;
    color: var(--mhq-ink);
}

.mhq-modal.is-open {
    display: grid;
    place-items: center;
}

.mhq-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 29, 30, .68);
    backdrop-filter: blur(3px);
}

.mhq-dialog {
    position: relative;
    width: min(1040px, 100%);
    max-height: calc(100vh - 56px);
    overflow: auto;
    border: 1px solid rgba(1, 73, 75, .18);
    border-radius: 18px;
    background: var(--mhq-surface);
    box-shadow: 0 28px 80px rgba(5, 35, 36, .28);
    animation: mhq-enter .22s ease-out;
}

@keyframes mhq-enter {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mhq-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 102px;
    padding: 22px 28px;
    color: #fff;
    background: var(--mhq-teal);
}

.mhq-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-right: 24px;
    border-right: 1px solid rgba(255,255,255,.22);
    font-weight: 700;
    letter-spacing: .06em;
}

.mhq-brand-mark {
    display: grid;
    grid-template-columns: repeat(2, 10px);
    gap: 2px;
}

.mhq-brand-mark i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: #fff;
}

.mhq-heading h2,
.mhq-section-heading h3,
.mhq-results h3 {
    margin: 0;
    color: inherit;
    font-family: Poppins, Inter, Arial, sans-serif;
}

.mhq-heading h2 {
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.2;
    font-weight: 650;
}

.mhq-heading p,
.mhq-section-heading p {
    margin: 4px 0 0;
}

.mhq-heading p {
    color: rgba(255,255,255,.82);
    font-size: 14px;
}

.mhq-close {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.1);
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
}

.mhq-close:hover,
.mhq-close:focus-visible {
    background: rgba(255,255,255,.2);
}

.mhq-form {
    padding: 0;
    background: #fbfcfb;
}

.mhq-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--mhq-border);
    background: #fff;
}

.mhq-tab input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mhq-tab span {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--mhq-border);
    border-right-width: 0;
    color: var(--mhq-teal);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: .15s ease;
}

.mhq-tab:first-child span {
    border-radius: 10px 0 0 10px;
}

.mhq-tab:last-child span {
    border-right-width: 1px;
    border-radius: 0 10px 10px 0;
}

.mhq-tab input:checked + span {
    border-color: var(--mhq-teal);
    color: #fff;
    background: var(--mhq-teal);
}

.mhq-tab input:focus-visible + span {
    outline: 3px solid rgba(3,115,118,.24);
    outline-offset: 2px;
}

.mhq-alert {
    margin: 20px 24px 0;
    padding: 13px 15px;
    border: 1px solid #e0abab;
    border-radius: 8px;
    color: var(--mhq-error);
    background: #fff5f5;
    font-size: 14px;
}

.mhq-property-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 22px 24px 0;
}

.mhq-property-grid > [data-mhq-section] {
    grid-column: 1 / -1;
    width: 100%;
}

.mhq-card {
    border: 1px solid var(--mhq-border);
    border-radius: 13px;
    background: #fff;
}

.mhq-transaction-card,
.mhq-contact-card {
    padding: 22px;
}

.mhq-contact-card {
    margin: 18px 24px 0;
    background: var(--mhq-warm);
}

.mhq-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.mhq-section-heading h3 {
    color: var(--mhq-teal);
    font-size: 19px;
    font-weight: 650;
}

.mhq-section-heading p {
    color: var(--mhq-muted);
    font-size: 12px;
}

.mhq-step {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--mhq-teal);
    font-size: 13px;
    font-weight: 700;
}

.mhq-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mhq-contact-fields {
    grid-template-columns: .65fr 1fr 1fr;
}

.mhq-fields label,
.mhq-fields label > span {
    display: block;
}

.mhq-fields label > span,
.mhq-holding legend {
    margin-bottom: 6px;
    color: var(--mhq-ink);
    font-size: 12px;
    font-weight: 650;
}

.mhq-fields input,
.mhq-fields select {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #cbd6d4;
    border-radius: 7px;
    color: #173f40;
    background: #fff;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
}

.mhq-fields input:focus,
.mhq-fields select:focus {
    border-color: var(--mhq-teal-2);
    outline: 3px solid rgba(3,115,118,.12);
}

.mhq-wide {
    grid-column: span 2;
}

.mhq-money {
    position: relative;
}

.mhq-money b {
    position: absolute;
    left: 12px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--mhq-teal);
    font-size: 14px;
}

.mhq-money input {
    padding-left: 29px;
}

.mhq-holding {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 17px 0 13px;
    padding: 0;
    border: 0;
}

.mhq-holding legend {
    float: left;
    margin: 0 4px 0 0;
}

.mhq-holding label,
.mhq-checkbox,
.mhq-consent {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #344e4f;
    font-size: 12px;
    cursor: pointer;
}

.mhq-holding input,
.mhq-checkbox input,
.mhq-consent input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--mhq-teal-2);
}

.mhq-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
    margin-top: 24px;
}

.mhq-consent {
    align-items: flex-start;
    margin-top: 18px;
    line-height: 1.5;
}

.mhq-consent input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.mhq-consent a {
    color: var(--mhq-teal);
    font-weight: 650;
}

.mhq-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding: 17px 24px;
    border-top: 1px solid var(--mhq-border);
    background: #fff;
}

.mhq-powered {
    color: #7c8989;
    font-size: 11px;
}

.mhq-submit,
.mhq-primary,
.mhq-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 50px;
    padding: 0 25px;
    border: 1px solid var(--mhq-teal);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.mhq-submit,
.mhq-primary {
    color: #fff;
    background: var(--mhq-teal);
}

.mhq-submit:hover,
.mhq-submit:focus-visible,
.mhq-primary:hover,
.mhq-primary:focus-visible {
    color: #fff;
    background: var(--mhq-teal-2);
}

.mhq-submit:disabled {
    cursor: wait;
    opacity: .72;
}

.mhq-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mhq-spin .7s linear infinite;
}

.mhq-submit.is-loading .mhq-spinner {
    display: inline-block;
}

@keyframes mhq-spin { to { transform: rotate(360deg); } }

.mhq-results {
    padding: 34px;
    background: #fbfcfb;
}

.mhq-results-top {
    margin-bottom: 28px;
    text-align: center;
}

.mhq-result-icon {
    display: grid;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--mhq-teal);
    font-size: 20px;
    font-weight: 800;
}

.mhq-result-kicker {
    color: var(--mhq-teal-2);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mhq-results h3 {
    margin-top: 7px;
    color: var(--mhq-teal);
    font-size: 27px;
}

.mhq-results-top p,
.mhq-disclaimer,
.mhq-reference,
.mhq-api-disclaimer {
    color: var(--mhq-muted);
    font-size: 13px;
}

.mhq-result-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    margin-bottom: 22px;
    border: 1px solid var(--mhq-border);
    border-radius: 13px;
    background: #fff;
}

.mhq-result-summary > div {
    display: grid;
    gap: 5px;
    padding: 22px 24px;
}

.mhq-result-summary > div + div {
    border-left: 1px solid var(--mhq-border);
}

.mhq-result-summary span {
    color: var(--mhq-muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mhq-result-summary strong {
    color: var(--mhq-teal);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.mhq-result-summary small {
    color: var(--mhq-muted);
    font-size: 11px;
}

.mhq-result-summary .mhq-summary-total {
    color: #fff;
    background: var(--mhq-teal);
}

.mhq-result-summary .mhq-summary-total span,
.mhq-result-summary .mhq-summary-total small {
    color: rgba(255,255,255,.74);
}

.mhq-result-summary .mhq-summary-total strong {
    color: #fff;
}

.mhq-result-intro {
    margin-bottom: 22px;
    padding: 18px 20px;
    border-left: 3px solid var(--mhq-teal-2);
    color: #415758;
    background: var(--mhq-warm);
    font-size: 13px;
    line-height: 1.55;
}

.mhq-breakdown {
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid var(--mhq-border);
    border-radius: 11px;
    background: #fff;
}

.mhq-breakdown > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--mhq-border);
    background: #f4f7f6;
}

.mhq-breakdown h4,
.mhq-breakdown p {
    margin: 0;
}

.mhq-breakdown h4 {
    color: var(--mhq-teal);
    font-family: Poppins, Inter, Arial, sans-serif;
    font-size: 15px;
}

.mhq-breakdown p {
    margin-top: 2px;
    color: var(--mhq-muted);
    font-size: 11px;
}

.mhq-breakdown > header > span {
    color: var(--mhq-teal);
    font-size: 16px;
    font-weight: 750;
    white-space: nowrap;
}

.mhq-result-list {
    overflow: hidden;
    margin: 0;
}

.mhq-result-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--mhq-border);
    font-size: 14px;
}

.mhq-result-list > div:last-child {
    border-bottom: 0;
}

.mhq-result-pending {
    display: grid;
    gap: 5px;
    padding: 22px;
    border-radius: 10px;
    text-align: center;
    background: var(--mhq-warm);
}

.mhq-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.mhq-secondary {
    color: var(--mhq-teal);
    background: #fff;
}

.mhq-disclaimer,
.mhq-reference,
.mhq-api-disclaimer {
    margin: 16px 0 0;
    text-align: center;
}

.mhq-api-disclaimer {
    padding: 17px 18px;
    border-radius: 9px;
    text-align: left;
    background: var(--mhq-warm);
    line-height: 1.5;
}

@media (max-width: 820px) {
    .mhq-modal { padding: 12px; }
    .mhq-dialog { max-height: calc(100vh - 24px); border-radius: 13px; }
    .mhq-header { grid-template-columns: 1fr auto; min-height: 88px; padding: 18px; }
    .mhq-brand { display: none; }
    .mhq-tabs { display: flex; overflow-x: auto; padding: 13px 14px; }
    .mhq-tab { flex: 0 0 auto; }
    .mhq-tab span { min-width: 132px; border-right-width: 1px; border-radius: 8px !important; }
    .mhq-property-grid { grid-template-columns: 1fr; padding: 16px 14px 0; }
    .mhq-contact-card { margin: 16px 14px 0; }
    .mhq-contact-fields { grid-template-columns: repeat(2, 1fr); }
    .mhq-wide { grid-column: span 1; }
}

@media (max-width: 560px) {
    .mhq-heading h2 { font-size: 18px; }
    .mhq-heading p { font-size: 12px; }
    .mhq-transaction-card, .mhq-contact-card { padding: 17px; }
    .mhq-fields, .mhq-contact-fields, .mhq-options { grid-template-columns: 1fr; }
    .mhq-holding { align-items: flex-start; flex-wrap: wrap; }
    .mhq-holding legend { width: 100%; }
    .mhq-footer { align-items: stretch; flex-direction: column-reverse; }
    .mhq-powered { text-align: center; }
    .mhq-submit { width: 100%; }
    .mhq-results { padding: 25px 18px; }
    .mhq-result-actions { flex-direction: column; }
    .mhq-result-summary { grid-template-columns: 1fr; }
    .mhq-result-summary > div + div { border-top: 1px solid var(--mhq-border); border-left: 0; }
    .mhq-breakdown > header { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .mhq-dialog,
    .mhq-spinner {
        animation: none;
    }
}
