/* ═══════════════════════════════════════════════════════════
   LEAD GATE — pré-WhatsApp (2 passos · segmento → nicho)
   ═══════════════════════════════════════════════════════════ */

body.lead-gate-open {
    overflow: hidden;
}

.lead-gate {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    pointer-events: none;
}

.lead-gate.is-open {
    pointer-events: auto;
}

.lead-gate__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 26, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.lead-gate.is-open .lead-gate__backdrop {
    opacity: 1;
}

.lead-gate__sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26.5rem;
    max-height: min(92vh, 50rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-color, #F5F5F3);
    border: 1px solid rgba(141, 122, 101, 0.4);
    border-radius: 1.1rem 1.1rem 0 0;
    padding: 1.35rem 1.15rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow:
        0 -20px 60px rgba(28, 28, 26, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(105%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.lead-gate.is-open .lead-gate__sheet {
    transform: translateY(0);
}

.lead-gate__sheet-accent {
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, #B8A38E 20%, #CBA381 50%, #B8A38E 80%, transparent);
    pointer-events: none;
}

.lead-gate__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(141, 122, 101, 0.35);
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 2px;
}

.lead-gate__back {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin: 0 0 0.5rem;
    padding: 0.25rem 0;
    border: none;
    background: transparent;
    color: var(--gold-accent-strong, #6E5438);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
}

.lead-gate__progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(141, 122, 101, 0.18);
}

.lead-gate__progress-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-soft, #8D7A65);
}

.lead-gate__progress-dots {
    display: inline-flex;
    gap: 0.35rem;
}

.lead-gate__progress-dots i {
    display: block;
    width: 1.35rem;
    height: 3px;
    background: rgba(141, 122, 101, 0.22);
    border-radius: 1px;
    font-style: normal;
    transition: background 0.2s, width 0.2s;
}

.lead-gate__progress-dots i.is-active {
    background: rgba(141, 122, 101, 0.45);
}

.lead-gate__progress-dots i.is-current {
    width: 2rem;
    background: linear-gradient(90deg, #CBA381, #9F8265);
}

.lead-gate__eyebrow {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--gold-accent-strong, #6E5438);
    margin: 0 0 0.3rem;
}

.lead-gate__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 2rem 0.3rem 0;
    color: var(--text-color);
    line-height: 1.28;
}

.lead-gate__subtitle {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted, #5C5C56);
    margin: 0 0 0.75rem;
}

.lead-gate__plan-hint {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-accent-strong, #6E5438);
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(141, 122, 101, 0.38);
    background: linear-gradient(135deg, rgba(232, 213, 196, 0.2), rgba(255, 255, 255, 0.35));
}

.lead-gate__legend {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-color);
    margin: 0 0 0.55rem;
}

.lead-gate__optional {
    font-weight: 400;
    opacity: 0.5;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Passo 1: segmentos ── */
.lead-gate__segment-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.lead-gate__segment {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.8rem;
    min-height: 52px;
    border: 1px solid rgba(141, 122, 101, 0.32);
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.lead-gate__segment:hover {
    border-color: rgba(141, 122, 101, 0.55);
    box-shadow: 0 4px 16px rgba(110, 84, 56, 0.08);
}

.lead-gate__segment:active {
    transform: scale(0.99);
}

.lead-gate__segment--gold {
    border-color: rgba(184, 163, 142, 0.55);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(232, 213, 196, 0.18));
}

.lead-gate__segment--gold .lead-gate__segment-icon {
    color: #9F8265;
    border-color: rgba(184, 163, 142, 0.5);
}

.lead-gate__segment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 10px;
    color: var(--text-soft, #8D7A65);
    border: 1px solid rgba(141, 122, 101, 0.28);
    border-radius: 2px;
    flex-shrink: 0;
}

.lead-gate__segment-body {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.lead-gate__segment-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-color);
}

.lead-gate__segment-hint {
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted, #5C5C56);
}

.lead-gate__segment-chevron {
    font-size: 1.1rem;
    line-height: 1;
    color: rgba(141, 122, 101, 0.55);
}

