/* =============================================
   Content Gate Pro v4
   ============================================= */

/* --- GATE CONTAINER (fixed fullscreen) --- */
.cgp-fullpage-gate {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    transition: opacity 0.5s ease;
}
.cgp-fullpage-gate.cgp-hidden {
    opacity: 0;
    pointer-events: none !important;
    visibility: hidden;
}

/* --- OVERLAY (from teaser cutoff to bottom) --- */
.cgp-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #ffffff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- GATE BOX --- */
.cgp-gate-box {
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.08), 0 2px 10px rgba(0,0,0,0.04);
    box-sizing: border-box;
    flex-shrink: 0;
}

/* --- Icon --- */
.cgp-gate-icon { margin-bottom: 10px; color: #4361ee; }
.cgp-gate-icon svg { stroke: currentColor; }

/* --- Text --- */
.cgp-heading {
    font-size: 20px; font-weight: 700; color: #1a1a2e;
    margin: 0 0 4px; line-height: 1.3;
}
.cgp-description {
    font-size: 14px; color: #555;
    margin: 0 0 18px; line-height: 1.4;
}

/* --- Form (stacked layout — works on all screens) --- */
.cgp-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    position: relative;
}

.cgp-input {
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px; /* 16px prevents iOS zoom */
    outline: none;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cgp-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67,97,238,0.15);
}

.cgp-submit-btn {
    padding: 13px 20px;
    border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600;
    color: #fff; background-color: #4361ee;
    cursor: pointer;
    -webkit-appearance: none; appearance: none;
    transition: filter 0.2s, transform 0.1s;
    width: 100%;
}
.cgp-submit-btn:hover { filter: brightness(0.92); transform: translateY(-1px); }
.cgp-submit-btn:active { transform: translateY(0); }
.cgp-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Privacy --- */
.cgp-privacy {
    font-size: 11px; color: #999;
    margin: 12px 0 0; line-height: 1.4;
}

/* --- Messages --- */
.cgp-message {
    margin-top: 10px; padding: 10px 14px;
    border-radius: 8px; font-size: 13px;
    box-sizing: border-box;
}
.cgp-message.cgp-error   { background:#fff0f0; color:#d63031; border:1px solid #ffcccc; }
.cgp-message.cgp-success { background:#f0fff4; color:#27ae60; border:1px solid #c3fcd6; }

/* --- Spinner --- */
.cgp-spinner { margin-top: 10px; }
.cgp-loading {
    display: inline-block; width: 22px; height: 22px;
    border: 3px solid #dee2e6; border-top-color: #4361ee;
    border-radius: 50%; animation: cgp-spin 0.7s linear infinite;
}
@keyframes cgp-spin { to { transform: rotate(360deg); } }

/* --- Body lock --- */
body.cgp-body-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}
html.cgp-html-locked { overflow: hidden !important; }

/* --- Content fade --- */
.cgp-content-faded {
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 90%) !important;
    mask-image: linear-gradient(to bottom, black 40%, transparent 90%) !important;
}

/* --- reCAPTCHA badge --- */
.grecaptcha-badge { z-index: 1000000 !important; }

/* =============================================
   MOBILE (under 680px)
   ============================================= */
@media (max-width: 680px) {
    .cgp-overlay {
        padding: 14px 12px 20px;
        align-items: flex-start;
    }

    .cgp-gate-box {
        padding: 20px 16px 24px;
        border-radius: 12px;
        box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
    }

    .cgp-gate-icon { margin-bottom: 6px; }
    .cgp-gate-icon svg { width: 32px; height: 32px; }

    .cgp-heading {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .cgp-description {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .cgp-form { gap: 8px; }

    .cgp-input {
        padding: 12px 12px;
        font-size: 16px;
    }

    .cgp-submit-btn {
        padding: 13px 16px;
        font-size: 16px;
    }

    .cgp-privacy {
        font-size: 10px;
        margin-top: 8px;
    }
}

/* Extra small (iPhone SE, Galaxy Fold) */
@media (max-width: 380px) {
    .cgp-gate-box {
        padding: 16px 12px 20px;
    }
    .cgp-heading { font-size: 16px; }
    .cgp-description { font-size: 12px; margin-bottom: 10px; }
    .cgp-gate-icon svg { width: 28px; height: 28px; }
    .cgp-gate-icon { margin-bottom: 4px; }
}
