/**
 * Paid-search landing heroes: keep the hero lead form and Send control in view,
 * and keep the Nora chat launcher off the submit button.
 *
 * Loaded after tm-hero-height-fix.css (separate file for cache busting).
 */

/* --------------------------------------------------------------------------
   Compact hero lead form (shared project-form.phtml inside CMS heroes)
   -------------------------------------------------------------------------- */

.cms-page-view .tm-hero #landing-contact-form.tm-form-panel,
.cms-page-view .tm-hero #landing-contact-form .tm-form-panel {
    padding: 1.25rem;
}

.cms-page-view .tm-hero #landing-contact-form[style*="margin-top"] {
    margin-top: 1rem !important;
}

.cms-page-view .tm-hero .tm-landing-form-panel form,
.cms-page-view .tm-hero #landing-contact-form > .space-y-4:not(.tm-landing-form-panel),
.cms-page-view .tm-hero #landing-contact-form.space-y-5 {
    gap: 0.5rem;
}

.cms-page-view .tm-hero .tm-landing-form-panel form.space-y-4 > * + * {
    margin-top: 0.5rem;
}

.cms-page-view .tm-hero .tm-input {
    margin-top: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 0.75rem;
}

.cms-page-view .tm-hero .tm-input--textarea {
    min-height: 3.25rem;
    max-height: 3.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    line-height: 1.35;
}

.cms-page-view .tm-hero .tm-landing-form-panel .tm-button {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    min-height: 2.75rem;
}

.cms-page-view .tm-hero .tm-landing-form-panel .tm-recaptcha-legal,
.cms-page-view .tm-hero .tm-landing-form-panel .recaptcha-legal,
.cms-page-view .tm-hero .tm-landing-form-panel [class*="recaptcha"] p {
    font-size: 0.65rem;
    line-height: 1.25;
    margin-top: 0.25rem;
}

/* Room for the launcher when the form column is full width (mobile stack). */
@media (max-width: 1023px) {
    .cms-page-view .tm-hero #landing-contact-form {
        scroll-margin-bottom: 5rem;
    }

    .cms-page-view .tm-hero .tm-landing-form-panel form {
        padding-bottom: 3.5rem;
    }
}

/* --------------------------------------------------------------------------
   Short laptop viewports (audit: 720p–1080p effective heights)
   -------------------------------------------------------------------------- */

@media (max-height: 920px) {
    .cms-page-view .tm-hero[class*="pt-"] {
        padding-top: 1.25rem !important;
    }

    .cms-page-view .tm-hero[class*="pb-"] {
        padding-bottom: 1.5rem !important;
    }

    .cms-page-view .tm-hero .relative.z-10[class*="pb-"] {
        padding-bottom: 1rem !important;
    }

    .cms-page-view .tm-hero h1 {
        font-size: clamp(1.35rem, 2.8vw, 1.75rem) !important;
        line-height: 1.15 !important;
        margin-bottom: 0.5rem !important;
    }

    .cms-page-view .tm-hero .tm-hero__heading {
        font-size: clamp(1.35rem, 2.8vw, 1.75rem) !important;
        line-height: 1.15 !important;
    }

    .cms-page-view .tm-hero h1 + p,
    .cms-page-view .tm-hero .text-base.lg\:text-lg {
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
        margin-bottom: 0.5rem !important;
    }

    .cms-page-view .tm-hero [class*="mb-6"] {
        margin-bottom: 0.75rem !important;
    }

    .cms-page-view .tm-hero [class*="mb-5"] {
        margin-bottom: 0.5rem !important;
    }

    .cms-page-view .tm-hero [class*="mb-4"] {
        margin-bottom: 0.5rem !important;
    }

    .cms-page-view .tm-hero [class*="mb-3"] {
        margin-bottom: 0.35rem !important;
    }

    .cms-page-view .tm-hero [class*="gap-8"],
    .cms-page-view .tm-hero [class*="gap-12"] {
        gap: 1rem !important;
    }

    .cms-page-view .tm-hero #landing-contact-form.tm-form-panel {
        padding: 1rem;
    }

    /* Panel intros are redundant with the copy column on tight heights. */
    .cms-page-view .tm-hero #landing-contact-form > .space-y-4 > .space-y-2:first-child {
        display: none;
    }

    .cms-page-view .tm-hero #landing-contact-form .border-t[class*="border-white"] {
        border-top-width: 0;
        padding-top: 0;
    }

    .cms-page-view .tm-hero #landing-contact-form .border-t[class*="border-white"] h2 {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }

    .cms-page-view .tm-hero #landing-contact-form .border-t[class*="border-white"] .tm-form-note {
        display: none;
    }

    .cms-page-view .tm-hero .tm-landing-form-panel label.tm-form-field:nth-of-type(3) {
        display: none;
    }
}

