/* =====================================================================
   Loop Forms — Tenant Application (self-contained modern styling)
   =====================================================================
   This form ships its OWN look rather than inheriting the g2 placeholder-
   only inline skin (which renders borderless-white inputs on a white page).
   The field overrides are scoped to all three of the form's classes
   (.loop-forms.loop-form--loop-forms-tenant-application.lf-ta) so they beat
   the g2 rules (section.module form label input…) on specificity — no
   !important needed.

   Still STRUCTURE + NEUTRAL chrome: every colour is a grey / near-black
   neutral exposed as a CSS variable, so a theme/child can repaint the
   accent, borders or radius without touching the plugin. The primary
   submit button keeps the theme's own .button--primary paint.
   ===================================================================== */

.lf-ta {
    /* Square by default — a theme/child can round the form by overriding these
       two variables (everything derives from them). */
    --lf-ta-radius: 0;
    --lf-ta-radius-sm: 0;
    --lf-ta-border: #cdd4de;   /* visible even as a single device-pixel line */
    --lf-ta-bg: #ffffff;
    --lf-ta-bg-soft: #f5f7fa;
    /* Fields sit on a subtle grey "well" so they read as inputs on any display,
       even where a hairline border renders sub-pixel (hi-DPI / OS scaling). */
    --lf-ta-field-bg: #f4f6f9;
    --lf-ta-field-bg-focus: #ffffff;
    --lf-ta-ink: #1f2430;
    --lf-ta-muted: #6b7280;
    --lf-ta-accent: #1f2430;   /* neutral dark; theme repaints via this var */
    --lf-ta-error: #c0392b;
    /* Soft elevation for cards + controls. Neutral (near-black alpha) so it
       reads on any theme; a theme can flatten it by overriding these vars. */
    --lf-ta-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05);
    --lf-ta-shadow-card: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.05);

    max-width: 720px;
    margin: 0 auto;
    color: var(--lf-ta-ink);
    /* When a step change scrolls the form into view, leave room for a fixed
       header so the top isn't hidden under it (inherits the measured value). */
    scroll-margin-top: var(--lf-ta-header-clear, 90px);
}

/* --- Spam trap (off-screen decoy) ----------------------------------- */
/* .lf-ta-extra holds a decoy field kept in the DOM so automated scripts fill
   it, but pushed off-canvas so no genuine applicant can see, tab to, or fill
   it (a filled value is treated as a bot and the submission is dropped). NOT
   display:none — some bots skip hidden fields, and this one must stay
   fill-able by them. Paired with tabindex="-1" + aria-hidden in the markup.
   A plugin-private class themes never target, so it needs no !important. */
.lf-ta .lf-ta-extra {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Cards (property + applicants share the shell) ------------------- */
.lf-ta-card,
.lf-ta-applicant {
    background: var(--lf-ta-bg);
    border: 1px solid var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
    box-shadow: var(--lf-ta-shadow-card);
    margin: 0 0 16px;
    overflow: hidden;
}

.lf-ta-card__head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--lf-ta-border);
    background: var(--lf-ta-bg-soft);
}

.lf-ta-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.lf-ta-card__body {
    padding: 18px;
}

/* --- Property chip (when arriving from a property page) -------------- */
/* A compact summary card: thumbnail on the left, details on the right, with a
   link back to the listing. Degrades to a text-only block when there's no
   thumbnail (API lookup returned no image). */
.lf-ta-property-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: var(--lf-ta-bg-soft);
    border: 1px solid var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
}

/* With a thumbnail, lay out as a row. */
.lf-ta-property-chip.has-thumb {
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
}

.lf-ta-property-chip__thumb {
    flex-shrink: 0;
    width: 112px;
    min-height: 88px;
    align-self: stretch;
    border-radius: var(--lf-ta-radius-sm);
    background-color: #e5e7eb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.lf-ta-property-chip__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    justify-content: center;
}

.lf-ta-property-chip__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lf-ta-muted);
}

.lf-ta-property-chip__address {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
}

