@font-face {
    font-family: "NW Contact Inter";
    src: url("/assets/fonts/inter-var.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

.nw-contact-widget,
.nw-contact-widget *,
.nw-contact-widget *::before,
.nw-contact-widget *::after {
    box-sizing: border-box;
}

.nw-contact-widget {
    --nw-widget-ink: #171719;
    --nw-widget-paper: #fff;
    --nw-widget-muted: #626066;
    --nw-widget-line: rgb(23 23 25 / 16%);
    --nw-widget-purple: #8f008f;
    --nw-widget-gap: clamp(12px, 2vw, 28px);
    --nw-widget-height: 100vh;
    --nw-widget-width: 100vw;
    --nw-widget-bottom: 0px;
    --nw-widget-right: 0px;
    position: fixed;
    right: calc(var(--nw-widget-right) + max(var(--nw-widget-gap), env(safe-area-inset-right, 0px)));
    bottom: calc(var(--nw-widget-bottom) + max(var(--nw-widget-gap), env(safe-area-inset-bottom, 0px)));
    z-index: 9900;
    width: max-content;
    max-width: calc(var(--nw-widget-width) - 2 * var(--nw-widget-gap));
    color: var(--nw-widget-ink);
    font-family: "NW Contact Inter", Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

@supports (height: 100dvh) {
    .nw-contact-widget { --nw-widget-height: 100dvh; }
}

.nw-contact-widget button,
.nw-contact-widget input,
.nw-contact-widget textarea {
    font: inherit;
}

.nw-contact-widget button,
.nw-contact-widget a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nw-contact-widget :is(button, a):focus-visible {
    outline: 3px solid var(--nw-widget-purple);
    outline-offset: 4px;
}

.nw-contact-widget__badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 100%;
    min-height: 58px;
    padding: 6px 6px 6px 18px;
    border: 1px solid rgb(23 23 25 / 16%);
    border-radius: 14px;
    color: var(--nw-widget-ink);
    background: #fff;
    box-shadow: 0 8px 30px rgb(0 0 0 / 18%), 0 2px 6px rgb(0 0 0 / 8%);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.nw-contact-widget__badge:hover {
    transform: translateY(-2px);
    border-color: var(--nw-widget-purple);
}

.nw-contact-widget__badge-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-align: left;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}

.nw-contact-widget__badge-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--nw-widget-purple);
    box-shadow: 0 0 0 4px rgb(143 0 143 / 10%);
}

.nw-contact-widget__badge-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 8px;
    color: #fff;
    background: var(--nw-widget-purple);
}

.nw-contact-widget__portrait {
    position: absolute;
    right: 8px;
    bottom: calc(100% + 10px);
    width: 62px;
    height: 62px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgb(23 23 25 / 12%);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
    pointer-events: none;
}

.nw-contact-widget__portrait img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    object-position: center 24%;
}

.nw-contact-widget__badge[aria-expanded="true"] { visibility: hidden; }

.nw-contact-widget__badge.is-highlighted {
    border-color: var(--nw-widget-purple);
    box-shadow: 0 0 0 4px rgb(143 0 143 / 12%), 0 8px 30px rgb(0 0 0 / 18%);
}

