/* Contact Us modal — mirrors the XSEED marketing site contact dialog.
   All rules are scoped under .contact-modal so they don't leak into Tailwind pages. */
.contact-modal {
    --contact-accent: #bc2026;
    --contact-panel-bg: #ffffff;
    --contact-panel-text: #2d2626;
    --contact-panel-muted: #6c5c5d;
    --contact-field-border: #d9d9d9;
    --contact-button-hover: #97191f;

    width: min(calc(100% - 48px), 980px);
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: 24px auto;
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: var(--contact-panel-bg);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-shadow: 0 32px 90px rgba(48, 18, 20, 0.3);
    font-family: "Lato", "Inter", Arial, Helvetica, sans-serif;
    text-align: left;
}

.contact-modal::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.contact-modal::backdrop {
    background: rgba(43, 24, 25, 0.62);
}

body.contact-open {
    overflow: hidden;
}

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

.contact-modal .contact__content {
    padding: 0 48px 48px;
    background: #ffffff;
    color: var(--contact-panel-text);
}

.contact-modal .contact__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 -48px;
    padding: 22px 42px 0;
    background: var(--contact-panel-bg);
}

.contact-modal .contact__close {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(188, 32, 38, 0.16);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f7efef 100%);
    color: var(--contact-accent);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-modal .contact__close:hover,
.contact-modal .contact__close:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(188, 32, 38, 0.3);
    box-shadow: 0 12px 24px rgba(68, 30, 31, 0.12);
}

.contact-modal .contact__close::before,
.contact-modal .contact__close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.contact-modal .contact__close::before {
    transform: rotate(45deg);
}

.contact-modal .contact__close::after {
    transform: rotate(-45deg);
}

.contact-modal .contact__title {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000000;
}

.contact-modal .contact__description {
    margin: 1em 0;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--contact-panel-muted);
    font-weight: 500;
}

