/* ============================================================
   Contact page (Home/Contact) - revamp.
   Photo banner (heading + green rule + subtitle, hardcoded text kept
   verbatim) + a centered form card. Everything is scoped under
   .contact-revamp so nothing leaks to other pages.

   The form itself is whichever ViewBag.EmbedFormCodes["ContactForm"] /
   the native ContactForm partial already renders (Contact.cshtml decides
   that, unchanged) - this file only restyles it via !important overrides
   against both the AC embed's own classes (._form, ._form-label, ._submit,
   .iti, .g-recaptcha, ...) and the native Bootstrap partial's classes
   (.control-label, .form-control, .form-in-middle, .btn-block, ...) so
   either one renders correctly. Field names, ids, data-val-* attributes,
   and the submit handler are untouched - CSS only.
   ============================================================ */

.contact-revamp {
    --cr-navy: #244565;
    --cr-navy-deep: #16233a;
    --cr-green: #21b389;
    --cr-green-dark: #1a9873;
    --cr-ink: #3c4a58;
    --cr-muted: #6b7a89;
    --cr-line: #e3e6ea;
    margin: 0 !important;
}

/* ---------- Banner ---------- */
.contact-revamp .cr-banner {
    position: relative;
    text-align: center;
    padding: 74px 24px 66px;
    background: #0d1420 url("/img/page-top-bg.jpg") center / cover no-repeat;
}

.contact-revamp .cr-scrim {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 30, .45);
}

.contact-revamp .cr-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

    .contact-revamp .cr-banner-inner h1 {
        font-family: 'Source Sans Pro', sans-serif;
        font-weight: 700;
        color: #fff;
        font-size: clamp(30px, 4vw, 42px);
        line-height: 1.15;
        margin: 0;
    }

.contact-revamp .cr-rule {
    width: 64px;
    height: 4px;
    background: var(--cr-green);
    border-radius: 2px;
    margin: 16px auto 0;
}

.contact-revamp .cr-banner-sub {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 400;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: 18px;
}

/* ---------- Form section ---------- */
.contact-revamp .cr-main {
    background: #fff;
    padding: 60px 0 80px;
}

.contact-revamp .cr-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.contact-revamp .cr-heading {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 700;
    color: var(--cr-navy);
    font-size: clamp(22px, 2.8vw, 30px);
    line-height: 1.3;
    text-align: center;
    margin: 0 0 38px;
}

.contact-revamp .cr-card {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--cr-line);
    border-radius: 14px;
    padding: 38px;
    box-shadow: 0 6px 18px rgba(22, 35, 58, .06);
}

/* ===== Form re-theme - AC "ContactForm" embed + native ContactForm partial ===== */

/* AC's own form title / box chrome is redundant inside our card. */
#contactFormCard ._form-title {
    display: none !important;
}

#contactFormCard ._form,
#contactFormCard ._form-content,
#contactFormCard form._form,
#contactFormCard .form-in-middle,
#contactFormCard .form-horizontal {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

    #contactFormCard form._form {
        padding: 0 !important;
    }

    #contactFormCard .form-in-middle .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #contactFormCard .form-in-middle [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

#contactFormCard ._form_element,
#contactFormCard .form-group {
    width: 100% !important;
    float: none !important;
    margin: 0 0 22px !important;
}

/* Labels (AC ._form-label + native .control-label). */
#contactFormCard ._form-label,
#contactFormCard .control-label,
#contactFormCard label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--cr-navy) !important;
    margin-bottom: 7px !important;
    width: auto !important;
    text-align: left !important;
}

#contactFormCard .field-required,
#contactFormCard label span {
    color: #d0453f !important;
}

/* Inputs / textarea / select (AC + native Bootstrap .form-control). */
#contactFormCard input[type="text"],
#contactFormCard input[type="email"],
#contactFormCard input[type="tel"],
#contactFormCard input[type="number"],
#contactFormCard textarea,
#contactFormCard select,
#contactFormCard .form-control {
    width: 100% !important;
    height: auto !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: var(--cr-navy-deep) !important;
    background: #fbfbfc !important;
    border: 1px solid var(--cr-line) !important;
    border-radius: 9px !important;
    padding: 13px 14px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

    #contactFormCard textarea,
    #contactFormCard textarea.form-control {
        min-height: 120px !important;
        resize: vertical !important;
    }

    #contactFormCard input::placeholder,
    #contactFormCard textarea::placeholder {
        color: #9aa7b3 !important;
    }

    #contactFormCard input[type="text"]:focus,
    #contactFormCard input[type="email"]:focus,
    #contactFormCard input[type="tel"]:focus,
    #contactFormCard input[type="number"]:focus,
    #contactFormCard textarea:focus,
    #contactFormCard select:focus,
    #contactFormCard .form-control:focus {
        outline: none !important;
        border-color: var(--cr-green) !important;
        background: #fff !important;
        box-shadow: 0 0 0 3px rgba(33, 179, 137, .18) !important;
    }

