/* ============================================================
   "Need a Place to Rent" (DynamicPages?id=5) - isolated redesign.
   Every rule is scoped under .dp-rent so nothing here can affect any
   other DynamicPage / TemplateID layout that shares the same view.
   Colors are the exact values specified for this page (warm off-white
   band, green CTAs) rather than the sitewide navy/teal tokens.

   Content boundary: the left column is raw CMS HTML (PageLDescription)
   and the right column is an ActiveCampaign embed - this file only
   wraps and styles them. No field, label, button text, or copy is
   added or changed here.
   ============================================================ */

.dp-rent {
    --rent-bg: #f7f5f157;
    --rent-heading: #252525;
    --rent-text: #252525;
    --rent-muted: #707070;
    --rent-border: #e6ebf1;
    --rent-teal: #2fd4a5;
    --rent-green: #21b389;
    --rent-green-dark: #1a9873;
    background: var(--rent-bg);
    color: var(--rent-text);
    font-family: 'Source Sans Pro', sans-serif;
}

/* ---------- Page heading ----------
   Plain centered heading on the page ground with the site's green accent
   bar beneath it - the same treatment as Our Services, Be Our Partner,
   Become an Investor and "Need To Sell Your House?". */
.dp-rent-head {
    text-align: center;
    padding: 56px 24px 0;
}

.dp-rent-head h1 {
    color: var(--rent-heading);
    font-family: 'Source Sans Pro', sans-serif;
    font-size: clamp(1.7rem, 3.4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    text-transform: capitalize;
    text-wrap: balance;
}

.dp-rent-rule {
    width: 64px;
    height: 4px;
    border-radius: 2px;
    background: var(--rent-green);
    margin: 14px auto 0;
}

/* ---------- Two-column layout ---------- */
.dp-rent-wrap {
    max-width: 1120px;
    margin: 0 auto;
    /* Was pulled up by -48px to overlap the old navy banner; with the
       banner gone the cards sit normally below the heading. */
    padding: 32px 24px 80px;
}

.dp-rent-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 860px) {
    .dp-rent-layout {
        grid-template-columns: 1fr;
    }

    .dp-rent-head {
        padding: 40px 20px 0;
    }
}

/* ---------- Cards ---------- */
.dp-form-card {
    background: #fff;
    border: 1px solid var(--rent-border);
    border-radius: 16px;
}

/* The left column reads flat on the page ground - no card chrome, so the
   copy sits directly on the background. Padding is kept so it stays
   aligned with the form card beside it. */
.dp-info-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 34px;
}

.dp-form-card {
    /* Exposed as a variable so the AC title/description band can break
       out flush to the card edges with matching negative margins at any
       width (see the header-band rules below). */
    --dp-form-pad: 30px;
    /* overflow:hidden stays - it's what clips the navy title band to the
       card's rounded top corners. */
    overflow: hidden;
    padding: var(--dp-form-pad);
}

@media (max-width: 860px) {
    /* Stacked: the column has no card chrome, so its own inset would just
       add to the wrapper's gutter and squeeze the copy. Run it flush and
       let .dp-rent-wrap provide the side spacing. */
    .dp-info-card {
        padding: 0 0 8px;
    }

    .dp-form-card {
        --dp-form-pad: 24px;
    }

    .dp-rent-wrap {
        padding: 22px 20px 56px;
    }
}

/* ---------- Left card: styling the CMS HTML generically ----------
   The left column is a single CMS-authored HTML blob, so these rules
   only set readable typography and safe defaults on whatever tags it
   contains. Per-element treatments the mockup shows (Section 8 as a
   badge, phone/email as icon rows, "APPLY HERE" as a pill button)
   depend on the exact CMS markup and are added once that markup is
   known - see the notes returned with this change. */
.dp-info-card {
    font-size: .95rem;
    line-height: 1.7;
    color: var(--rent-text);
}

