﻿
/* ============================================
   SPF Hero Widget Styles
   Depends on spf-landing-shared.css being
   loaded first (uses its CSS variables).
   All selectors are scoped under .sp-hero
   so this can never affect anything else
   on the page, and form-related selectors
   are scoped two levels deep specifically to
   out-specify Sitefinity's backend editor
   theme, which also styles plain <input>/
   <select> elements.
============================================ */

.sp-hero,
.sp-hero *,
.sp-hero *::before,
.sp-hero *::after {
    box-sizing: border-box;
}


/* ===== Section layout ===== */

.sp-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 110px 0 60px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--sp-ink);
}

    .sp-hero .sp-container {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 56px;
        align-items: center;
    }

@media (max-width: 940px) {
    .sp-hero .sp-container {
        grid-template-columns: 1fr;
    }
}

/* ===== Background layer — holds either the video or the fallback image ===== */

.sp-hero .sp-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--sp-ink);
}

    .sp-hero .sp-hero-bg::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 2;
        /* Dark gradient so white headline text stays readable over any photo/video */
        background: linear-gradient(100deg, rgba(18,33,29,0.88) 0%, rgba(18,33,29,0.55) 45%, rgba(18,33,29,0.25) 100%);
    }

.sp-hero .sp-hero-video {
    position: absolute;
    inset: 0;
}

    .sp-hero .sp-hero-video video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.sp-hero .sp-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ===== Hero copy (headline/description) ===== */

.sp-hero .sp-hero-copy h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-size: clamp(34px, 4.6vw, 58px);
    line-height: 1.03;
    color: var(--sp-white);
    margin: 0 0 20px;
}

.sp-hero .sp-hero-copy p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 440px;
    margin: 0 0 30px;
    line-height: 1.6;
}


/* ============================================
   Lead Capture Form Card

   IMPORTANT:
   .sp-form-card is the visual styling boundary.

   Sitefinity's backend editor is already rendered
   inside an ASP.NET form, so the browser may remove
   this widget's nested <form> element in edit mode.

   The surrounding .sp-form-card <div> remains in
   both frontend and backend rendering.
============================================ */

/* Lets the Sticky Mobile CTA widget's "scroll to form" button land just
   below our fixed header, instead of behind it. See sticky-mobile-cta.css
   for the corresponding scrollIntoView() call. */
.sp-form-card {
    scroll-margin-top: 95px;
}

.sp-hero .sp-form-card {
    background: var(--sp-white);
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
    position: relative;
}

    .sp-hero .sp-form-card h3 {
        font-family: 'Space Grotesk', sans-serif;
        font-size: 20px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--sp-ink);
        margin: 0 0 4px;
    }

    .sp-hero .sp-form-card .sp-form-sub {
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        line-height: 1.4;
        color: var(--sp-text-muted);
        margin-bottom: 20px;
    }

    /* ----- Field layout ----- */

    .sp-hero .sp-form-card .sp-field-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

        /* Only expand the gap on a row that actually has an invalid field in it —
   keeps a clean, untouched form at its original tight spacing, and only
   grows exactly where a .sp-field-error needs room to sit. */
        .sp-hero .sp-form-card .sp-field-row:has(.is-invalid) {
            margin-bottom: 24px;
        }

    .sp-hero .sp-form-card .sp-full {
        grid-column: 1 / -1;
        margin-bottom: 12px;
    }

        .sp-hero .sp-form-card .sp-full:has(.is-invalid) {
            margin-bottom: 24px;
        }

    .sp-hero .sp-form-card .sp-field-row-suite-zip {
        grid-template-columns: 1fr 1fr;
    }

    /* ----- Field appearance ----- */

    .sp-hero .sp-form-card input,
    .sp-hero .sp-form-card select {
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        margin: 0;
        padding: 11px 12px;
        border: 1px solid var(--sp-line);
        border-radius: 5px;
        box-shadow: none;
        font-family: 'Inter', sans-serif;
        font-size: 13.5px;
        font-weight: 400;
        line-height: 1.4;
        background: var(--sp-linen);
        color: var(--sp-ink);
    }

        .sp-hero .sp-form-card input:focus,
        .sp-hero .sp-form-card select:focus {
            border-color: var(--sp-terracotta);
            outline: none;
            box-shadow: none;
            background: var(--sp-white);
        }


    .sp-hero .sp-form-card select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 14px;
        padding-right: 34px;
    }

    .sp-hero .sp-form-card #promo-container:empty {
        display: none;
    }


    /* ----- Validation states ----- */

    .sp-hero .sp-form-card input.is-invalid,
    .sp-hero .sp-form-card select.is-invalid {
        border-color: #c62828;
        box-shadow: 0 0 0 1px #c62828;
    }

        .sp-hero .sp-form-card input.is-invalid:focus,
        .sp-hero .sp-form-card select.is-invalid:focus {
            border-color: #c62828;
            box-shadow: 0 0 0 1px #c62828;
        }

    .sp-hero .sp-form-card .sp-field {
        position: relative;
    }

    .sp-hero .sp-form-card .sp-field-error {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 3px;
        font-size: 11px;
        color: #A02020;
        line-height: 1.3;
    }

    .sp-hero .sp-form-card input.is-invalid ~ .sp-field-error,
    .sp-hero .sp-form-card select.is-invalid ~ .sp-field-error,
    .sp-hero .sp-form-card input.input-validation-error ~ .sp-field-error {
        display: block;
    }

    /* The shared make-appointment.js script falls back to this element
   for one specific case (an invalid zip lookup) instead of a native
   alert() popup — kept in the DOM and hidden visually, since the
   script checks whether it EXISTS, not whether it's visible. */
    .sp-hero .sp-form-card .form-error-message {
        display: none;
    }


    /* ----- Legal disclosure + submit button ----- */

    .sp-hero .sp-form-card .sp-legal {
        font-family: 'Inter', sans-serif;
        font-size: 10.5px;
        line-height: 1.55;
        color: var(--sp-text-muted);
        margin: 16px 0 18px;
    }

        .sp-hero .sp-form-card .sp-legal a {
            color: var(--sp-terracotta);
            text-decoration: underline;
        }

    .sp-hero .sp-form-card button[type="submit"] {
        width: 100%;
        justify-content: center;
        font-size: 15px;
        padding: 15px;
    }


