/* Funnel: hero/CTA → modal → success (visual only) */
.landing-body .lead-modal-title,
.landing-body .lead-success-title {
    font-family: "Fraunces", Georgia, serif;
}

.seo-body .lead-modal-title,
.seo-body .lead-success-title {
    font-family: "Cormorant Garamond", Georgia, serif;
}

.lead-modal-open {
    overflow: hidden;
}

.lead-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    font-family: "Instrument Sans", system-ui, sans-serif;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
    animation: lead-overlay-in 0.28s ease;
}

.lead-modal-overlay:not([hidden]) .lead-modal-dialog {
    animation: lead-panel-in 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-modal-overlay.is-success-mode .lead-modal-dialog {
    background:
        radial-gradient(circle at 88% 8%, rgba(37, 103, 71, 0.07), transparent 42%),
        linear-gradient(180deg, #f8fbf9 0%, #fff 55%);
}

.lead-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 34rem;
    max-height: min(92vh, 54rem);
    overflow: auto;
    overscroll-behavior: contain;
    margin: 0;
    border-radius: 1.35rem 1.35rem 0 0;
    background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
    box-shadow: 0 -16px 52px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(23, 32, 51, 0.08);
    scroll-padding-bottom: 6rem;
}

.lead-modal-dialog::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 1.35rem 1.35rem 0 0;
    background: linear-gradient(90deg, #0f172a 0%, #9a7b4f 48%, #256747 100%);
    z-index: 5;
    pointer-events: none;
}

.lead-modal-shell {
    padding: 1.25rem 1.25rem 1.35rem;
}

.lead-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(23, 32, 51, 0.1);
    border-radius: 999px;
    background: rgba(248, 250, 253, 0.96);
    color: #172033;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
}

.lead-modal-header {
    padding-right: 2.75rem;
    margin-bottom: 0.85rem;
}

.lead-modal-kicker {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    font-weight: 700;
    color: #735734;
    margin-bottom: 0.45rem;
}