/* The CMS wraps every visible line in its own <form class="SubmitDynamicForm">
   and leaves empty <p></p> spacers (and a stray <br>) between them. Those
   spacers were each contributing a bottom margin, which is what opened the
   large gaps under the heading and below the APPLY button. Collapse the
   spacers and put the rhythm on the real content blocks instead. */
    .dp-info-card > p {
        margin: 0;
    }

    .dp-info-card > br {
        display: none;
    }

    .dp-info-card > form.SubmitDynamicForm {
        display: block;
        margin: 0 0 18px;
    }

    .dp-info-card a {
        color: var(--rent-green-dark);
        text-decoration: none;
        font-weight: 600;
    }

        .dp-info-card a:hover {
            text-decoration: underline;
        }

    .dp-info-card img {
        max-width: 100%;
        height: auto;
    }

/* ---------- Left card: mockup-exact components ----------
   The CMS FormBuilder wrapped each line of the left content in its own
   <form class="SubmitDynamicForm"> (they carry no inputs - just text).
   So the blocks are styled by position among those direct-child forms:
     - form #2  = "We welcome Section 8"      -> mint trust badge
     - form #4  = phone / email               -> readable rows (the view
                                                 splits them onto 2 lines)
   and the APPLY link sits in the trailing <h3>. No content is changed
   here; the only server-side touch is the phone/email line-split in the
   view. If the CMS copy is reordered, these positional rules would need
   revisiting. */

/* "We welcome Section 8" -> mint trust badge (no icon, per request) */
.dp-info-card > form.SubmitDynamicForm:nth-of-type(2) {
    display: block;
    background: #f0fdf9;
    border: 1px solid #c9f0e2;
    /* Green accent down the left edge; the 12px radius keeps it curved so it
       follows the badge's rounded corners rather than sitting flat. */
    border-left: 3px solid var(--rent-green);
    border-radius: 12px;
    padding: 15px 18px;
    margin: 6px 0 18px;
    font-weight: 700;
    color: #16233a;
}

    .dp-info-card > form.SubmitDynamicForm:nth-of-type(2) b {
        font-weight: 700;
        color: #16233a;
    }

/* Phone / email block -> comfortable line spacing for the two lines
   (the <br> between them is inserted server-side in the view). */
.dp-info-card > form.SubmitDynamicForm:nth-of-type(4) {
    line-height: 1.9;
}

/* The "APPLY HERE" link lives inside the trailing <h3> -> green pill
   button, no icon. Its label and href render exactly as the CMS stores
   them; only the appearance changes here. */
.dp-info-card h3 {
    margin: 8px 0 0;
    line-height: 1;
}

    .dp-info-card h3 form.SubmitDynamicForm {
        display: inline-block;
    }

    .dp-info-card h3 a {
        display: inline-block;
        background: var(--rent-green);
        color: #fff !important;
        text-decoration: none !important;
        font-size: .95rem;
        font-weight: 700;
        padding: 14px 26px;
        border-radius: 8px;
        transition: background-color .15s ease;
    }

        .dp-info-card h3 a:hover {
            background: var(--rent-green-dark);
            color: #fff !important;
        }

        .dp-info-card h3 a b {
            font-weight: 700;
        }

/* ---------- ActiveCampaign embed re-theme (right card) ----------
   This form (_form_7) ships its OWN stylesheet scoped by a generated id
   (#_form_XXXX_) with !important on the mint-green form background and
   the yellow submit button. A plain .dp-form-card rule (classes only)
   can't beat an #id rule, so every override below is anchored on our
   own wrapper #rentFormCard and deliberately raised ABOVE AC's id-level
   specificity (e.g. "#rentFormCard form ._form_element input[type=...]"
   out-specifies "#_form_id ._form_element :is(input...)"). Only visual
   properties are touched - no field, label, option, or button text is
   changed, and the phone flag's own inline padding is left alone. */

/* Typeface: the AC embed ships its own font stack (arial / sans-serif) on
   the form root, title, labels, fields and submit, so the card rendered in
   a different face from the rest of the page. Force the site face across
   the whole form.

   Specificity: AC's strongest font rule is
   "#_form_ID_._inline-form ._row span:not(.field-required)" (1,3,1), and
   its stylesheet is injected by the embed script AFTER our <link> - so a
   tie would go to AC. Chaining our own wrapper classes ahead of
   #rentFormCard lifts this above that.

   reCAPTCHA is excluded: the widget's own iframe, its .g-recaptcha
   wrapper, and the hidden .g-recaptcha-response textarea are all left
   exactly as Google renders them. */
