/**
 * VDO.AI Gated Content
 *
 * Styles the gate wrapper only. The form itself is styled by Forminator
 * (Forminator → the form → Appearance). Colours, width and fade come from
 * Settings → Gated Content as CSS variables on .vgc-gate.
 *
 * Styles:
 *   spotlight  tinted "what's locked" panel + raised white form card (default)
 *   card       single tinted box
 *   plain      no box, blends into the article
 */
.vgc-gate {
    --vgc-accent: #cc0200;
    --vgc-box-bg: #fff4f3;
    --vgc-ink: var(--vgc-text, #1f1f1f);
    --vgc-muted: #6e6262;
    --vgc-success: #1f8a4c;

    position: relative;
    margin: 0 0 2.5em;
}

/* ---------- Teaser fade ---------- */
.vgc-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: var(--vgc-fade-height, 140px);
    background: linear-gradient(to bottom, transparent, var(--vgc-fade-color, #ffffff));
    pointer-events: none;
}

/* ---------- Box ---------- */
.vgc-box {
    position: relative;
    max-width: var(--vgc-max-width, none);
    color: var(--vgc-ink);
    box-sizing: border-box;
}

.vgc-gate--align-center .vgc-box {
    margin-left: auto;
    margin-right: auto;
}

.vgc-gate--spotlight .vgc-box,
.vgc-gate--card .vgc-box {
    padding: 28px 28px 26px;
    background: var(--vgc-box-bg);
    border: 1px solid color-mix(in srgb, var(--vgc-accent) 16%, transparent);
    border-radius: 18px;
}

/* Raised white card that holds the form (spotlight only) */
.vgc-gate--spotlight .vgc-panel {
    margin-top: 22px;
    padding: 22px 24px 18px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow:
        0 1px 2px color-mix(in srgb, var(--vgc-accent) 8%, transparent),
        0 18px 36px -18px color-mix(in srgb, var(--vgc-accent) 38%, transparent);
}

.vgc-gate--card .vgc-panel,
.vgc-gate--plain .vgc-panel {
    margin-top: 18px;
}

.vgc-gate--template .vgc-panel {
    margin-top: 0;
}

/* ---------- Header ---------- */
.vgc-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vgc-gate--align-center .vgc-head {
    flex-direction: column;
    text-align: center;
}

.vgc-badge {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--vgc-accent);
    color: #ffffff;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Pulse rings */
.vgc-badge::before,
.vgc-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--vgc-accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.vgc-lock {
    width: 24px;
    height: 24px;
    overflow: visible;
    transform-origin: 50% 85%;
}

.vgc-lock__shackle {
    transform-box: fill-box;
    transform-origin: 100% 100%;
    transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.vgc-lock__hole {
    fill: var(--vgc-accent);
    transition: fill 0.3s ease;
}

.vgc-gate .vgc-heading {
    margin: 0;
    font-size: clamp(22px, 2.6vw, 28px);
    line-height: 1.2;
    color: var(--vgc-ink);
}

.vgc-gate .vgc-meta {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--vgc-muted);
}

.vgc-gate .vgc-description {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.vgc-gate .vgc-description p {
    margin: 0 0 0.6em;
}

.vgc-gate .vgc-description p:last-child {
    margin-bottom: 0;
}

.vgc-gate--align-center .vgc-description {
    text-align: center;
}

/* ---------- What's inside ---------- */
.vgc-gate .vgc-outline {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.vgc-gate .vgc-outline li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--vgc-ink);
}

.vgc-outline__icon {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    color: var(--vgc-accent);
}

.vgc-outline__icon .vgc-lock__hole {
    fill: var(--vgc-box-bg);
}

.vgc-gate--align-center .vgc-outline {
    justify-content: center;
}

.vgc-gate .vgc-note {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--vgc-muted);
}

/* ---------- Motion ---------- */
/* Hidden state only once JS has confirmed it will reveal it (.vgc-js) */
.vgc-gate--animate.vgc-js .vgc-box {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.vgc-gate--animate.vgc-js.is-inview .vgc-box {
    opacity: 1;
    transform: none;
}

/* Lock jiggles like a locked door, then repeats briefly every few seconds */
.vgc-gate--animate.is-inview .vgc-head .vgc-lock {
    animation: vgc-jiggle 7s 0.6s ease-in-out infinite;
}

.vgc-gate--animate.is-inview .vgc-head .vgc-lock__shackle {
    animation: vgc-tug 7s 0.6s ease-in-out infinite;
}

.vgc-gate--animate.is-inview .vgc-badge::before {
    animation: vgc-ring 3.5s 1.3s ease-out infinite;
}

.vgc-gate--animate.is-inview .vgc-badge::after {
    animation: vgc-ring 3.5s 1.65s ease-out infinite;
}

/* Reader started filling the form: stop nagging */
.vgc-gate.is-engaged .vgc-head .vgc-lock,
.vgc-gate.is-engaged .vgc-head .vgc-lock__shackle,
.vgc-gate.is-engaged .vgc-badge::before,
.vgc-gate.is-engaged .vgc-badge::after {
    animation: none;
}

/* Successful submit: shackle springs open, badge turns green */
.vgc-gate.is-unlocking .vgc-badge {
    background: var(--vgc-success);
    transform: scale(1.08);
}

.vgc-gate.is-unlocking .vgc-head .vgc-lock,
.vgc-gate.is-unlocking .vgc-badge::before,
.vgc-gate.is-unlocking .vgc-badge::after {
    animation: none;
}

.vgc-gate.is-unlocking .vgc-head .vgc-lock__shackle {
    animation: none;
    transform: translateY(-3px) rotate(28deg);
}

.vgc-gate.is-unlocking .vgc-lock__hole {
    fill: var(--vgc-success);
}

/* Returning visitor: dim the gate while the content loads */
.vgc-gate--loading .vgc-box {
    opacity: 0.4;
    pointer-events: none;
}

.vgc-unlocked {
    animation: vgc-reveal 0.6s ease both;
}

@keyframes vgc-jiggle {
    0%, 14%, 100% { transform: rotate(0); }
    2%  { transform: rotate(-13deg); }
    4%  { transform: rotate(11deg); }
    6%  { transform: rotate(-8deg); }
    8%  { transform: rotate(5deg); }
    10% { transform: rotate(-2deg); }
}

@keyframes vgc-tug {
    0%, 12%, 100% { transform: translateY(0); }
    3%, 7% { transform: translateY(-1.6px); }
    5%, 9% { transform: translateY(0); }
}

@keyframes vgc-ring {
    0%   { transform: scale(1); opacity: 0.55; }
    55%, 100% { transform: scale(1.9); opacity: 0; }
}

@keyframes vgc-reveal {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .vgc-gate--animate.vgc-js .vgc-box {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .vgc-gate .vgc-lock,
    .vgc-gate .vgc-lock__shackle,
    .vgc-gate .vgc-badge::before,
    .vgc-gate .vgc-badge::after,
    .vgc-unlocked {
        animation: none !important;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
    .vgc-gate--spotlight .vgc-box,
    .vgc-gate--card .vgc-box {
        padding: 22px 16px 18px;
        border-radius: 14px;
    }

    .vgc-gate--spotlight .vgc-panel {
        margin-top: 18px;
        padding: 18px 16px 14px;
    }

    .vgc-head {
        gap: 12px;
    }

    .vgc-badge {
        width: 44px;
        height: 44px;
    }

    .vgc-lock {
        width: 20px;
        height: 20px;
    }
}