.lf-ta-property-chip__meta {
    color: var(--lf-ta-muted);
    font-size: 0.9rem;
}

.lf-ta-property-chip__link {
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.lf-ta-property-chip__link:hover { text-decoration: underline; }

/* Stack the thumbnail on very narrow screens. */
@media (max-width: 480px) {
    .lf-ta-property-chip.has-thumb { flex-direction: column; }
    .lf-ta-property-chip.has-thumb .lf-ta-property-chip__thumb { width: 100%; height: 160px; }
}

/* --- Page layout: form + property sidebar --------------------------- */
/* Two copies of the property summary exist in the markup:
     .lf-ta-summary-inline  — inside the form, under the progress bar
     .lf-ta-aside           — a sibling column, for the desktop sidebar
   Only one is ever shown. Mobile (and the modal) show the inline copy and hide
   the aside — there's no room for a second column. Desktop (≥901px) shows the
   aside as a sticky right-hand column and hides the inline copy. */

/* Mobile default: inline summary on, sidebar off. */
.lf-ta-summary-inline { display: block; margin: 0 0 20px; }
.lf-ta-layout--sidebar > .lf-ta-aside { display: none; }

@media (min-width: 901px) {
    /* Desktop: two columns, wider canvas, sticky sidebar; inline copy hidden.
       Scoped to --sidebar so the no-property case (no sidebar column) keeps its
       inline panel — that's where the disclaimer + save-note then live. */
    .lf-ta-layout--sidebar .lf-ta-summary-inline { display: none; }
    .lf-ta-layout--sidebar {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
        max-width: 1200px;      /* wider content area now there's a sidebar */
        margin-inline: auto;
    }
    .lf-ta-layout--sidebar > .lf-ta {
        max-width: none;
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
    }
    .lf-ta-layout--sidebar > .lf-ta-aside {
        display: block;
        flex: 0 0 320px;
        margin: 0;
        position: sticky;                                  /* stays in view while scrolling */
        top: calc(var(--lf-ta-header-clear, 90px) + 16px); /* clears the fixed header */
    }
}

/* The sidebar/summary card reads as a proper card: image on top, details below
   (overrides the compact inline-chip row layout). Applies to both copies. */
.lf-ta-aside .lf-ta-property-chip,
.lf-ta-summary-inline .lf-ta-property-chip {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}
.lf-ta-aside .lf-ta-property-chip.has-thumb .lf-ta-property-chip__thumb,
.lf-ta-summary-inline .lf-ta-property-chip.has-thumb .lf-ta-property-chip__thumb {
    width: 100%;
    height: 180px;
}
.lf-ta-aside .lf-ta-property-chip__body,
.lf-ta-summary-inline .lf-ta-property-chip__body { padding: 14px 16px 16px; }

/* The summary is TWO separate stacked boxes: the property card, and its own
   "Note" info box below. The wrapper is just the stack (no chrome of its own);
   each box carries its own edge, so the notes read as guidance about the form
   rather than a description of the property. */
.lf-ta-aside .lf-ta-summary,
.lf-ta-summary-inline .lf-ta-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Property card — its own clearly boxed card. The edge is a shadow "ring"
   (0 0 0 1px) PLUS a plain border: a bare 1px border renders sub-pixel and
   vanishes at hi-DPI/OS-scaling (the same hairline issue as the form fields),
   but a shadow ring is drawn at device-pixel precision and always shows; the
   soft drop shadow lifts it off the white page. */
.lf-ta-aside .lf-ta-summary .lf-ta-property-chip,
.lf-ta-summary-inline .lf-ta-summary .lf-ta-property-chip {
    background: var(--lf-ta-bg);
    border: 1px solid var(--lf-ta-border);
    box-shadow:
        0 0 0 1px rgba(16, 24, 40, 0.10),   /* crisp DPI-safe outline */
        0 6px 20px rgba(16, 24, 40, 0.12);  /* soft lift off the page */
}

/* "Note" info box — light fill + a slightly-darker SOLID border so it clearly
   reads as a callout, distinct from the property card above. Theme accent tints
   it via color-mix, with neutral fallbacks for browsers without color-mix. */
.lf-ta-summary-notes {
    padding: 14px 16px;
    background: #eef2f8;                                                  /* fallback */
    background: color-mix(in srgb, var(--lf-ta-accent) 6%, #ffffff);
    border: 1px solid #b3becd;                                           /* fallback */
    border: 1px solid color-mix(in srgb, var(--lf-ta-accent) 28%, var(--lf-ta-border));
}
.lf-ta-summary-notes p { margin: 0; }
.lf-ta-summary-notes p + p { margin-top: 8px; }
.lf-ta-summary-notes__title {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lf-ta-accent);
}
.lf-ta-summary-notes__lead {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--lf-ta-ink);
}
.lf-ta-summary-notes__save {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--lf-ta-muted);
}

