/**
 * Lead Magnet — Banner, Modal & Newsletter Styles
 *
 * Uses theme variables: --gb-navy, --gb-gold, --gb-text, --gb-white, --gb-border
 * BEM classes match lead-capture.js contract
 */

/* ─── Banner ──────────────────────────────────────────────── */

.lm-banner {
    background: var(--gb-navy);
    color: var(--gb-white);
    padding: 60px 0;
    overflow: hidden;
}

.lm-banner__inner {
    display: flex;
    align-items: center;
    gap: 48px;
}

.lm-banner__content {
    flex: 1;
    min-width: 0;
}

.lm-banner__heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--gb-white);
    line-height: 1.3;
}

.lm-banner__subheading {
    font-size: 18px;
    color: var(--gb-gold);
    margin: 0 0 24px;
    font-weight: 500;
}

.lm-banner__benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.lm-banner__benefits li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.lm-banner__benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gb-gold);
}

.lm-banner__cta {
    display: inline-block;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.2s;
}

.lm-banner__cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.lm-banner__image {
    flex: 0 0 280px;
}

.lm-banner__cover {
    display: block;
    width: 220px;
    height: auto;
    border-radius: 4px;
    box-shadow: 8px 8px 24px rgba(0, 0, 0, 0.4);
    transform: perspective(800px) rotateY(-8deg);
    margin-left: auto;
}

/* ─── Modal ───────────────────────────────────────────────── */

.lm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.lm-modal.is-open {
    display: flex;
}

body.lm-modal-open {
    overflow: hidden;
}

.lm-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;
}

.lm-modal__content {
    position: relative;
    background: var(--gb-white);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 40px 36px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.lm-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.lm-modal__close:hover {
    color: var(--gb-navy);
}

/* Progress */
.lm-modal__progress {
    margin-bottom: 24px;
}

.lm-modal__progress-bar {
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.lm-modal__progress-fill {
    height: 100%;
    background: var(--gb-gold);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.lm-modal__step-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* Title */
.lm-modal__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gb-navy);
    margin: 0 0 28px;
}

/* Steps */
.lm-modal__step {
    display: none;
}

.lm-modal__step.is-active {
    display: block;
}

/* Fields */
.lm-modal__fields-row {
    display: flex;
    gap: 16px;
}

.lm-modal__fields-row .lm-field {
    flex: 1;
}

.lm-field {
    margin-bottom: 18px;
}

.lm-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gb-navy);
    margin-bottom: 6px;
}

.lm-field label .required {
    color: #c0392b;
}

.lm-field input[type="text"],
.lm-field input[type="email"],
.lm-field input[type="tel"],
.lm-field select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--gb-border);
    border-radius: 4px;
    background: var(--gb-white);
    color: var(--gb-text);
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.lm-field input:focus,
.lm-field select:focus {
    outline: none;
    border-color: var(--gb-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.15);
}

/* Error state */
.lm-field.has-error input,
.lm-field.has-error select {
    border-color: #c0392b;
}

.lm-field__error {
    display: block;
    font-size: 13px;
    color: #c0392b;
    margin-top: 4px;
    min-height: 0;
}

/* Checkboxes */
.lm-field--checkbox {
    margin-bottom: 10px;
}

.lm-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 14px;
    color: var(--gb-text);
    cursor: pointer;
    line-height: 1.4;
}

.lm-field--checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--gb-gold);
}

.lm-field--checkbox .lm-field__error {
    padding-left: 28px;
}

/* Consent section */
.lm-modal__consent {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gb-border);
}

.lm-modal__consent-intro {
    font-size: 14px;
    font-weight: 600;
    color: var(--gb-navy);
    margin: 0 0 8px;
}

.lm-modal__consent-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 16px;
}

.lm-modal__consent-text a {
    color: var(--gb-gold);
    text-decoration: underline;
}

/* Buttons */
.lm-modal__next-btn,
.lm-modal__submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 24px;
    transition: background 0.2s, transform 0.2s;
}

.lm-modal__next-btn:hover,
.lm-modal__submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.lm-modal__next-btn.is-loading,
.lm-modal__submit-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Step 2 — Motivations */
.lm-modal__motivations {
    border: none;
    padding: 0;
    margin: 0 0 8px;
}

.lm-modal__motivations legend {
    font-size: 14px;
    font-weight: 600;
    color: var(--gb-navy);
    margin-bottom: 12px;
}

.lm-modal__motivations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lm-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gb-text);
    cursor: pointer;
}

.lm-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--gb-gold);
}

/* Referral "Other" field toggle — JS shows/hides via inline style */
.lm-field--other {
    margin-top: -8px;
}

/* Thank you state */
.lm-modal__thankyou {
    display: none;
    text-align: center;
    padding: 40px 0;
}

.lm-modal__thankyou.is-active {
    display: block;
}

.lm-modal__thankyou-inner h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--gb-navy);
    margin: 20px 0 12px;
}

.lm-modal__thankyou-inner p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 8px;
}

.lm-modal__download-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 32px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.lm-modal__check-icon {
    color: var(--gb-gold);
}

/* ─── Newsletter (Footer Stacked) ─────────────────────────── */

.lm-newsletter {
    margin-top: 24px;
}

.lm-newsletter__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--gb-white);
    margin: 0 0 10px;
}

.lm-newsletter .lm-field {
    margin-bottom: 10px;
}

.lm-newsletter .lm-field input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--gb-white);
    font-family: inherit;
    box-sizing: border-box;
}

.lm-newsletter .lm-field input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.lm-newsletter .lm-field input[type="email"]:focus {
    outline: none;
    border-color: var(--gb-gold);
    background: rgba(255, 255, 255, 0.15);
}

.lm-newsletter .lm-field .lm-field__error {
    font-size: 12px;
    color: #e74c3c;
}

.lm-newsletter__submit-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.lm-newsletter__submit-btn:hover {
    filter: brightness(1.1);
}

.lm-newsletter__submit-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.lm-newsletter__tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 8px 0 0;
}

.lm-newsletter__thankyou p {
    font-size: 14px;
    font-weight: 600;
    color: var(--gb-gold);
    margin: 0;
}

/* ─── btn-gold (shared utility) ───────────────────────────── */
/* Theme may already define .btn-gold — these are lead-magnet-specific overrides */

.lm-banner__cta.btn-gold,
.lm-modal__next-btn.btn-gold,
.lm-modal__submit-btn.btn-gold,
.lm-newsletter__submit-btn.btn-gold {
    background: var(--gb-gold);
    color: var(--gb-navy);
    border-radius: 4px;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {

    .lm-banner {
        padding: 40px 0;
    }

    .lm-banner__inner {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }

    .lm-banner__heading {
        font-size: 24px;
    }

    .lm-banner__subheading {
        font-size: 16px;
    }

    .lm-banner__benefits {
        text-align: left;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .lm-banner__image {
        flex: none;
    }

    .lm-banner__cover {
        width: 180px;
        margin: 0 auto;
        transform: none;
    }

    .lm-modal__content {
        margin: 16px;
        padding: 28px 20px;
        max-height: 85vh;
    }

    .lm-modal__title {
        font-size: 20px;
    }

    .lm-modal__fields-row {
        flex-direction: column;
        gap: 0;
    }

    .lm-modal__motivations-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 480px) {
    .lm-banner__heading {
        font-size: 20px;
    }

    .lm-banner__benefits li {
        font-size: 14px;
    }

    .lm-modal__content {
        padding: 24px 16px;
    }
}
