/* ============================================================
   V1DShorts — Watch Gate Modal
   ------------------------------------------------------------
   Anonymous feed-access gate. Mengikuti palet v1dshorts (pink →
   purple gradient, glass-card gelap, font Poppins). Mobile-first.
============================================================ */

.wg-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(14px, 4vw, 28px);
    animation: wg-fade-in .22s var(--vs-ease, ease) both;
}
.wg-modal[hidden] { display: none; }

.wg-backdrop {
    position: absolute; inset: 0;
    background: radial-gradient(120% 90% at 50% 0%,
                rgba(120,34,220,.28) 0%,
                rgba(0,0,0,.78) 55%,
                rgba(0,0,0,.92) 100%);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.wg-card {
    position: relative;
    width: 100%; max-width: 460px;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    background: linear-gradient(160deg,
        rgba(28,26,40,.92) 0%,
        rgba(14,13,21,.96) 100%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    padding: clamp(24px, 5vw, 34px) clamp(20px, 5vw, 30px) clamp(22px, 4.5vw, 30px);
    box-shadow:
        0 30px 70px -20px rgba(120,34,220,.45),
        0 18px 44px -16px rgba(255,0,128,.32),
        inset 0 1px 0 rgba(255,255,255,.05);
    animation: wg-pop .26s var(--vs-ease, ease) both;
}
.wg-card::before {
    content:""; position:absolute; inset:0 0 auto 0; height:2px;
    border-top-left-radius:24px; border-top-right-radius:24px;
    background: linear-gradient(90deg,
        transparent, rgba(255,0,128,.7), rgba(120,34,220,.7), transparent);
}

.wg-close {
    position: absolute; top: 12px; right: 14px;
    width: 34px; height: 34px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    color: #cfcfd8;
    border-radius: 50%;
    font-size: 22px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.wg-close:hover { background: rgba(255,0,128,.18); color: #fff; transform: rotate(90deg); }

.wg-step { display: none; }
.wg-step:not([hidden]) { display: block; animation: wg-slide-in .22s var(--vs-ease, ease) both; }

.wg-badge {
    display: inline-flex; align-items: center;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,0,128,.07);
    border: 1px solid rgba(255,0,128,.28);
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 1.6px; text-transform: uppercase;
    color: #ff6db0;
    margin-bottom: 14px;
}
.wg-badge-grad {
    background: linear-gradient(90deg, rgba(255,0,128,.14), rgba(120,34,220,.14));
    border-color: rgba(255,0,128,.32);
    color: #ffb1d2;
}

.wg-h {
    margin: 0 0 8px;
    font-size: clamp(20px, 5.2vw, 26px);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.18;
    color: #fff;
}
.wg-sub {
    margin: 0 0 22px;
    color: #c2c2cf;
    font-size: 14px; line-height: 1.6;
}
.wg-sub strong { color: #fff; font-weight: 700; }
.wg-warn {
    display: block;
    margin-top: 10px;
    color: #ffb1d2;
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------- Choice rows (step 1) ---------- */
.wg-choices {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 14px;
}
.wg-choice {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
    width: 100%;
    font: inherit;
    text-decoration: none;
}
.wg-choice:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,0,128,.35);
    transform: translateY(-1px);
}
.wg-choice-primary {
    background: linear-gradient(135deg, rgba(255,0,128,.18), rgba(120,34,220,.18));
    border-color: rgba(255,0,128,.45);
}
.wg-choice-primary:hover {
    background: linear-gradient(135deg, rgba(255,0,128,.26), rgba(120,34,220,.26));
    border-color: rgba(255,0,128,.6);
}
.wg-choice-ic {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.wg-choice-primary .wg-choice-ic {
    background: linear-gradient(160deg, #ff0080, #7822dc);
    box-shadow: 0 8px 18px -6px rgba(255,0,128,.6);
}
.wg-choice-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-choice-t  { font-weight: 700; font-size: 15px; color: #fff; }
.wg-choice-s  { font-size: 12.5px; color: #a8a8b4; }
.wg-choice-arrow { color: #8b8b9c; font-size: 22px; font-weight: 300; line-height: 1; }

/* ---------- Key entry form ---------- */
.wg-keyform { margin-top: 16px; animation: wg-slide-in .22s var(--vs-ease, ease) both; }

.wg-field {
    position: relative;
    margin-bottom: 14px;
}
.wg-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px; font-weight: 600;
    color: #cfcfd8;
    letter-spacing: .02em;
}
.wg-input {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    padding: 13px 14px;
    color: #fff;
    font: inherit;
    font-size: 14.5px;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    letter-spacing: .04em;
    transition: border-color .18s ease, background .18s ease;
}
.wg-input::placeholder { color: #5e5e6e; font-family: inherit; letter-spacing: normal; }
.wg-input:focus {
    outline: none;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,0,128,.5);
    box-shadow: 0 0 0 3px rgba(255,0,128,.08);
}
.wg-input.is-error {
    border-color: #ff5577;
    background: rgba(255,87,119,.06);
}

.wg-err {
    display: block;
    margin: -6px 0 12px;
    color: #ff8a8a;
    font-size: 12.5px;
    line-height: 1.4;
}

.wg-submit {
    width: 100%;
    background: linear-gradient(90deg, #ff0080 0%, #7822dc 100%);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font: inherit;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 12px 28px -8px rgba(255,0,128,.55);
    transition: transform .15s ease, box-shadow .18s ease, opacity .18s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.wg-submit:hover    { transform: translateY(-1px); box-shadow: 0 16px 32px -8px rgba(255,0,128,.7); }
.wg-submit:active   { transform: translateY(0); }
.wg-submit:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.wg-submit[hidden]  { display: none !important; }
.wg-keyform[hidden],
.wg-result[hidden]  { display: none !important; }
.wg-submit-secondary {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: none;
    margin-top: 10px;
}
.wg-submit-secondary:hover { background: rgba(255,255,255,.10); box-shadow: none; }

.wg-spin {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    animation: wg-spin .7s linear infinite;
}

.wg-links {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-top: 14px;
}
.wg-link {
    background: transparent;
    border: 0;
    color: #ffb1d2;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    transition: color .15s ease;
}
.wg-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.wg-link-sep   { color: #5e5e6e; font-size: 12px; }

/* ---------- Result block (create / forgot) ---------- */
.wg-result {
    margin: 16px 0 14px;
    padding: 14px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,0,128,.22);
    border-radius: 14px;
    animation: wg-slide-in .22s var(--vs-ease, ease) both;
}
.wg-result-row + .wg-result-row { margin-top: 10px; }
.wg-result-label {
    font-size: 11px; font-weight: 700;
    letter-spacing: 1.4px; text-transform: uppercase;
    color: #ffb1d2;
    margin-bottom: 5px;
}
.wg-result-wrap {
    display: flex; align-items: stretch; gap: 8px;
}
.wg-result-val {
    flex: 1;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    padding: 11px 12px;
    color: #fff;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 14.5px;
    letter-spacing: .06em;
    user-select: all;
}
.wg-result-val:focus { outline: none; border-color: rgba(255,0,128,.4); }
.wg-copy {
    flex-shrink: 0;
    width: 42px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    color: #cfcfd8;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.wg-copy:hover { background: rgba(255,0,128,.18); color: #fff; }

.wg-note {
    margin-top: 12px;
    display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    color: #a8a8b4;
    font-size: 12px; line-height: 1.5;
}
.wg-note svg { flex-shrink: 0; margin-top: 2px; color: #ffb1d2; }

/* ---------- Checkbox terms ---------- */
.wg-check {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 4px 0 14px;
    padding: 12px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.wg-check:hover { background: rgba(255,255,255,.04); }
.wg-check input { position: absolute; opacity: 0; pointer-events: none; }
.wg-check-box {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 6px;
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, border-color .15s ease;
    margin-top: 1px;
}
.wg-check-box svg { opacity: 0; transition: opacity .15s ease; }
.wg-check input:checked + .wg-check-box {
    background: linear-gradient(135deg, #ff0080, #7822dc);
    border-color: transparent;
}
.wg-check input:checked + .wg-check-box svg { opacity: 1; }
.wg-check-text {
    font-size: 12.5px; line-height: 1.55;
    color: #c2c2cf;
}
.wg-check-text a { color: #ffb1d2; text-decoration: underline; text-underline-offset: 2px; }
.wg-check-text a:hover { color: #fff; }

/* ---------- Toast ---------- */
.wg-toast {
    position: absolute; left: 50%; bottom: 14px;
    transform: translate(-50%, 30px);
    padding: 10px 16px;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 13px; font-weight: 600;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    opacity: 0; pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}
.wg-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes wg-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes wg-pop {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes wg-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes wg-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Small viewports ---------- */
@media (max-width: 380px) {
    .wg-card { padding: 22px 18px; border-radius: 20px; }
    .wg-h { font-size: 19px; }
    .wg-choice-ic { width: 38px; height: 38px; }
    .wg-result-val { font-size: 13px; padding: 10px; }
}

/* ---------- Body lock when modal open ---------- */
body.wg-locked { overflow: hidden; }