/* Compact summary — applied by JS (.is-compact) to the in-form copy from step 2
   onwards, so the big property panel only shows in full on step 1. The card
   shrinks to a slim reminder row (small thumb + address + rent) and the framing
   notes drop away. Only ever affects the mobile/modal inline copy (the desktop
   sidebar hides this copy). With no property attached there's nothing to remind,
   so the whole thing is hidden. */
.lf-ta-summary-inline.is-compact { margin-bottom: 12px; }
.lf-ta-summary-inline.is-compact .lf-ta-summary-notes { display: none; }
.lf-ta-summary-inline.is-compact .lf-ta-summary:not(.lf-ta-summary--has-property) { display: none; }
.lf-ta-summary-inline.is-compact .lf-ta-property-chip {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}
.lf-ta-summary-inline.is-compact .lf-ta-property-chip.has-thumb .lf-ta-property-chip__thumb {
    width: 48px;
    height: 48px;
    min-height: 0;
    border-radius: var(--lf-ta-radius-sm);
}
.lf-ta-summary-inline.is-compact .lf-ta-property-chip__body { padding: 0; }
.lf-ta-summary-inline.is-compact .lf-ta-property-chip__label,
.lf-ta-summary-inline.is-compact .lf-ta-property-chip__link { display: none; }
.lf-ta-summary-inline.is-compact .lf-ta-property-chip__address { font-size: 0.9rem; }
.lf-ta-summary-inline.is-compact .lf-ta-property-chip__meta { font-size: 0.82rem; }

/* Modal/drawer: always single column whatever the viewport (the drawer is
   narrow). Force the inline copy on and the sidebar off — higher specificity
   than the desktop @media rules so it wins on wide screens too. */
.modal-type-tenant-application .lf-ta-summary-inline { display: block; }
.modal-type-tenant-application .lf-ta-layout--sidebar { display: block; max-width: none; }
.modal-type-tenant-application .lf-ta-layout--sidebar > .lf-ta { max-width: none; }
.modal-type-tenant-application .lf-ta-layout--sidebar > .lf-ta-aside { display: none; }

/* --- Applicant card: header (the collapse toggle) ------------------- */
.lf-ta-applicant__head {
    display: flex;
    align-items: stretch;
    background: var(--lf-ta-bg-soft);
    border-bottom: 1px solid var(--lf-ta-border);
}

/* Collapsed card: no bottom border on the header (body is hidden). */
.lf-ta-applicant--collapsed .lf-ta-applicant__head {
    border-bottom: 0;
}

.lf-ta-applicant__toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: transparent;
    border: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

/* Numbered badge — distinguishes each applicant at a glance. */
.lf-ta-applicant__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--lf-ta-accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.lf-ta-applicant__label {
    flex: 1;
    min-width: 0;
}

.lf-ta-applicant__name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Chevron — rotates when the card is open. */
.lf-ta-applicant__chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--lf-ta-muted);
    border-bottom: 2px solid var(--lf-ta-muted);
    transform: rotate(45deg);
    transition: transform 0.18s ease;
    margin-right: 4px;
}

