/* ═══════════════════════════════════════════════════════════════
   GreenPlay — Portrait Single-Video Paywall
   Mobile-first, green & white
   ═══════════════════════════════════════════════════════════════ */

:root {
    --c-primary: #1d8f43;
    --c-accent:  #0f5c2a;
    --c-tint12:  rgba(29,143,67,.12);
    --c-tint30:  rgba(29,143,67,.30);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Scene (full-screen video stage) ─────────────────────────── */
.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
}

/* ── Main video ───────────────────────────────────────────────── */
.main-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    background: #000;
}

/* ── Timer bar (top edge) ─────────────────────────────────────── */
.timer-track {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: rgba(255,255,255,.25);
    z-index: 20;
}
.timer-fill {
    height: 100%;
    background: var(--c-primary);
    width: 100%;
    transform-origin: left;
    will-change: width;
}

/* ── Countdown badge ──────────────────────────────────────────── */
.countdown-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--c-primary);
    z-index: 21;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: .3px;
    transition: opacity .3s;
}
.countdown-badge:empty { display: none; }

/* ── Mute button ──────────────────────────────────────────────── */
.mute-btn {
    position: absolute;
    bottom: 20px;
    right: 16px;
    width: 42px;
    height: 42px;
    background: rgba(0,0,0,.55);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 22;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .2s;
    -webkit-tap-highlight-color: transparent;
}
.mute-btn:active { background: rgba(0,0,0,.75); }

/* ── Fullscreen button ────────────────────────────────────────── */
.fs-btn {
    position: absolute;
    bottom: 20px;
    left: 16px;
    width: 42px;
    height: 42px;
    background: rgba(0,0,0,.55);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 22;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .2s;
    -webkit-tap-highlight-color: transparent;
}
.fs-btn:active { background: rgba(0,0,0,.75); }

/* ── Tap-to-play overlay ──────────────────────────────────────── */
.tap-to-play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    z-index: 23;
    background: rgba(0,0,0,.35);
}
.tap-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.tap-to-play p {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ── No-video placeholder ─────────────────────────────────────── */
.no-video-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0a1f0f 0%, #1a4a25 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.placeholder-inner { text-align: center; color: rgba(255,255,255,.75); }
.placeholder-icon  { font-size: 64px; margin-bottom: 16px; }
.placeholder-inner p { font-size: 15px; font-weight: 500; }

/* ── Blur/darken overlay ──────────────────────────────────────── */
.blur-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(14px) brightness(.35);
    -webkit-backdrop-filter: blur(14px) brightness(.35);
    opacity: 0;
    transition: opacity .45s ease;
    pointer-events: none;
    z-index: 15;
}
.blur-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════
   PAYMENT BOTTOM SHEET
   ════════════════════════════════════════════════════════════════ */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}
.sheet-backdrop.active { pointer-events: auto; }

.payment-sheet {
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 520px;
    padding: 0 22px 44px;
    transform: translateY(105%);
    transition: transform .42s cubic-bezier(.32,1.1,.6,1);
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.payment-sheet.open { transform: translateY(0); }

/* Handle */
.sheet-handle {
    width: 40px;
    height: 4px;
    background: #dde0de;
    border-radius: 2px;
    margin: 14px auto 22px;
    flex-shrink: 0;
}

/* Lock icon circle */
.sheet-lock-icon {
    width: 66px;
    height: 66px;
    background: var(--c-tint12);
    border: 2px solid var(--c-tint30);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--c-primary);
}

/* Sheet text */
.sheet-title {
    font-size: 21px;
    font-weight: 800;
    color: #111;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.3;
}
.sheet-desc {
    font-size: 14px;
    color: #5a6060;
    text-align: center;
    margin-bottom: 18px;
    line-height: 1.6;
}

/* Price badge */
.price-badge {
    background: var(--c-primary);
    color: #fff;
    text-align: center;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -.3px;
}
.price-badge span {
    font-size: 15px;
    font-weight: 600;
    opacity: .85;
    margin-left: 2px;
}

/* Error message */
.error-msg {
    background: #fdecea;
    border: 1px solid #f5a5a5;
    color: #c0392b;
    font-size: 13px;
    padding: 9px 13px;
    border-radius: 10px;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Phone label */
.phone-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 7px;
}

/* Phone input row */
.phone-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #dde0de;
    border-radius: 13px;
    overflow: hidden;
    margin-bottom: 14px;
    transition: border-color .2s;
}
.phone-group:focus-within { border-color: var(--c-primary); }

.phone-prefix {
    background: #f4f6f4;
    padding: 14px;
    font-weight: 700;
    font-size: 15px;
    color: #333;
    border-right: 1.5px solid #dde0de;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.phone-group input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px;
    font-size: 18px;
    background: #fff;
    color: #111;
    min-width: 0;
}
.phone-group input::placeholder { color: #bbb; }

/* Pay button */
.pay-btn {
    width: 100%;
    background: var(--c-primary);
    color: #fff;
    border: none;
    padding: 17px 16px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity .2s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: .1px;
}
.pay-btn:active  { transform: scale(.985); }
.pay-btn:disabled { opacity: .6; cursor: not-allowed; }

.retry-btn { margin-top: 16px; background: var(--c-accent); }

/* Spinner inside button */
.pay-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Powered-by */
.powered-by {
    text-align: center;
    font-size: 12px;
    color: #aab0aa;
    margin-top: 18px;
}

/* ── Status sections ──────────────────────────────────────────── */
#sectionWaiting,
#sectionSuccess,
#sectionFailed { text-align: center; padding-top: 4px; }

.status-icon-wrap {
    font-size: 56px;
    display: block;
    margin-bottom: 14px;
}
.status-title {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
}
.status-body {
    font-size: 14px;
    color: #5a6060;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* USSD tip box */
.ussd-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--c-tint12);
    border: 1px solid var(--c-tint30);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: #2a5a38;
    line-height: 1.45;
    text-align: left;
    margin-bottom: 18px;
}

/* Pulse dots */
.pulse-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}
.pulse-dots span {
    width: 10px;
    height: 10px;
    background: var(--c-primary);
    border-radius: 50%;
    animation: pulseDot 1.4s ease-in-out infinite;
}
.pulse-dots span:nth-child(2) { animation-delay: .22s; }
.pulse-dots span:nth-child(3) { animation-delay: .44s; }
@keyframes pulseDot {
    0%, 80%, 100% { transform: scale(.6); opacity: .5; }
    40%            { transform: scale(1);  opacity: 1;   }
}

.poll-status {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

/* Redirect row */
.redirect-msg {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--c-primary);
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}
.redirect-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--c-tint30);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

/* ── Wide-screen centering ────────────────────────────────────── */
@media (min-width: 520px) {
    .payment-sheet {
        border-radius: 24px;
        margin-bottom: 48px;
        max-width: 420px;
    }
    .sheet-backdrop { align-items: center; }
}