.dp-rent .dp-rent-layout .dp-form-card#rentFormCard,
.dp-rent .dp-rent-layout .dp-form-card#rentFormCard *:not(.g-recaptcha):not(.g-recaptcha-response):not(iframe) {
    font-family: 'Source Sans Pro', sans-serif !important;
}

/* Kill the form's own mint box so it fills our white card flush. */
#rentFormCard ._form_7,
#rentFormCard form._form {
    background: transparent !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

#rentFormCard ._form-content {
    width: 100% !important;
    /* No display override here on purpose: AC's own _show_thank_you() hides
       ._form-content and reveals ._form-thank-you on success. Forcing the
       form to stay visible left the submitted values sitting in the fields,
       so the stock hide-and-replace behaviour is kept. */
    margin: 0 !important;
}

/* AC's confirmation block: hidden until its script reveals it, then styled
   as a success panel in the page's green rather than a bare box. */
#rentFormCard ._form-content + ._form-thank-you,
#rentFormCard ._form-thank-you {
    margin-top: 18px !important;
    padding: 14px 16px !important;
    border: 1px solid #c9f0e2 !important;
    border-left: 3px solid var(--rent-green) !important;
    border-radius: 10px !important;
    background: #f0fdf9 !important;
    color: #16233a !important;
    font-weight: 700 !important;
    text-align: left !important;
}

/* Title + description -> navy gradient banner across the top of the
   card, matching the reference. AC renders the title and the intro as
   two separate blocks (._field_header and ._field_html); both are
   pulled flush to the card edges with negative margins equal to the
   card padding (--dp-form-pad), and the card's overflow:hidden + radius
   clip the banner's top corners. The two blocks butt together (no gap)
   so they read as one band. Selectors include ._form-content to out-
   specify AC's "#_form_id._inline-form ._form-title/._html-code". */
#rentFormCard ._form-content ._field_header,
#rentFormCard ._form-content ._field_html {
    background: #244565 !important;
    /* Explicit border-box width of card-inner + both paddings, offset
       left by one padding, so the band is flush on BOTH edges. (With the
       site's global box-sizing:border-box, a plain width:100% + negative
       right margin only reached flush-left and left a right-side gap.) */
    box-sizing: border-box !important;
    width: calc(100% + 2 * var(--dp-form-pad)) !important;
    max-width: none !important;
    margin-left: calc(-1 * var(--dp-form-pad)) !important;
    margin-right: 0 !important;
    padding-left: var(--dp-form-pad) !important;
    padding-right: var(--dp-form-pad) !important;
}

#rentFormCard ._form-content ._field_header {
    margin-top: calc(-1 * var(--dp-form-pad)) !important;
    margin-bottom: 0 !important;
    padding-top: 26px !important;
    padding-bottom: 8px !important;
}

#rentFormCard ._form-content ._field_html {
    margin-bottom: 26px !important;
    padding-top: 0 !important;
    padding-bottom: 26px !important;
}

#rentFormCard ._form-content ._field_header ._form-title {
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 1.35rem !important;
    margin: 0 !important;
}

#rentFormCard ._form-content ._field_html ._html-code {
    color: #d5dae3 !important;
    font-size: .9rem !important;
    line-height: 1.6 !important;
}

/* Required (*) markers on the white field labels below the band. */
#rentFormCard ._form-content .field-required {
    color: #e0554f !important;
}

/* Text / email / textarea fields */
#rentFormCard form ._form_element input[type="text"],
#rentFormCard form ._form_element input[type="email"],
#rentFormCard form ._form_element textarea {
    width: 100% !important;
    border: 1.5px solid var(--rent-border) !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-size: .9rem !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    background: #fff !important;
    color: var(--rent-text) !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    #rentFormCard form ._form_element textarea {
        min-height: 70px !important;
        resize: vertical !important;
    }

    #rentFormCard form ._form_element input[type="text"]:focus,
    #rentFormCard form ._form_element input[type="email"]:focus,
    #rentFormCard form ._form_element textarea:focus {
        outline: none !important;
        border-color: var(--rent-teal) !important;
        box-shadow: 0 0 0 3px rgba(47, 212, 165, .15) !important;
    }