.lf-ta-applicant--collapsed .lf-ta-applicant__chevron {
    transform: rotate(-45deg);
}

.lf-ta-applicant__remove {
    flex-shrink: 0;
    padding: 0 16px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--lf-ta-border);
    font: inherit;
    font-size: 0.85rem;
    color: var(--lf-ta-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.lf-ta-applicant__remove:hover {
    color: var(--lf-ta-error);
}

.lf-ta-applicant__body {
    padding: 18px;
}

/* Collapsed → hide the body; Hidden → remove the whole card (pre-add). */
.lf-ta-applicant--collapsed .lf-ta-applicant__body {
    display: none;
}

.lf-ta-applicant--hidden {
    display: none;
}

/* When a new applicant opens, we scroll its top into view; this margin keeps it
   clear of the fixed site header (same measured value the page uses). */
.lf-ta-applicant {
    scroll-margin-top: var(--lf-ta-header-clear, 90px);
}

/* Alternate applicant colouring — even-numbered applicants (2, 4…) get a clearly
   distinct look (accent left edge + tinted header) so adjacent applicant cards
   are never confused for one another. Theme accent drives it via color-mix, with
   a neutral fallback for browsers without color-mix. */
.lf-ta-applicants > .lf-ta-applicant:nth-of-type(even) {
    border-left: 3px solid #6b7280;                 /* fallback */
    border-left: 3px solid var(--lf-ta-accent);
}
.lf-ta-applicants > .lf-ta-applicant:nth-of-type(even) .lf-ta-applicant__head {
    background: #e9edf3;                             /* fallback */
    background: color-mix(in srgb, var(--lf-ta-accent) 12%, #ffffff);
}
.lf-ta-applicants > .lf-ta-applicant:nth-of-type(even) .lf-ta-applicant__toggle {
    padding-left: 13px;   /* 16 − 3px left border, so labels stay aligned */
}

/* --- Field grid ----------------------------------------------------- */
.lf-ta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    /* Don't stretch a short field (e.g. the date) to a tall neighbour's
       height — a stretched <label> leaves a big empty clickable area that,
       because the label wraps its input, re-opens that input (notably the
       native date picker) when clicked. Top-align keeps each label its own
       height. */
    align-items: start;
}

.lf-ta-field--full {
    grid-column: 1 / -1;
}

@media (max-width: 560px) {
    .lf-ta-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Address sub-box ------------------------------------------------ */
/* Grouped so the address reads as one block. Order: house name/number +
   street (row 1), then town/city, county, postcode each on their own line. */
.lf-ta-address {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding: 14px;
    background: var(--lf-ta-bg-soft);
    border: 1px solid var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
}

.lf-ta-address__label {
    display: block;
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lf-ta-ink);
}

.lf-ta-address__grid {
    display: grid;
    grid-template-columns: 1fr 2fr;   /* house name/number | street */
    gap: 14px 16px;
    align-items: start;
}

.lf-ta-address__row {
    grid-column: 1 / -1;   /* town/city, county, postcode: own line each */
}

.lf-ta-address__postcode input {
    max-width: 220px;   /* a postcode doesn't need the full width */
}

@media (max-width: 560px) {
    .lf-ta-address__grid {
        grid-template-columns: 1fr;
    }
    .lf-ta-address__postcode input {
        max-width: none;
    }
}

/* --- Sub-sections within an applicant ------------------------------- */
/* The comprehensive blocks (Employment, Financial background, Guarantor,
   Current address, Landlord, Household) each sit under a small heading with a
   light rule above, so a long applicant card scans as clear groups rather
   than one endless list. */
.lf-ta-subsection {
    grid-column: 1 / -1;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--lf-ta-border);
}

.lf-ta-subsection__title {
    display: block;
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--lf-ta-ink);
}

.lf-ta-subsection .lf-ta-address__grid {
    margin-bottom: 14px;
}

/* Tenancy-detail grid inside the property card. */
.lf-ta-tenancy {
    margin-top: 14px;
}

