/* ========================================
   GOLDTRENDIA — VIDEO GATE
   Il lead atterra, guarda il video, poi si apre il modulo.
   ======================================== */

.gate {
    position: fixed;
    inset: 0;
    z-index: 11000;              /* sopra il form-overlay (10000) */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: #0b0b0c;
    overflow-y: auto;
}

.gate.open { display: flex; }

.gate-inner {
    width: 100%;
    max-width: 860px;
    margin: auto;
    text-align: center;
}

.gate-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-primary, #3B9EF5);
    border: 1px solid rgba(59, 158, 245, 0.4);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1rem;
}

.gate-title {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: clamp(1.4rem, 3.4vw, 2.1rem);
    line-height: 1.25;
    margin: 0 0 0.6rem;
}

.gate-sub {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 40rem;
    margin: 0 auto 1.5rem;
}

/* ---------- PLAYER ---------- */

.gate-player {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Il rapporto viene impostato via JS sulla base del video reale,
   così funziona sia con un verticale sia con un orizzontale. */
.gate-player video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 62vh;
    object-fit: contain;
    background: #000;
}

.gate-play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    border: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.gate-play svg { width: 58px; height: 58px; }
.gate-play:hover { background: rgba(0, 0, 0, 0.42); }

/* ---------- PROGRESSO ---------- */

.gate-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 2px;
    margin: 1.1rem auto 0;
    max-width: 720px;
    overflow: hidden;
}

.gate-bar {
    height: 100%;
    width: 0;
    background: var(--gold-primary, #3B9EF5);
    transition: width 0.25s linear;
}

.gate-status {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 0.7rem;
    min-height: 1.2em;
}

/* ---------- SBLOCCO ---------- */

.gate-cta {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.95rem 2.1rem;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.38);
    transition: background 0.25s, color 0.25s, transform 0.18s;
}

.gate-cta.unlocked {
    cursor: pointer;
    background: var(--gold-primary, #3B9EF5);
    color: #fff;
    box-shadow: 0 10px 34px rgba(59, 158, 245, 0.35);
}

.gate-cta.unlocked:hover { transform: translateY(-2px); }

.gate-note {
    color: rgba(255, 255, 255, 0.34);
    font-size: 0.74rem;
    margin-top: 1rem;
    line-height: 1.55;
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
}

/* Nel percorso guidato il modulo non si chiude:
   la classe viene messa da funnel.js all'apertura. */
.form-overlay.no-escape .modal-close { display: none; }

@media (max-width: 640px) {
    .gate { padding: 0.9rem; align-items: flex-start; }
    .gate-inner { padding-top: 1.5rem; }
    .gate-player video { max-height: 54vh; }
    .gate-cta { width: 100%; justify-content: center; }
}