@media (max-height: 720px) {
    .cms-page-view .tm-hero .inline-flex.items-center.px-4.py-2.rounded-full {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.7rem;
    }

    .cms-page-view .tm-hero .tm-emergency-hero-ctas a,
    .cms-page-view .tm-hero [class*="hero-ctas"] a,
    .cms-page-view .tm-hero [class*="outline-cta"] {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* --------------------------------------------------------------------------
   Nora chat launcher — keep off the hero Send button (form is usually right)
   -------------------------------------------------------------------------- */

body.cms-page-view:has(#landing-contact-form) .tm-chatbot,
body.cms-page-view:has(.tm-hero #tm-landing-contact-form) .tm-chatbot {
    right: auto;
    left: 1.25em;
}

@media (max-width: 1023px) {
    body.cms-page-view:has(#landing-contact-form) .tm-chatbot,
    body.cms-page-view:has(.tm-hero #tm-landing-contact-form) .tm-chatbot {
        --tm-chatbot-launcher-size: 3.25rem;
        bottom: 1rem;
        left: 1rem;
    }
}

@media (min-width: 1024px) and (max-height: 920px) {
    body.cms-page-view:has(#landing-contact-form) .tm-chatbot,
    body.cms-page-view:has(.tm-hero #tm-landing-contact-form) .tm-chatbot {
        bottom: 1rem;
    }
}

/* --------------------------------------------------------------------------
   Mobile header lead row (phone + jump to hero form)
   -------------------------------------------------------------------------- */

.tm-header-mobile-lead {
    display: none;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header {
    display: flex;
    flex-direction: column;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header-mobile-lead {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 0.5rem;
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header-mobile-lead a {
    flex: 1 1 0;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header-mobile-lead__phone {
    border: 1px solid rgb(229 231 235);
    color: rgb(55 65 81);
    background: #fff;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header-mobile-lead__form {
    background: #0a3d91;
    color: #fff;
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header.tm-header--transparent .tm-header-mobile-lead__phone {
    border-color: rgb(255 255 255 / 0.35);
    color: #fff;
    background: rgb(255 255 255 / 0.12);
}

body.cms-page-view.tm-hero-lead-mobile-bar .tm-header.tm-header--transparent .tm-header-mobile-lead__form {
    background: #fff;
    color: #0a3d91;
}

@media (min-width: 768px) {
    body.cms-page-view.tm-hero-lead-mobile-bar .tm-header-mobile-lead {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Narrow phones: shorten stacked hero copy so the form + Send fit the viewport
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .cms-page-view .tm-hero.flex {
        align-items: flex-start !important;
    }

    .cms-page-view .tm-hero .relative.z-10.w-full[class*="pb-"] {
        padding-bottom: 0.75rem !important;
    }

    .cms-page-view .tm-hero #landing-contact-form > .space-y-1,
    .cms-page-view .tm-hero #landing-contact-form > .space-y-4:not(.tm-landing-form-panel),
    .cms-page-view .tm-hero #landing-contact-form > div:not(.tm-landing-form-panel):not(#tm-landing-contact-form) {
        display: none;
    }

    .cms-page-view .tm-hero [class*="hero-grid"] > div:first-child > p:nth-of-type(2),
    .cms-page-view .tm-hero .tm-qscore-hero-grid > div:first-child > p:nth-of-type(2) {
        display: none;
    }

    .cms-page-view .tm-hero [class*="hero-ctas"],
    .cms-page-view .tm-hero [class*="hero-grid"] > div:first-child > p.text-sm {
        display: none;
    }

    .cms-page-view .tm-hero h1 {
        font-size: 1.35rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }

    .cms-page-view .tm-hero [class*="hero-grid"] > div:first-child > .inline-flex.rounded-full {
        margin-bottom: 0.35rem !important;
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}
