/* The website's free-estimate forms (FGS-23): the free-estimate form (Views/Home/QuoteForm.cshtml), the footer
   (_Layout, dark), and the item and search pages' "Request info" popups. Fields: Views/Shared/_LeadFields.cshtml.
   Replaces the per-form formtoemail.com styles (and fg-quote-form.css). */

.lead-form {
    --lead-red: #e0280f;
    --lead-red-dark: #b51f0a;
    --lead-text: #222;
    --lead-muted: #5c6670;
    --lead-line: #c7ccd1;
    --lead-error: #b42318;
    max-width: 640px;
    margin: 2em auto;
    padding: 22px 22px 26px;
    border-radius: 10px;
    background: #fff;
    color: var(--lead-text);
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

.lead-form *, .lead-form *::before, .lead-form *::after {
    box-sizing: border-box;
}

/* "Request a free estimate" links (side menu, news box, home page) jump to the forms; land them below the fixed nav. */
.lead-form {
    scroll-margin-top: 124px;
}

/* The footer's card (the FGS-15 look the old #foot-form.fte rules in fg-modern.css gave it). */
.lead-form--dark {
    --lead-text: #fff;
    --lead-muted: #e4e7ea;
    --lead-line: #8a939c;
    --lead-error: #ffc2b8;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px clamp(16px, 4vw, 32px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.lead-form--dark .lead-title {
    font-size: clamp(26px, 4vw, 32px);
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

.lead-form--dark hr {
    border-color: rgba(255, 255, 255, 0.12);
}

.lead-form--dark .lead-consent a {
    color: #ff5a44; /* --fg-red-on-dark */
}

@media (max-width: 767px) {
    .lead-form--dark {
        margin: 1em 0;
    }
}

.lead-form--popup {
    margin: 12px 0 0;
    padding: 0;
    max-width: none;
}

.lead-form hr {
    margin: 10px 0 18px;
    border-color: rgba(127, 127, 127, 0.35);
}

.lead-form .lead-icon {
    display: block;
    max-width: 70%;
    max-height: 80px;
    margin: 0 auto;
}

.lead-form .lead-title {
    margin: 6px 0 0;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    color: inherit;
}

.lead-form label,
.lead-form .lead-label,
.lead-form legend {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

.lead-form .lead-opt {
    font-weight: 400;
    color: var(--lead-muted);
}

.lead-form .lead-field {
    margin: 0 0 14px;
}

.lead-form input[type="text"],
.lead-form input[type="tel"],
.lead-form input[type="email"],
.lead-form textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid var(--lead-line);
    border-radius: 6px;
    background: #fff;
    color: #222;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}

.lead-form textarea {
    min-height: 120px;
    resize: vertical;
}

.lead-form input::placeholder,
.lead-form textarea::placeholder {
    color: #8b949e;
}

.lead-form input:focus,
.lead-form textarea:focus {
    outline: none;
    border-color: var(--lead-red);
    box-shadow: 0 0 0 3px rgba(224, 40, 15, 0.25);
}

.lead-form .lead-invalid {
    border-color: var(--lead-error) !important;
}

.lead-form .lead-err {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lead-error);
}

.lead-form .lead-err:empty {
    display: none;
}

.lead-form .lead-note {
    margin: -6px 0 14px;
    font-size: 14px;
    color: var(--lead-muted);
}

.lead-form .lead-hint {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--lead-muted);
}

.lead-form .lead-hint[hidden] {
    display: none;
}

.lead-form .lead-hint button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* Phone and email side by side when there's room. */
@media (min-width: 560px) {
    .lead-form .lead-pair {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 14px;
    }

    .lead-form .lead-addr {
        display: grid;
        grid-template-columns: 1fr 120px;
        gap: 0 14px;
    }
}

.lead-form .lead-choice {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.lead-form .lead-choice label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 18px 6px 0;
    font-weight: 400;
    cursor: pointer;
}

.lead-form input[type="radio"],
.lead-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--lead-red);
    cursor: pointer;
}

.lead-form .lead-consent {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 4px 10px;
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--lead-muted);
}

.lead-form .lead-consent input {
    margin-top: 2px;
}

.lead-form .lead-consent label {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: inherit;
    cursor: pointer;
}

.lead-form .lead-consent p {
    grid-column: 2;
    margin: 0;
}

.lead-form .lead-consent a {
    color: inherit;
    text-decoration: underline;
}

/* Photos: the real file input is hidden but still reachable by keyboard; the label is the button. */
.lead-form .lead-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.lead-form .lead-photo-btn {
    display: inline-block;
    margin: 0;
    padding: 9px 16px;
    border: 1px solid var(--lead-line);
    border-radius: 999px;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
}

.lead-form .lead-photo-btn:hover {
    border-color: var(--lead-red);
}

.lead-form .lead-photo-input:focus-visible + .lead-photo-btn {
    outline: 3px solid rgba(224, 40, 15, 0.45);
    outline-offset: 2px;
}

.lead-form .lead-photo-input:disabled + .lead-photo-btn {
    opacity: .5;
    cursor: default;
}

.lead-form .lead-photo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.lead-form .lead-photo-list:empty {
    display: none;
}

.lead-form .lead-photo {
    position: relative;
    width: 84px;
}

.lead-form .lead-photo img {
    display: block;
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--lead-line);
}

.lead-form .lead-photo span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--lead-muted);
}

.lead-form .lead-photo button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 16px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
}

.lead-form .lead-captcha {
    min-height: 78px;
    margin: 4px 0 4px;
}

@media (max-width: 359px) {
    .lead-form .lead-captcha {
        transform: scale(.88);
        transform-origin: 0 0;
    }
}

.lead-form .lead-submit {
    display: inline-block;
    margin-top: 14px;
    padding: 14px 30px;
    border: 0;
    border-radius: 999px;
    background: var(--lead-red);
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.lead-form .lead-submit:hover,
.lead-form .lead-submit:focus-visible {
    background: var(--lead-red-dark);
}

.lead-form .lead-submit:focus-visible {
    outline: 3px solid rgba(224, 40, 15, 0.45);
    outline-offset: 2px;
}

.lead-form .lead-submit[disabled] {
    opacity: .65;
    cursor: progress;
}

.lead-form .lead-alert {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #f3b8ae;
    border-radius: 6px;
    background: #fdecea;
    color: #8a1c12;
    font-weight: 600;
}

.lead-form .lead-alert[hidden] {
    display: none;
}

/* The trap field: off screen for people, there for bots. */
.lead-form .lead-trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .lead-form input, .lead-form textarea, .lead-form .lead-submit {
        transition: none;
    }
}