/* --- Field controls: BEAT the g2 skin (3-class scope) ---------------- */
/* Labels: un-hide the g2-collapsed text and set a clean top-label look.
   :not(.checkbox) leaves the consent checkbox row to the shared skin. */
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) {
    display: block;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--lf-ta-muted);
    position: static;
}

.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="text"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="tel"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="email"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="url"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="date"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="number"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) textarea,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 12px 14px;
    /* 16px avoids the iOS "zoom on focus" jump; still reads as a normal field. */
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.35;
    color: var(--lf-ta-ink);
    background-color: var(--lf-ta-field-bg);
    border: 1px solid var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
    box-shadow: var(--lf-ta-shadow);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Placeholders a shade lighter than typed text, so a field reads as empty. */
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input::placeholder,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) textarea::placeholder {
    color: var(--lf-ta-muted);
    opacity: 0.75;
}

/* Selects: hide the native arrow (appearance:none above) and paint our own
   chevron so every browser matches. Neutral grey stroke (data URIs can't read
   CSS vars); the extra right padding clears the arrow. */
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

/* Date & number keep their NATIVE internals: removing the appearance on these
   (calendar indicator / spinners) can make the native picker misbehave in some
   Chromium builds. Our border/padding/well styling above still applies. */
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="date"],
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input[type="number"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}

.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) textarea {
    resize: vertical;
    min-height: 88px;
}

.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input:hover,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) textarea:hover,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) select:hover {
    border-color: var(--lf-ta-muted);
}

.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) input:focus,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) textarea:focus,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label:not(.checkbox) select:focus {
    outline: none;
    border-color: var(--lf-ta-accent);
    background-color: var(--lf-ta-field-bg-focus);
    /* Fallback ring for older browsers; the color-mix line below overrides it
       in modern ones so the ring tracks whatever accent a theme sets. */
    box-shadow: 0 0 0 3px rgba(31, 36, 48, 0.14);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lf-ta-accent) 22%, transparent);
}

/* Invalid state (client-side validation adds .lf-ta-invalid to the label). */
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label.lf-ta-invalid input,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label.lf-ta-invalid textarea,
.loop-forms.loop-form--loop-forms-tenant-application.lf-ta label.lf-ta-invalid select {
    border-color: var(--lf-ta-error);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* --- Inline error text ---------------------------------------------- */
.lf-error {
    display: inline-block;
    margin-left: 6px;
    font-style: normal;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--lf-ta-error);
}

/* --- Add-applicant control ------------------------------------------ */
.lf-ta-add {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
}

.lf-ta-add__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px dashed var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
    font: inherit;
    font-weight: 600;
    color: var(--lf-ta-ink);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lf-ta-add__btn:hover {
    border-color: var(--lf-ta-accent);
    background: var(--lf-ta-bg-soft);
}

.lf-ta-add__btn[hidden] {
    display: none;
}

.lf-ta-add__plus {
    font-size: 1.1em;
    line-height: 1;
}

.lf-ta-add__hint {
    font-size: 0.82rem;
    color: var(--lf-ta-muted);
}

/* --- Submit + success ----------------------------------------------- */
.lf-ta-submit {
    width: 100%;
}

.lf-ta-success {
    margin-top: 16px;
}

/* --- Inside the property-page modal (side drawer) ------------------- */
/* When opened from a property page, the form lives in the modal drawer.
   The modal system tags its container `.lf-container.modal-type-tenant-
   application`, so everything here applies ONLY to the drawer instance —
   the standalone page keeps its full, deliberate skin untouched.

   TWO jobs:

   1. Layout — the drawer is narrower than the page, so drop the 720px cap
      and let the field grid pack columns to the space actually available
      (auto-fit + minmax): one column in a slim drawer, two when there's
      room, with no dependency on the theme's exact drawer width. The
      address sub-box stacks for certainty in the narrow case.

   2. Colour — DEFER TO THE THEME. Each surface's modal SCSS already paints
      Loop Forms fields in the drawer (g2's _modal-forms.scss colours
      .loop-forms inputs, labels, checkboxes, links, the intro and submit
      button, scoped to .lf-container). Our standalone skin's light cards
      would fight that and look foreign — the white "cards" clashing with a
      dark drawer was the reported problem. Since the whole skin is driven
      by --lf-ta-* variables, we simply remap them to neutral values here:
      transparent card fills, hairline neutral borders, inherited text. The
      drawer then shows through and the theme colours the fields. Grey-alpha
      (not white-alpha) is used so it reads on a light OR dark modal — the
      modal background is operator-configurable. Colour is the theme's job
      here; we keep only structure — the few affordances the theme can't
      reach (badge, chevron, remove, add) are handled just below. */