.contact-modal .contact__description a {
    color: var(--contact-accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-modal .contact__form {
    padding: 28px 30px 20px;
    display: grid;
    gap: 12px;
    border: 0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 18px 46px rgba(21, 24, 39, 0.08),
        0 3px 8px rgba(21, 24, 39, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.contact-modal .contact__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.contact-modal .contact__email,
.contact-modal .contact__interest {
    grid-column: 1 / -1;
}

.contact-modal label {
    display: grid;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--contact-panel-text);
}

.contact-modal .req {
    color: var(--contact-accent);
    margin-left: 2px;
}

.contact-modal input,
.contact-modal textarea {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--contact-field-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fcfcfc;
    color: var(--contact-panel-text);
    font: inherit;
    font-weight: 400;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.contact-modal input::placeholder,
.contact-modal textarea::placeholder {
    color: #aaaaaa;
    font-size: 0.84rem;
    font-weight: 400;
    opacity: 1;
}

.contact-modal input:focus,
.contact-modal textarea:focus,
.contact-modal .phone-field select:focus {
    outline: 2px solid rgba(188, 32, 38, 0.16);
    border-color: rgba(188, 32, 38, 0.52);
    background: #ffffff;
}

.contact-modal textarea {
    min-height: 120px;
    line-height: 1.45;
    resize: vertical;
}

.contact-modal .phone-field {
    position: relative;
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    border-radius: 10px;
}

.contact-modal .phone-field:focus-within {
    outline: 2px solid rgba(188, 32, 38, 0.16);
}

.contact-modal .phone-field:focus-within select,
.contact-modal .phone-field:focus-within input {
    border-color: rgba(188, 32, 38, 0.52);
    background: #ffffff;
}

.contact-modal .phone-field select:focus,
.contact-modal .phone-field input:focus {
    outline: 0;
}

.contact-modal .phone-field select {
    min-width: 0;
    min-height: 58px;
    border: 1px solid var(--contact-field-border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #f8f8f8;
    color: var(--contact-panel-muted);
    font: inherit;
    font-weight: 700;
    padding: 0 26px 0 10px;
}

.contact-modal .phone-field select:focus {
    position: relative;
    z-index: 1;
    border-right: 1px solid rgba(188, 32, 38, 0.52);
}

.contact-modal .phone-field input {
    min-width: 0;
    border-radius: 0 10px 10px 0;
}

.contact-modal .contact__submit {
    justify-self: end;
    border: 0;
    border-radius: 999px;
    padding: 13px 24px;
    background: var(--contact-accent);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}

.contact-modal .contact__submit:hover,
.contact-modal .contact__submit:focus-visible {
    background: var(--contact-button-hover);
}

.contact-modal .contact__submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.contact-modal .contact__status {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--contact-panel-text);
}

.contact-modal .contact__status--error {
    color: var(--contact-accent);
}

/* Thank-you panel that replaces the form after a successful submit. */
.contact-modal .contact__success {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 36px 30px 30px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(21, 24, 39, 0.08);
    text-align: center;
}

.contact-modal .contact__form[hidden],
.contact-modal .contact__success[hidden] {
    display: none;
}

.contact-modal .contact__success-icon {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--contact-accent);
}

.contact-modal .contact__success-icon::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 13px;
    width: 12px;
    height: 24px;
    border: solid #ffffff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.contact-modal .contact__success-title {
    margin: 6px 0 0;
    color: var(--contact-panel-text);
    font-size: 1.25rem;
    font-weight: 800;
}

.contact-modal .contact__success-message {
    margin: 0 0 10px;
    max-width: 420px;
    color: var(--contact-panel-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-modal .contact__success .contact__submit {
    justify-self: center;
}

@media (max-width: 640px) {
    .contact-modal {
        width: min(calc(100% - 32px), 980px);
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        margin: 16px auto;
        border-radius: 22px;
    }

    .contact-modal .contact__content {
        padding: 0 20px 28px;
    }

    .contact-modal .contact__header {
        margin: 0 -20px;
        padding: 22px 20px 18px;
    }

    .contact-modal .contact__form {
        padding: 22px 20px 18px;
    }

    .contact-modal .contact__grid {
        grid-template-columns: 1fr;
    }
}

/* Header "Contact Us" trigger: pinned to the right edge on the menu line,
   taken out of flow so the existing menu keeps its original placement. */
header .nav-title-link.contact-nav-link {
    position: absolute;
    top: 50%;
    right: 48px;
    transform: translateY(-50%);
    white-space: nowrap;
}

/* All header text (nav links, Members, Contact Us) shares one fixed size
   at every width, independent of viewport or root font-size. */
#main-header .site-header-nav,
#main-header .nav-title-link,
#main-header .nav-feature-link {
    font-size: 12px;
    letter-spacing: 0.18em;
}

/* Room for Contact Us is reserved on the right only as far as the
   page gutter can't cover it: 48px edge + ~7rem label + 1.5rem gap. */
@media (min-width: 1024px) {
    #main-header > div:first-child {
        padding-right: max(3rem, calc(11.5rem - max(0px, (100vw - 80rem) / 2)));
    }

    #main-header .nav-title-link,
    #main-header .nav-feature-link {
        white-space: nowrap;
    }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    #main-header img[alt="MASTEREDGE Logo"] {
        height: 3rem;
    }

    #main-header nav > :not([hidden]) ~ :not([hidden]) {
        margin-left: 2rem;
    }

    #main-header .nav-feature-link {
        padding: 0.65rem 1.1rem;
    }
}

/* Tablet widths can't fit the full menu plus Contact Us at original sizes,
   so they use the hamburger menu (which already lists Contact Us). */
@media (min-width: 768px) and (max-width: 1023px) {
    #main-header nav,
    #main-header .nav-feature-link,
    #main-header .contact-nav-link {
        display: none;
    }

    #main-header .mobile-nav-toggle {
        display: inline-flex;
    }

    #main-header .mobile-nav-panel,
    #main-header .mobile-nav-backdrop {
        display: block;
    }
}

.contact-modal .contact__description strong {
    font-weight: 700;
    color: var(--contact-panel-text);
}

.contact-modal .contact__subheading {
    margin: 1.3rem 0px 0px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #6c5c5d;
}

.contact-modal .contact__subheading + .contact__description {
    margin-top: 0.5em;
}

/* "Bring the MASTEREDGE experience…" line — styled independently of .contact__subheading. */
.contact-modal .contact__tagline {
    margin: 0;
    padding: 0.2rem 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    color: #323232;
    text-align: center;
}

.contact-modal .contact__tagline + .contact__description {
    margin-top: 0.5em;
}