.lead-modal-title {
    margin: 0 0 0.4rem;
    font-family: "Fraunces", "Cormorant Garamond", serif;
    font-size: clamp(1.65rem, 5vw, 2.05rem);
    line-height: 1.08;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.lead-modal-copy,
.lead-modal-note,
.lead-success-reassurance {
    margin: 0;
    color: #51607c;
    line-height: 1.58;
    font-size: 0.92rem;
}

.lead-onboarding-rail {
    display: flex;
    gap: 0.35rem;
    margin: 0.75rem 0 0.65rem;
    padding: 0;
    list-style: none;
}

.lead-onboarding-rail li {
    flex: 1;
    display: grid;
    gap: 0.25rem;
    padding: 0.55rem 0.45rem;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #8a97ad;
    background: rgba(248, 250, 253, 0.9);
    border: 1px solid rgba(23, 32, 51, 0.06);
}

.lead-onboarding-rail li span {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 0.65rem;
    background: rgba(23, 32, 51, 0.08);
    color: #51607c;
}

.lead-onboarding-rail li.is-active {
    color: #172033;
    background: rgba(232, 245, 236, 0.65);
    border-color: rgba(37, 103, 71, 0.18);
}

.lead-onboarding-rail li.is-active span {
    background: #256747;
    color: #fff;
}

.lead-trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lead-trust-strip li {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #256747;
    background: rgba(37, 103, 71, 0.08);
    border: 1px solid rgba(37, 103, 71, 0.14);
}

.lead-form-view {
    position: relative;
}

.lead-form-view.is-processing .lead-modal-form {
    pointer-events: none;
    opacity: 0.35;
    filter: blur(1px);
}

.lead-modal-form {
    display: grid;
    gap: 0.75rem;
}

.lead-form-grid {
    display: grid;
    gap: 0.75rem;
}

.lead-form-field-wide {
    grid-column: 1 / -1;
}

.lead-form-field .form-label,
.lead-form-check .form-check-label {
    color: #172033;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.lead-form-field .form-control {
    min-height: 3rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border-color: rgba(23, 32, 51, 0.12);
    font-size: 1rem;
    background: #fff;
}

.lead-form-field .form-control:focus {
    border-color: rgba(154, 123, 79, 0.5);
    box-shadow: 0 0 0 3px rgba(154, 123, 79, 0.12);
}

.lead-form-field.is-valid .form-control {
    border-color: rgba(37, 103, 71, 0.38);
}

.lead-form-field.is-invalid .form-control {
    border-color: rgba(140, 47, 57, 0.48);
}

.lead-field-hint {
    display: block;
    min-height: 0.95rem;
    margin-top: 0.25rem;
    font-size: 0.74rem;
    color: #8a97ad;
}

.lead-form-field.is-invalid .lead-field-hint {
    color: #8c2f39;
}

.lead-form-field.is-valid .lead-field-hint {
    color: #256747;
}

.lead-optional-toggle {
    justify-self: start;
    min-height: 2.25rem;
    padding: 0.25rem 0;
    border: none;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #735734;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

.lead-optional-panel {
    display: grid;
    gap: 0.75rem;
}

.lead-form-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.lead-form-check {
    padding: 0.8rem 0.85rem 0.8rem 2.45rem;
    border-radius: 12px;
    background: rgba(248, 250, 253, 0.95);
    border: 1px solid rgba(23, 32, 51, 0.08);
}

.lead-form-field-wide.is-invalid .lead-form-check {
    border-color: rgba(140, 47, 57, 0.22);
    background: rgba(252, 234, 234, 0.35);
}

.lead-form-check .form-check-label {
    font-size: 0.78rem;
    line-height: 1.45;
    font-weight: 500;
}

.lead-modal-actions {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.35rem;
}

.lead-modal-note {
    text-align: center;
    font-size: 0.76rem;
    color: #8a97ad;
}

.lead-modal-buttons {
    display: grid;
    gap: 0.55rem;
}

.lead-submit-primary {
    width: 100%;
    min-height: 3.25rem;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid rgba(115, 87, 52, 0.35);
    box-shadow: 0 14px 32px rgba(115, 87, 52, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lead-submit-primary:hover:not(:disabled),
.lead-submit-primary:focus:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(115, 87, 52, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.lead-submit-primary:disabled {
    transform: none;
}

.lead-submit-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lead-spin 0.65s linear infinite;
}

.lead-submit-spinner.is-visible {
    display: inline-block;
}

.lead-modal-alert {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    background: rgba(248, 250, 253, 0.96);
    color: #51607c;
    line-height: 1.5;
    font-size: 0.86rem;
    margin-bottom: 0.65rem;
}

.lead-modal-alert.is-error {
    background: rgba(252, 234, 234, 0.94);
    border-color: rgba(140, 47, 57, 0.16);
    color: #8c2f39;
    padding-left: 2.35rem;
}

.lead-modal-alert.is-error::before {
    content: "!";
    position: absolute;
    left: 0.9rem;
    top: 0.85rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(140, 47, 57, 0.14);
    color: #8c2f39;
}

.lead-alert-link {
    font-weight: 700;
    color: inherit;
    text-decoration: underline;
}

.lead-processing-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(4px);
}

.lead-processing-card {
    width: min(100%, 18rem);
    padding: 1.15rem 1rem;
    border-radius: 16px;
    text-align: center;
    background: #fff;
    border: 1px solid rgba(154, 123, 79, 0.2);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.lead-processing-ring {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    border: 3px solid rgba(154, 123, 79, 0.18);
    border-top-color: #9a7b4f;
    animation: lead-spin 0.75s linear infinite;
}

.lead-processing-title {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #172033;
}

.lead-processing-steps {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lead-processing-steps li {
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #8a97ad;
    background: rgba(248, 250, 253, 0.95);
    border: 1px solid rgba(23, 32, 51, 0.08);
}

.lead-processing-steps li.is-active {
    color: #735734;
    background: rgba(248, 236, 214, 0.7);
    border-color: rgba(154, 123, 79, 0.28);
}

.lead-processing-steps li.is-done {
    color: #256747;
    background: rgba(232, 245, 236, 0.85);
    border-color: rgba(37, 103, 71, 0.2);
}

.lead-success-view {
    text-align: center;
    padding: 0.5rem 0.25rem 0.75rem;
    animation: lead-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-success-icon {
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #256747;
    background: radial-gradient(circle at 30% 20%, #f0faf3, #e8f5ec 55%, #fff 100%);
    border: 1px solid rgba(37, 103, 71, 0.22);
    box-shadow: 0 14px 32px rgba(37, 103, 71, 0.14);
    animation: lead-success-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-success-badge {
    display: inline-flex;
    margin-bottom: 0.65rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #256747;
    background: rgba(37, 103, 71, 0.1);
    border: 1px solid rgba(37, 103, 71, 0.18);
}

.lead-success-title {
    margin: 0 0 0.45rem;
    font-family: "Fraunces", "Cormorant Garamond", serif;
    font-size: clamp(1.55rem, 4.5vw, 1.9rem);
    line-height: 1.12;
    color: #172033;
}

.lead-success-copy {
    margin: 0 auto 1rem;
    max-width: 26rem;
    font-size: 0.92rem;
}

.lead-success-timeline {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    text-align: left;
}

.lead-success-timeline li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.65rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(248, 250, 253, 0.9);
    border: 1px solid rgba(23, 32, 51, 0.06);
}

.lead-success-timeline li::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: rgba(23, 32, 51, 0.15);
}

.lead-success-timeline li strong {
    display: block;
    font-size: 0.84rem;
    color: #172033;
}

.lead-success-timeline li span {
    grid-column: 2;
    font-size: 0.78rem;
    color: #8a97ad;
}

.lead-success-timeline li.is-done {
    background: rgba(232, 245, 236, 0.55);
    border-color: rgba(37, 103, 71, 0.14);
}

.lead-success-timeline li.is-done::before {
    background: #256747;
}

.lead-success-timeline li.is-active {
    background: rgba(255, 250, 241, 0.9);
    border-color: rgba(154, 123, 79, 0.22);
}

.lead-success-timeline li.is-active::before {
    background: #9a7b4f;
    box-shadow: 0 0 0 4px rgba(154, 123, 79, 0.15);
}

.lead-success-reassurance {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-style: italic;
}

.lead-success-close {
    width: 100%;
    max-width: 16rem;
    min-height: 3rem;
}

@keyframes lead-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lead-panel-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes lead-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lead-success-pop {
    0% {
        transform: scale(0.72);
        opacity: 0;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lead-spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 576px) {
    .lead-modal-overlay {
        align-items: center;
        padding: 1.25rem;
    }

    .lead-modal-dialog {
        border-radius: 1.5rem;
    }

    @keyframes lead-panel-in {
        from {
            opacity: 0;
            transform: translateY(14px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

@media (min-width: 768px) {
    .lead-modal-shell {
        padding: 1.55rem;
    }

    .lead-form-grid-primary,
    .lead-optional-panel .lead-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-onboarding-rail li {
        font-size: 0.72rem;
    }
}

@media (max-width: 575.98px) {
    .lead-modal-dialog {
        max-height: min(96vh, 54rem);
    }

    .lead-modal-shell {
        padding: 1rem 1rem 0;
    }

    .lead-form-field .form-control {
        font-size: 16px;
    }

    .lead-modal-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 0 -1rem;
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(247, 249, 252, 0) 0%, rgba(247, 249, 252, 0.92) 28%, #f7f9fc 100%);
        border-top: 1px solid rgba(23, 32, 51, 0.06);
    }

    .lead-submit-primary {
        min-height: 3.35rem;
    }

    .lead-onboarding-rail li {
        font-size: 0.62rem;
        padding-inline: 0.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lead-modal-overlay,
    .lead-modal-dialog,
    .lead-success-view,
    .lead-success-icon,
    .lead-submit-spinner,
    .lead-processing-ring {
        animation: none;
    }
}