/* Phone (intl-tel-input, only present if an AC embed uses it). The plugin
   positions its own flag dropdown with position:absolute inside .iti, so
   the wrapper must stay a plain block (flex would ignore that child and let
   the input render full-width underneath the flag). Border/radius go on
   the input itself; the input's left padding reserves room for the flag +
   dial code, and .iti__flag-container gets a background/divider so the two
   read as one control, without touching the plugin's own layout. */
#contactFormCard .iti,
#contactFormCard .intl-tel-input {
    display: block !important;
    width: 100% !important;
}

    #contactFormCard .iti input,
    #contactFormCard .intl-tel-input input {
        width: 100% !important;
        height: 47px !important;
        box-sizing: border-box !important;
        padding: 13px 14px 13px 84px !important;
        border: 1px solid var(--cr-line) !important;
        border-radius: 9px !important;
        background: #fbfbfc !important;
        transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    }

        #contactFormCard .iti input:focus,
        #contactFormCard .intl-tel-input input:focus {
            outline: none !important;
            border-color: var(--cr-green) !important;
            background: #fff !important;
            box-shadow: 0 0 0 3px rgba(33, 179, 137, .18) !important;
        }

    #contactFormCard .iti__flag-container {
        background: #f4f5f7 !important;
        border-right: 1px solid var(--cr-line) !important;
        border-radius: 9px 0 0 9px !important;
    }

/* reCAPTCHA: label/spacing only, widget itself untouched. */
#contactFormCard .g-recaptcha-field,
#contactFormCard .cr-recaptcha-field {
    margin: 0 0 22px !important;
}

#contactFormCard .g-recaptcha {
    max-width: 100%;
    overflow: visible;
}

/* The widget's native ~304px width doesn't fit the card's inner width once
   the card itself has shrunk to mobile padding (e.g. ~279px at a 375px
   viewport), so it must start scaling before the old 360px cutoff. */
@media (max-width: 400px) {
    #contactFormCard .g-recaptcha {
        transform: scale(.82);
        transform-origin: left top;
    }
}

@media (max-width: 340px) {
    #contactFormCard .g-recaptcha {
        transform: scale(.72);
    }
}

/* Submit (AC ._submit + native .btn-block) - medium-size button, left-aligned. */
#contactFormCard ._button-wrapper {
    width: 100% !important;
    text-align: left !important;
}

#contactFormCard ._submit,
#contactFormCard button[type="submit"],
#contactFormCard input[type="submit"],
#contactFormCard .btn-block {
    display: inline-block !important;
    width: auto !important;
    min-width: 160px !important;
    margin-top: 4px !important;
    background: var(--cr-green) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    font-size: 15.5px !important;
    border: 0 !important;
    border-radius: 9px !important;
    padding: 14px 30px !important;
    cursor: pointer !important;
    transition: background-color .18s ease;
}

    #contactFormCard ._submit:hover,
    #contactFormCard button[type="submit"]:hover,
    #contactFormCard input[type="submit"]:hover,
    #contactFormCard .btn-block:hover {
        background: var(--cr-green-dark) !important;
    }

    #contactFormCard ._submit:focus-visible,
    #contactFormCard button[type="submit"]:focus-visible,
    #contactFormCard .btn-block:focus-visible {
        outline: 3px solid rgba(33, 179, 137, .45) !important;
        outline-offset: 2px !important;
    }

/* Validation messages - keep them, just make them readable under the field. */
#contactFormCard .text-danger,
#contactFormCard .field-error,
#contactFormCard span.field_error {
    display: block !important;
    color: #d0453f !important;
    font-size: 13px !important;
    margin-top: 6px !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .contact-revamp .cr-banner {
        padding: 56px 24px 48px;
    }

    .contact-revamp .cr-main {
        padding: 44px 0 60px;
    }

    .contact-revamp .cr-card {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-revamp * {
        transition: none !important;
    }
}