/* ============================================
   Alert toast (replaces native alert() popups)

   Created by the alert-override script in
   Index.cshtml — catches any alert() call the
   shared make-appointment.js triggers that
   doesn't have its own inline fallback (e.g.
   "Verification failed", generic AJAX errors).
============================================ */

.sp-form-alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: #FBEAEA;
    border: 1px solid #E4A5A5;
    color: #A02020;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

    .sp-form-alert button {
        background: none;
        border: none;
        color: #A02020;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }


/* ============================================
   Compatibility override

   make-appointment.js hides the entire form via
   jQuery .hide() the moment submit is clicked.
   This forces it to stay visible instead, without
   touching that shared file at all.
============================================ */

.sp-hero #homepage-hero-form {
    display: block !important;
    margin-bottom: 0;
}

.sp-hero .sp-form-card .sp-fake-placeholder {
    position: absolute;
    left: 12px;
    top: 11px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: var(--sp-text-muted);
    pointer-events: none;
    line-height: 1.4;
}

.sp-hero .sp-form-card .sp-required-mark {
    color: #c62828;
}

.sp-hero .sp-form-card input:not(:placeholder-shown) + .sp-fake-placeholder {
    display: none;
}

/*Custom Dropdown*/

/* Hide the real <select> visually only — it must stay in the DOM,
   focusable-by-code, and readable by make-appointment.js's $().val()
   calls. Not display:none, since that can break some validation
   focus/blur behavior. */
.sp-hero .sp-form-card .sp-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sp-hero .sp-form-card .sp-custom-select {
    position: relative;
}

.sp-hero .sp-form-card .sp-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: auto;
    padding: 11px 12px;
    border: 1px solid var(--sp-line);
    border-radius: 5px;
    background: var(--sp-linen);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: var(--sp-text-muted);
    text-align: left;
    cursor: pointer;
}

    .sp-hero .sp-form-card .sp-custom-select-trigger.sp-has-value {
        color: var(--sp-ink);
    }

    .sp-hero .sp-form-card .sp-custom-select-trigger:focus {
        outline: none;
        border-color: var(--sp-terracotta);
        background: var(--sp-white);
    }

.sp-hero .sp-form-card .sp-custom-select-chevron {
    width: 14px;
    height: 14px;
    color: var(--sp-text-muted);
    flex-shrink: 0;
    transition: transform .15s ease;
}

.sp-hero .sp-form-card .sp-custom-select.sp-open .sp-custom-select-chevron {
    transform: rotate(180deg);
}

.sp-hero .sp-form-card .sp-custom-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--sp-white);
    border: 1px solid var(--sp-line);
    border-radius: 8px;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.2);
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
    margin: 0;
    list-style: none;
}

.sp-hero .sp-form-card .sp-custom-select-option {
    padding: 9px 10px;
    border-radius: 5px;
    font-size: 13.5px;
    color: var(--sp-ink);
    cursor: pointer;
}

    .sp-hero .sp-form-card .sp-custom-select-option:hover,
    .sp-hero .sp-form-card .sp-custom-select-option.sp-active {
        background: var(--sp-linen);
    }

    .sp-hero .sp-form-card .sp-custom-select-option[aria-selected="true"] {
        background: var(--sp-terracotta);
        color: var(--sp-white);
    }

/* Show the red border on the fake trigger when the REAL select has
   been marked invalid by make-appointment.js's existing validation —
   using :has() to reach "backwards" from the hidden select to its
   visible sibling, since CSS can't select a previous sibling directly. */
.sp-hero .sp-form-card .sp-field:has(select.is-invalid) .sp-custom-select-trigger {
    border-color: #c62828;
    box-shadow: 0 0 0 1px #c62828;
}


@media (max-width: 940px) {
    .sp-hero {
        display: block;
        min-height: 0;
        overflow: visible;
        padding: 0;
    }

        .sp-hero .sp-hero-bg {
            position: absolute;
            bottom: auto;
            height: 400px;
            overflow: hidden;
            z-index: 0;
        }

        .sp-hero .sp-container {
            display: block;
            position: relative;
            z-index: 1;
            padding-top: 360px;
            padding-bottom: 40px;
        }

        .sp-hero .sp-hero-copy {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1;
            display: flex;
            flex-direction: column;
            padding: 130px 20px 20px;
        }

            .sp-hero .sp-hero-copy p {
                max-width: none;
                margin-top: 30px;
            }

            .sp-hero .sp-hero-copy .sp-eyebrow {
                font-size: 10.5px;
                letter-spacing: 0.1em;
            }
}