.nw-contact-widget__panel {
    position: fixed;
    inset: auto;
    right: calc(var(--nw-widget-right) + max(var(--nw-widget-gap), env(safe-area-inset-right, 0px)));
    bottom: calc(var(--nw-widget-bottom) + max(var(--nw-widget-gap), env(safe-area-inset-bottom, 0px)));
    width: min(460px, calc(var(--nw-widget-width) - 2 * var(--nw-widget-gap) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: none;
    max-height: min(780px, calc(var(--nw-widget-height) - 2 * var(--nw-widget-gap) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 18px;
    color: var(--nw-widget-ink);
    background: var(--nw-widget-paper);
    box-shadow: 0 24px 80px rgb(0 0 0 / 28%);
    font: inherit;
    text-align: left;
    overscroll-behavior: contain;
}

.nw-contact-widget__panel:not([open]) { display: none; }
.nw-contact-widget__panel[open] { display: flex; flex-direction: column; }
.nw-contact-widget__panel::backdrop { background: rgb(17 17 19 / 36%); }

.nw-contact-widget__panel.is-open {
    animation: nw-contact-enter .25s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes nw-contact-enter {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reserve the scrollbar space before opening, so the page keeps its width. */
html {
    scrollbar-gutter: stable;
}

/* Lock only the viewport. Overflow on body would create a new scroll ancestor
   and detach the sticky hero and house sequence from the viewport. */
html.nw-contact-dialog-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.nw-contact-widget__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    color: #fff;
    background:
        linear-gradient(135deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 9px),
        var(--nw-widget-ink);
    background-size: 10px 10px;
}

.nw-contact-widget__header > div { min-width: 0; }

.nw-contact-widget__header span {
    display: block;
    margin: 0 0 6px;
    color: #d0cdd1;
    font-size: 12px;
    font-weight: 550;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.nw-contact-widget__header h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.nw-contact-widget__close {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 10px;
    color: #fff;
    background: rgb(255 255 255 / 10%);
    cursor: pointer;
}

.nw-contact-widget__close:hover { background: var(--nw-widget-purple); }
.nw-contact-widget__close:focus-visible { outline-color: #fff !important; }

.nw-contact-widget__close::before,
.nw-contact-widget__close::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.nw-contact-widget__close::before { transform: rotate(45deg); }
.nw-contact-widget__close::after { transform: rotate(-45deg); }

.nw-contact-widget__form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.nw-contact-widget__body {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 16px;
    min-height: 0;
    padding: 20px 22px 16px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #b8b5bb #f6f5f7;
    scroll-padding-block: 16px;
    -webkit-overflow-scrolling: touch;
}

.nw-contact-widget__intro {
    margin: 0;
    color: var(--nw-widget-muted);
    font-size: 16px;
    line-height: 1.55;
}

.nw-contact-widget__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 12px;
}

.nw-contact-widget__form label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #454248;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.5;
}

.nw-contact-widget__form input,
.nw-contact-widget__form textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid var(--nw-widget-line);
    border-radius: 8px;
    outline: none;
    color: var(--nw-widget-ink);
    background: #f7f7f8;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.nw-contact-widget__form :is(input, textarea)::placeholder { color: #7b7780; }
.nw-contact-widget__form :is(input, textarea):focus {
    border-color: var(--nw-widget-purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(143 0 143 / 10%);
}

.nw-contact-widget__form textarea {
    min-height: 96px;
    max-height: 260px;
    resize: vertical;
    scroll-margin-block: 16px;
}

.nw-contact-widget__hint,
.nw-contact-widget__status {
    margin: 0;
    color: var(--nw-widget-muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.nw-contact-widget__status[hidden] { display: none; }
.nw-contact-widget__status:not([hidden]) {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3eef5;
}

.nw-contact-widget__page-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    color: var(--nw-widget-ink);
    font-size: 14px;
    font-weight: 550;
    text-decoration: none;
}

.nw-contact-widget__actions {
    flex: 0 0 auto;
    padding: 14px 22px;
    border-top: 1px solid var(--nw-widget-line);
    background: #fff;
}

.nw-contact-widget__submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 8px 9px 8px 16px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--nw-widget-purple);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.nw-contact-widget__submit:hover { background: #760076; }
.nw-contact-widget__submit span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 5px;
    color: var(--nw-widget-ink);
    background: #fff;
}

@media (max-width: 540px) {
    .nw-contact-widget { --nw-widget-gap: 12px; }
    /* Neutralize the page template's generic form padding inside the panel. */
    .nw-contact-widget .nw-contact-widget__form { padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
    .nw-contact-widget__panel {
        width: calc(var(--nw-widget-width) - 2 * var(--nw-widget-gap) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        border-radius: 18px;
    }
    .nw-contact-widget__header { padding: 16px; gap: 12px; }
    .nw-contact-widget__body { padding: 18px 16px 14px; }
    .nw-contact-widget__actions { padding: 12px 16px; }
    .nw-contact-widget__row { grid-template-columns: minmax(0, 1fr); }
    .nw-contact-widget__portrait { width: 52px; height: 52px; }
}

@media (max-width: 374px) {
    /* Keep the contact entry visible without occupying most of a narrow screen. */
    .nw-contact-widget__badge { min-height: 50px; padding: 4px 4px 4px 12px; gap: 10px; }
    .nw-contact-widget__badge-label { font-size: 13px; gap: 8px; }
    .nw-contact-widget__badge-icon { width: 40px; height: 40px; flex-basis: 40px; }
    .nw-contact-widget__portrait { width: 44px; height: 44px; bottom: calc(100% + 8px); }
}

/* Also triggered by the visible viewport when the software keyboard is open. */
.nw-contact-widget[data-compact="true"] .nw-contact-widget__header { padding-block: 10px; }
.nw-contact-widget[data-compact="true"] .nw-contact-widget__header > div > span { display: none; }
.nw-contact-widget[data-compact="true"] .nw-contact-widget__header h2 { font-size: 20px; }
.nw-contact-widget[data-compact="true"] .nw-contact-widget__body { gap: 12px; padding-block: 12px; }
.nw-contact-widget[data-compact="true"] .nw-contact-widget__actions { padding-block: 8px; }
.nw-contact-widget[data-compact="true"] .nw-contact-widget__portrait { display: none; }

@media (prefers-reduced-motion: reduce) {
    .nw-contact-widget *,
    .nw-contact-widget *::before,
    .nw-contact-widget *::after {
        animation: none !important;
        transition: none !important;
    }
}