.modal-type-tenant-application .lf-ta {
    /* Neutralise our colours so the theme's modal styling shows through. */
    --lf-ta-bg: transparent;
    --lf-ta-bg-soft: rgba(127, 127, 127, 0.10);
    --lf-ta-border: rgba(127, 127, 127, 0.35);
    /* The grey field "well" is a standalone-page treatment; in the drawer the
       theme paints the fields, so make it transparent and drop the inset. */
    --lf-ta-field-bg: transparent;
    --lf-ta-field-bg-focus: transparent;
    --lf-ta-shadow: none;
    --lf-ta-ink: inherit;
    --lf-ta-muted: inherit;
    color: inherit;
    max-width: none;
}

.modal-type-tenant-application .lf-ta-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.modal-type-tenant-application .lf-ta-address__grid {
    grid-template-columns: 1fr;
}

.modal-type-tenant-application .lf-ta-address__postcode input {
    max-width: 220px;
}

/* Applicant header affordances. The card headings and chip are theme-coloured
   via the shared section-title / context classes, and the toggle carries
   section-title too — so the name, badge and chevron inside it inherit the
   theme's heading colour. We only reshape the badge (its default solid dark
   disc can vanish on a dark drawer) into an outline that tracks that inherited
   colour, and give the Remove control a neutral tone that reads on either. */
.modal-type-tenant-application .lf-ta-applicant__badge {
    background: transparent;
    border: 1.5px solid currentColor;
    color: inherit;
}

.modal-type-tenant-application .lf-ta-applicant__chevron {
    border-color: currentColor;
    opacity: 0.7;
}

.modal-type-tenant-application .lf-ta-applicant__remove {
    color: rgba(127, 127, 127, 0.9);
}

/* Add-another-applicant is a secondary control (theme classes would drag in
   base .note colours onto the standalone page, so we tint it here instead).
   Its button + hint inherit this — their --lf-ta-* colours resolve to inherit
   in the modal — and a neutral grey reads on a light OR dark drawer. */
.modal-type-tenant-application .lf-ta-add {
    color: rgba(127, 127, 127, 0.95);
}

/* --- Property picker ------------------------------------------------- */
/* The dropdown must escape the property card, so that card opts out of the
   shared overflow:hidden; its header top corners are rounded explicitly to
   compensate. */
.lf-ta-card--property {
    overflow: visible;
}

/* =====================================================================
   Multi-step wizard (page context)
   =====================================================================
   The form is a page-hosted wizard: a progress bar, one step visible at a
   time, and Back / Next / Submit. Structure + neutral chrome only; the accent
   tracks --lf-ta-accent so a theme/child can repaint it. Without JS every step
   shows and the form still submits.
   ===================================================================== */

.lf-ta--wizard { max-width: 760px; }

/* Anything the wizard hides (step panes, nav buttons, the add button) — beat
   the theme's button display rules without !important via the .lf-ta scope. */
.lf-ta [hidden] { display: none; }

/* Retention notice + expired alert */
.lf-ta-retention {
    margin: 0 0 18px;
    font-size: 0.82rem;
    color: var(--lf-ta-muted);
}
.lf-ta-retention--review { margin: 14px 0 0; }

/* Intro disclaimer — a light, clearly-visible note framing this as the first
   step (the agency follows up). A touch more prominent than the retention line. */