.lead-gate__segment:focus-visible {
    outline: 2px solid var(--gold-accent, #B8A38E);
    outline-offset: 2px;
}

/* ── Passo 2: nichos ── */
.lead-gate__niche-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.lead-gate__niche {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 0.45rem;
    border: 1px solid rgba(141, 122, 101, 0.32);
    background: rgba(255, 255, 255, 0.45);
    color: var(--text-color);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lead-gate__niche.is-selected {
    background: var(--text-color, #1C1C1A);
    border-color: var(--text-color, #1C1C1A);
    color: var(--bg-color, #F5F5F3);
}

.lead-gate__niche:focus-visible {
    outline: 2px solid var(--gold-accent, #B8A38E);
    outline-offset: 2px;
}

.lead-gate__niche-more {
    display: block;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.5rem;
    border: none;
    border-bottom: 1px solid rgba(141, 122, 101, 0.28);
    background: transparent;
    color: var(--gold-accent-strong, #6E5438);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
}

/* ── Detalhes (após nicho) ── */
.lead-gate__details {
    margin-top: 0.85rem;
    animation: leadGateDetailsIn 0.28s ease;
}

.lead-gate__details.is-visible {
    display: block;
}

@keyframes leadGateDetailsIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-gate__stitch {
    height: 1px;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, transparent, rgba(141, 122, 101, 0.35), transparent);
}

.lead-gate__details-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-soft, #8D7A65);
    margin: 0 0 0.55rem;
}

.lead-gate__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lead-gate__chip {
    border: 1px solid rgba(141, 122, 101, 0.32);
    background: rgba(255, 255, 255, 0.45);
    color: var(--text-color);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
    padding: 0.45rem 0.55rem;
    min-height: 36px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s, border-color 0.15s;
}

.lead-gate__chip--sm {
    font-size: 9px;
    min-height: 34px;
}

.lead-gate__chip.is-selected {
    background: var(--text-color, #1C1C1A);
    border-color: var(--text-color, #1C1C1A);
    color: var(--bg-color, #F5F5F3);
}

.lead-gate__other label,
.lead-gate__field label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

.lead-gate__other {
    margin-top: 0.55rem;
}

.lead-gate__input {
    width: 100%;
    border: 1px solid rgba(141, 122, 101, 0.35);
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-color);
    font-size: 14px;
    padding: 0.65rem 0.75rem;
    border-radius: 2px;
    min-height: 44px;
}

.lead-gate__input:focus {
    outline: 2px solid var(--gold-accent, #B8A38E);
    outline-offset: 1px;
    border-color: var(--gold-accent, #B8A38E);
}

.lead-gate__field {
    margin-bottom: 0.7rem;
}

.lead-gate__privacy {
    font-size: 9px;
    line-height: 1.45;
    color: var(--text-muted, #5C5C56);
    margin: 0.85rem 0 0.65rem;
}

.lead-gate__privacy a {
    color: var(--gold-accent-strong, #6E5438);
    text-decoration: underline;
}

.lead-gate__submit {
    width: 100%;
    min-height: 48px;
    border: none;
    background: linear-gradient(135deg, #CBA381 0%, #9F8265 50%, #765D46 100%);
    color: #111;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    cursor: pointer;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(154, 120, 88, 0.25);
    transition: opacity 0.2s, box-shadow 0.2s;
}

.lead-gate__submit:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    box-shadow: none;
}

.lead-gate__submit:not(:disabled):hover {
    opacity: 0.94;
}

@media (min-width: 640px) {
    .lead-gate {
        align-items: center;
        padding: 1.5rem;
    }

    .lead-gate__sheet {
        border-radius: 4px;
        max-height: min(88vh, 46rem);
        padding: 1.5rem 1.35rem 1.35rem;
        transform: translateY(10px) scale(0.98);
        opacity: 0;
        transition: transform 0.28s ease, opacity 0.28s ease;
    }

    .lead-gate.is-open .lead-gate__sheet {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

[data-theme="obsidian"] .lead-gate__sheet {
    background: #0E0E0E;
    border-color: rgba(232, 213, 196, 0.22);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
}

[data-theme="obsidian"] .lead-gate__segment,
[data-theme="obsidian"] .lead-gate__niche,
[data-theme="obsidian"] .lead-gate__chip {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(232, 213, 196, 0.2);
    color: #F4F2EE;
}

[data-theme="obsidian"] .lead-gate__segment--gold {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(184, 163, 142, 0.08));
}

[data-theme="obsidian"] .lead-gate__niche.is-selected,
[data-theme="obsidian"] .lead-gate__chip.is-selected {
    background: var(--gold-accent, #B8A38E);
    color: #111;
    border-color: var(--gold-accent, #B8A38E);
}

[data-theme="obsidian"] .lead-gate__input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(232, 213, 196, 0.22);
    color: #F4F2EE;
}

@media (prefers-reduced-motion: reduce) {
    .lead-gate__sheet,
    .lead-gate__backdrop,
    .lead-gate__details {
        animation: none;
        transition: none;
    }
}
