/* Popup sambutan LOGIN/DAFTAR (.popup). Muncul saat halaman dimuat; ditutup lewat popup.js.
   Warna dari /css-assets/base/theme.css; font Chakra Petch/Exo 2 dari /css-assets/fonts/chakra-petch-exo2.css.
   Struktur: .popup (overlay) > .popup__card > __close, __media (__img, __badge), __body (__eyebrow, __title, __text, __actions, __note), __footer */

.popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(var(--c-accent-rgb), 0.28), transparent 70%),
        rgba(6, 2, 14, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: popup-fade .35s ease both;
}

/* halaman di belakang tidak ikut bergulir saat popup terbuka (class dipasang popup.js) */
html.popup-open,
html.popup-open body {
    overflow: hidden;
    height: 100%;
}

.popup__card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: auto;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(160deg, #1a0b2e 0%, var(--c-bg-panel) 55%, #12071f 100%);
    border: 1px solid rgba(var(--c-accent-rgb), 0.35);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 60px rgba(var(--c-accent-rgb), 0.25);
    animation: popup-rise .55s cubic-bezier(.2, .9, .3, 1.2) both;
}

/* garis aksen tipis di tepi atas kartu */
.popup__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--c-accent-light), var(--c-accent), transparent);
    z-index: 3;
}

/* --- tombol tutup --- */
.popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background .25s ease, transform .25s ease, border-color .25s ease;
}

.popup__close::before,
.popup__close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: var(--c-text-title);
    border-radius: 2px;
}

.popup__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.popup__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.popup__close:hover,
.popup__close:focus-visible {
    background: var(--c-accent-mid);
    border-color: var(--c-accent-light);
    transform: rotate(90deg);
    outline: none;
}

/* --- media: gambar + badge --- */
.popup__media {
    position: relative;
}

.popup__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* gradasi agar gambar menyatu dengan kartu */
.popup__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 6, 18, 0.05) 40%, var(--c-bg-panel) 100%);
    pointer-events: none;
}

.popup__badge {
    position: absolute;
    left: 16px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--c-accent-rgb), 0.5);
    background: rgba(10, 6, 18, 0.7);
    backdrop-filter: blur(6px);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--c-accent-light);
}

.popup__badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c-accent);
    box-shadow: 0 0 8px var(--c-accent), 0 0 16px var(--c-accent);
    animation: popup-pulse 1.4s infinite;
}

/* --- isi --- */
.popup__body {
    position: relative;
    z-index: 1;
    padding: 22px 28px 8px;
    text-align: center;
    font-family: 'Exo 2', sans-serif;
    color: var(--c-text-body);
}

.popup__eyebrow {
    margin: 0 0 6px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.popup__title {
    margin: 0 0 10px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--c-text-title);
    text-shadow: 0 0 18px rgba(var(--c-accent-rgb), 0.55);
    overflow-wrap: anywhere;
}

.popup__text {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text-muted);
}

/* --- tombol --- */
.popup__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.popup__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 14px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}

.popup__btn--primary {
    color: var(--c-btn-text);
    background: var(--c-btn-gradient);
    border: 1px solid var(--c-accent-light);
    box-shadow: 0 12px 30px rgba(var(--c-accent-rgb), 0.45);
}

.popup__btn--ghost {
    color: var(--c-accent-light);
    background: rgba(var(--c-accent-rgb), 0.08);
    border: 1px solid rgba(var(--c-accent-rgb), 0.5);
}

/* kilau menyapu saat hover */
.popup__btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}

.popup__btn:hover::before,
.popup__btn:focus-visible::before {
    left: 160%;
}

.popup__btn:hover,
.popup__btn:focus-visible {
    transform: translateY(-3px);
    outline: none;
}

.popup__btn--primary:hover,
.popup__btn--primary:focus-visible {
    color: var(--c-btn-text);
    background: var(--c-btn-gradient-hover);
    box-shadow: 0 16px 36px rgba(var(--c-accent-rgb), 0.6);
}

.popup__btn--ghost:hover,
.popup__btn--ghost:focus-visible {
    color: var(--c-text-title);
    background: rgba(var(--c-accent-rgb), 0.2);
    border-color: var(--c-accent-light);
}

.popup__note {
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--c-text-faint);
}

/* --- footer --- */
.popup__footer {
    padding: 14px 28px 20px;
    font-family: 'Chakra Petch', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    text-align: center;
    color: var(--c-text-faint);
    border-top: 1px solid rgba(var(--c-accent-rgb), 0.15);
}

.popup__footer strong {
    color: var(--c-accent-light);
    font-weight: 600;
}

/* --- animasi --- */
@keyframes popup-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popup-rise {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes popup-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--c-accent), 0 0 16px var(--c-accent);
    }

    50% {
        opacity: .4;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .popup,
    .popup__card,
    .popup__badge::before,
    .popup__btn,
    .popup__close {
        animation: none;
        transition: none;
    }
}

@media (max-width: 480px) {
    .popup {
        padding: 14px;
    }

    .popup__body {
        padding: 18px 20px 6px;
    }

    .popup__title {
        font-size: 22px;
    }

    .popup__actions {
        grid-template-columns: 1fr;
    }

    .popup__footer {
        padding: 12px 20px 18px;
    }
}