.lf-ta-disclaimer {
    margin: 0 0 12px;
    padding: 11px 14px;
    border: 1px solid var(--lf-ta-border);
    border-left: 3px solid var(--lf-ta-accent);
    border-radius: var(--lf-ta-radius-sm);
    background: var(--lf-ta-bg-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--lf-ta-ink);
}
.lf-ta-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--lf-ta-radius);
    font-size: 0.9rem;
    background: #fff3cd;
    color: #5a4500;
    border: 1px solid #f3e2a9;
}

/* --- Progress bar --------------------------------------------------- */
.lf-ta-progress {
    display: flex;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}
.lf-ta-progress__step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    text-align: center;
    font-size: 0.72rem;
    color: var(--lf-ta-muted);
    cursor: pointer;
}
.lf-ta-progress__step::before {   /* connector line */
    content: "";
    position: absolute;
    top: 15px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--lf-ta-border);
    z-index: 0;
}
.lf-ta-progress__step:first-child::before { display: none; }
.lf-ta-progress__num {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--lf-ta-bg);
    border: 2px solid var(--lf-ta-border);
    color: var(--lf-ta-muted);
    transition: background .15s, border-color .15s, color .15s;
}
.lf-ta-progress__step.is-current .lf-ta-progress__num,
.lf-ta-progress__step.is-complete .lf-ta-progress__num {
    background: var(--lf-ta-accent);
    border-color: var(--lf-ta-accent);
    color: #fff;
}
/* Halo the step you're on so the eye lands there first. */
.lf-ta-progress__step.is-current .lf-ta-progress__num {
    box-shadow: 0 0 0 4px rgba(31, 36, 48, 0.12);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lf-ta-accent) 18%, transparent);
}
.lf-ta-progress__step.is-current  { color: var(--lf-ta-ink); font-weight: 700; }
.lf-ta-progress__step.is-current::before,
.lf-ta-progress__step.is-complete::before { background: var(--lf-ta-accent); }

/* --- Steps + navigation --------------------------------------------- */
.lf-ta-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}
.lf-ta-nav__spacer { flex: 1 1 auto; }
.lf-ta-nav__back,
.lf-ta-nav__next {
    padding: 12px 24px;
    border-radius: var(--lf-ta-radius);
    border: 1px solid var(--lf-ta-border);
    background: var(--lf-ta-bg);
    color: var(--lf-ta-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.lf-ta-nav__back:hover {
    border-color: var(--lf-ta-muted);
    background: var(--lf-ta-bg-soft);
}
.lf-ta-nav__next {
    background: var(--lf-ta-accent);
    border-color: var(--lf-ta-accent);
    color: #fff;
    box-shadow: var(--lf-ta-shadow-card);
}
.lf-ta-nav__next:hover { filter: brightness(1.08); }
/* Press feedback — a hair of travel so the buttons feel tactile. */
.lf-ta-nav__back:active,
.lf-ta-nav__next:active { transform: translateY(1px); }
.lf-ta-nav__back:focus-visible,
.lf-ta-nav__next:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 36, 48, 0.14);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lf-ta-accent) 22%, transparent);
}

@media (max-width: 560px) {
    .lf-ta-progress__label { display: none; }   /* numbers only on small screens */
    .lf-ta-progress { margin-bottom: 14px; }
}

/* --- Mobile optimisations ------------------------------------------- */
/* On phones every pixel of width counts and the form is long, so reclaim the
   side gutters, tighten the card padding, and make the wizard buttons big,
   thumb-friendly targets that fill the row (primary on the right). */
