/* Lead forms — Views/Shared/_LeadForm.cshtml, js/lead-form.js. Scoped to .lead-form so the theme's
   form styles (contact-form-style-0x, .form-control) do not leak in. */

.lead-form {
    --lf-accent: var(--base-color, #dc3131);
    --lf-accent-soft: rgba(220, 49, 49, .12);
    --lf-ink: var(--dark-gray, #232323);
    --lf-muted: var(--medium-gray, #717580);
    --lf-line: #dfe1e6;
    --lf-fill: #fafafb;
    --lf-radius: 10px;
    font-family: var(--alt-font, "Plus Jakarta Sans", sans-serif);
    text-align: left;
    color: var(--lf-ink);
}

.lead-form__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px 18px;
}

.lead-form--wide .lead-form__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-form__field--full {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .lead-form--wide .lead-form__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- labels ---- */
.lead-form__label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    color: var(--lf-ink);
}

.lead-form__req {
    color: var(--lf-accent);
}

.lead-form__optional {
    font-weight: 400;
    color: var(--lf-muted);
}

/* ---- inputs ---- */
.lead-form__control {
    position: relative;
}

.lead-form__icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    line-height: 1;
    color: var(--lf-muted);
    pointer-events: none;
    transition: color .15s;
}

.lead-form__control--textarea .lead-form__icon {
    top: 15px;
    transform: none;
}

.lead-form input[type="text"],
.lead-form input[type="email"],
.lead-form input[type="tel"],
.lead-form select,
.lead-form textarea {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 16px 0 46px;
    border: 1px solid var(--lf-line);
    border-radius: var(--lf-radius);
    background-color: var(--lf-fill);
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--lf-ink);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.lead-form textarea {
    height: auto;
    min-height: 116px;
    padding-top: 13px;
    padding-bottom: 13px;
    resize: vertical;
}

.lead-form select {
    padding-right: 42px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23717580' viewBox='0 0 16 16'%3E%3Cpath d='M1.65 4.65a.5.5 0 0 1 .7 0L8 10.29l5.65-5.64a.5.5 0 0 1 .7.7l-6 6a.5.5 0 0 1-.7 0l-6-6a.5.5 0 0 1 0-.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
}

.lead-form ::placeholder {
    color: #a3a6ad;
    opacity: 1;
}

.lead-form input:hover,
.lead-form select:hover,
.lead-form textarea:hover {
    border-color: #c6c9d0;
}

.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
    outline: none;
    border-color: var(--lf-ink);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(35, 35, 35, .08);
}

.lead-form__control:focus-within .lead-form__icon {
    color: var(--lf-ink);
}

/* ---- errors ---- */
.lead-form [aria-invalid="true"] {
    border-color: var(--lf-accent) !important;
    background-color: #fffafa;
}

.lead-form [aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px var(--lf-accent-soft);
}

.lead-form__field.has-error .lead-form__icon {
    color: var(--lf-accent);
}

.lead-form__error {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--lf-accent);
}

.lead-form__field.has-error .lead-form__error {
    display: flex;
}

/* ---- SMS consent ---- */
.lead-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: var(--lf-radius);
    background: #f4f5f7;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.6;
    color: #50535b;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.lead-form__consent input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--lf-ink);
    cursor: pointer;
}

.lead-form__consent b {
    color: var(--lf-ink);
}

.lead-form__consent a {
    color: var(--lf-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lead-form__field.has-error .lead-form__consent {
    border-color: var(--lf-accent);
    background: #fff5f5;
}

/* ---- submit ---- */
.lead-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin-top: 22px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--lf-radius);
    background: var(--lf-ink);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 10px 24px -12px rgba(35, 35, 35, .55);
}

.lead-form__submit:hover {
    background: var(--lf-accent);
    box-shadow: 0 10px 24px -12px rgba(220, 49, 49, .7);
}

.lead-form__submit:active {
    transform: translateY(1px);
}

.lead-form__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--lf-accent-soft);
}

.lead-form__submit:disabled {
    cursor: progress;
    opacity: .85;
}

.lead-form__arrow {
    transition: transform .2s;
}

.lead-form__submit:hover .lead-form__arrow {
    transform: translateX(3px);
}

.lead-form__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lead-form-spin .7s linear infinite;
}

.lead-form.is-busy .lead-form__spinner {
    display: inline-block;
}

.lead-form.is-busy .lead-form__arrow {
    display: none;
}

@keyframes lead-form-spin {
    to { transform: rotate(360deg); }
}

/* ---- status + legal ---- */
.lead-form__status {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--lf-radius);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.lead-form__status--error {
    display: block;
    background: var(--light-red, #feedec);
    color: #b42318;
}

.lead-form__status--success {
    display: block;
    background: #e9f8f1;
    color: #157347;
}

.lead-form__legal {
    display: flex;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--lf-muted);
}

.lead-form__legal .bi {
    font-size: 14px;
    line-height: 1.3;
}

.lead-form__legal a {
    color: inherit;
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .lead-form *,
    .lead-form *::before {
        transition: none !important;
        animation-duration: 1.5s !important;
    }
}