/* Phone (intl-tel-input): the number was overlapping the flag because
   the previous rule keyed on input[type="tel"], but AC renders this
   field's input as type="text", so it never matched. Target the widget's
   own input directly instead - ".iti > input" is the phone input (the
   dropdown's search box is nested deeper, so it's not caught), which is
   type-agnostic. 52px of left padding clears the flag box. Specificity
   (#rentFormCard form ._form_element .iti > input) sits above AC's own
   input rules so it actually applies. */
#rentFormCard form .iti {
    display: block !important;
    width: 100% !important;
}

#rentFormCard form ._form_element .iti > input {
    width: 100% !important;
    box-sizing: border-box !important;
    /* The selector shows flag + arrow + "+1" dial code (~78px wide), so
       the number must clear all of it, not just the flag. Sized for the
       default US "+1"; a longer dial code (e.g. +380) would need more. */
    padding: 12px 14px 12px 84px !important;
    border: 1.5px solid var(--rent-border) !important;
    border-radius: 8px !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    #rentFormCard form ._form_element .iti > input:focus {
        outline: none !important;
        border-color: var(--rent-teal) !important;
        box-shadow: 0 0 0 3px rgba(47, 212, 165, .15) !important;
    }

/* Consent checkbox: tint to brand green (AC already muts the fine-print
   copy, which is fine). */
#rentFormCard input[type="checkbox"] {
    accent-color: var(--rent-green);
}

/* reCAPTCHA is deliberately NOT styled here - not the widget and not its
   wrapper. ui_changes carried spacing/scale rules for .g-recaptcha; they
   are intentionally omitted on this branch per the hands-off rule. */

/* ---------- Validation messages ----------
   AC's defaults are a flat pink chip with black arial text, and crucially
   "max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:
   ellipsis" - which is why a message like "Please check this box to
   continue" arrived clipped and cramped. These rules let it wrap and read
   properly, and restyle it to match the page.

   background-COLOR only (never the background shorthand) so AC's own inline
   warning-icon data-URI keeps rendering. Anchored with .dp-rent ahead of
   #rentFormCard to sit above AC's "#_form_id ._error-inner" rules. */
.dp-rent #rentFormCard ._error-inner {
    max-width: 260px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding: 10px 12px 10px 34px !important;
    background-color: #fdecea !important;
    background-position: 12px 11px !important;
    border: 1px solid #f5c2bd !important;
    border-left: 3px solid #c0392b !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .10) !important;
    color: #8c2f26 !important;
    font-size: .82rem !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    text-align: left !important;
}

/* Form-level errors (e.g. the captcha message) sit in the flow rather than
   floating, so they can run the full width of the card. */
.dp-rent #rentFormCard ._error-inner._form_error {
    max-width: none !important;
    margin-bottom: 10px !important;
}

/* The little pointer must match the new panel colour, or it still shows the
   old pink against it. */
.dp-rent #rentFormCard ._error._above ._error-arrow {
    border-top-color: #fdecea !important;
}

.dp-rent #rentFormCard ._error._below ._error-arrow {
    border-bottom-color: #fdecea !important;
}

/* Field that failed validation: soften AC's hard red to match the panel. */
.dp-rent #rentFormCard form ._form_element input._has_error,
.dp-rent #rentFormCard form ._form_element textarea._has_error,
.dp-rent #rentFormCard form ._form_element .iti > input._has_error {
    border-color: #d9534f !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .12) !important;
}

/* Submit ("Sign Me Up!") -> green pill. Text is whatever AC renders.
   #rentFormCard ._button-wrapper ._submit (1,2,0) out-specifies AC's
   "#_form_id ._submit" (1,1,0) so the yellow !important is overridden. */
#rentFormCard ._button-wrapper ._submit {
    display: inline-block !important;
    width: auto !important;
    min-width: 180px !important;
    margin-top: 10px !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 30px !important;
    font-size: .95rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    background: var(--rent-green) !important;
    cursor: pointer !important;
    transition: background-color .15s ease;
}

    #rentFormCard ._button-wrapper ._submit:hover {
        background: var(--rent-green-dark) !important;
    }

    #rentFormCard ._button-wrapper ._submit:focus-visible {
        outline: 2px solid var(--rent-green-dark) !important;
        outline-offset: 2px !important;
    }