@media (max-width: 560px) {
    .lf-ta-page {
        padding-right: 12px;
        padding-left: 12px;
        padding-bottom: 48px;
    }
    .lf-ta-card__head { padding: 12px 14px; }
    .lf-ta-card__body { padding: 14px; }
    .lf-ta-subsection { margin-top: 14px; padding-top: 14px; }
    /* Shorter hero image so the summary doesn't push the form far down. */
    .lf-ta-summary-inline .lf-ta-property-chip.has-thumb .lf-ta-property-chip__thumb { height: 150px; }
    .lf-ta-summary-inline { margin-bottom: 16px; }
    /* Buttons fill the row and stay a comfortable tap height; Back stays compact,
       the primary action grows to fill the space. */
    .lf-ta-nav { gap: 10px; }
    .lf-ta-nav__spacer { display: none; }   /* let the primary action fill instead */
    .lf-ta-nav__back,
    .lf-ta-nav__next,
    .lf-ta-submit {
        padding-top: 14px;
        padding-bottom: 14px;
    }
    .lf-ta-nav__next,
    .lf-ta-submit { flex: 1 1 auto; }   /* primary action takes the remaining width */
}

/* Wizard chrome in a modal/drawer context (if ever opened there). */
.modal-type-tenant-application .lf-ta-progress__num {
    background: transparent;
    border-color: currentColor;
    color: inherit;
}

.lf-ta-card--property .lf-ta-card__head {
    border-top-left-radius: var(--lf-ta-radius);
    border-top-right-radius: var(--lf-ta-radius);
}

.lf-ta-picker {
    position: relative;
}

.lf-ta-picker__results {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: 100%;
    margin: 6px 0 0;
    padding: 6px;
    list-style: none;
    background: var(--lf-ta-bg);
    border: 1px solid var(--lf-ta-border);
    border-radius: var(--lf-ta-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
    max-height: 340px;
    overflow-y: auto;
}

.lf-ta-picker__results[hidden] {
    display: none;
}

.lf-ta-picker__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.lf-ta-picker__item:hover,
.lf-ta-picker__item:focus {
    background: var(--lf-ta-bg-soft);
    outline: none;
}

.lf-ta-picker__thumb {
    flex-shrink: 0;
    width: 58px;
    height: 44px;
    border-radius: 6px;
    background-color: #e5e7eb;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.lf-ta-picker__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lf-ta-picker__addr {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-ta-picker__rent {
    font-size: 0.85rem;
    color: var(--lf-ta-muted);
}

.lf-ta-picker__status {
    padding: 10px 8px;
    color: var(--lf-ta-muted);
}

/* --- Page-template wrapper ------------------------------------------ */
/* The standalone page template renders the form between the theme's header and
   footer. Many fleet themes paint their header as position:fixed (drawn over
   the page), so the top of the form would be hidden. Rather than depend on any
   one theme, loop-forms-page-clear.js measures the real fixed-header height at
   runtime and writes it to --lf-ta-header-clear; we reserve that as padding-top.
   The 80px fallback covers the brief moment before the script runs (a typical
   header height); the script then sets the exact value, or a small gap when
   there is no fixed header (so we never double-pad an in-flow header).
   Centred, max-width, and overflow-x clipped so the progress bar's connector
   lines can't push a step off-screen. The form still caps at its own width. */
.lf-ta-page {
    box-sizing: border-box;
    max-width: min(100%, 1280px);
    margin-inline: auto;
    padding-top: var(--lf-ta-header-clear, 80px);
    padding-right: 16px;
    padding-bottom: 64px;
    padding-left: 16px;
    overflow-x: clip;
}

/* Page heading — aligned to the form column, inherits the theme's heading
   colour/typography (theme owns colour), just constrained + spaced here. */
.lf-ta-page__title {
    max-width: 760px;
    margin: 0 auto 16px;
    text-align: center;
}

/* Intro copy from the page editor — sits above the form, aligned to its column. */
.lf-ta-page__intro {
    max-width: 680px;
    margin: 0 auto 28px;
    text-align: center;
    color: var(--lf-ta-muted);
    line-height: 1.6;
}
.lf-ta-page__intro > :first-child { margin-top: 0; }
.lf-ta-page__intro > :last-child { margin-bottom: 0; }

/* Editor-only notice shown when the feature is disabled. */
.lf-ta-disabled-note {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px dashed #b9c0c9;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}
