/* ============================================================
   payment-modal.css — Premium Purchase Popup
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
#payment-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;      /* bottom-sheet on mobile */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* padding-bottom: env(safe-area-inset-bottom); */
}

#payment-modal-overlay.pm-visible {
    opacity: 1;
}

/* ── Backdrop ────────────────────────────────────────────── */
.pm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Dialog ──────────────────────────────────────────────── */
.pm-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--card-bg, #1a1a2e);
    border-radius: 24px 24px 0 0;
    padding: 32px 28px 40px;
    box-shadow: 0 -8px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(40px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-primary, #f0f0f0);
    /* scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#payment-modal-overlay.pm-visible .pm-dialog {
    transform: translateY(0);
}

/* On desktop → centred card */
@media (min-width: 600px) {
    #payment-modal-overlay {
        align-items: center;
        padding: 24px;
    }
    .pm-dialog {
        border-radius: 24px;
        transform: scale(0.92) translateY(0);
    }
    #payment-modal-overlay.pm-visible .pm-dialog {
        transform: scale(1) translateY(0);
    }
}

/* ── Close button ────────────────────────────────────────── */
.pm-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #999);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.pm-close:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* ── Header ──────────────────────────────────────────────── */
.pm-header {
    text-align: center;
    margin-bottom: 24px;
}

.pm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.pm-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary, #f0f0f0);
}

.pm-product-name {
    font-size: 0.9rem;
    color: #8b5cf6;
    font-weight: 600;
    margin: 0 0 6px;
}

.pm-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    margin: 0;
    line-height: 1.5;
}

/* ── Form ────────────────────────────────────────────────── */
.pm-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pm-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #aaa);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pm-field input {
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 1.5px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary, #f0f0f0);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.pm-field input:focus {
    border-color: #6366f1;
    background: var(--input-bg-focus, rgba(99,102,241,0.08));
}

.pm-field input::placeholder {
    color: var(--text-muted, #666);
}

/* Amount field with Rp prefix */
.pm-amount-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pm-rp-prefix {
    position: absolute;
    left: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    pointer-events: none;
    z-index: 1;
}

.pm-amount-wrap input {
    padding-left: 42px;
}

/* ── Shortcut buttons ────────────────────────────────────── */
.pm-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}

.pm-shortcuts-label {
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    margin-right: 2px;
}

.pm-shortcut {
    background: rgba(99, 102, 241, 0.12);
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #818cf8;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    font-family: inherit;
}

.pm-shortcut:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    transform: translateY(-1px);
}

.pm-shortcut:active {
    transform: translateY(0);
}

/* ── Tier Preview ────────────────────────────────────────── */
.pm-tier-preview {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
    min-height: 48px;
}

.pm-tier-preview.pm-tier-active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-primary, #f0f0f0);
}

.pm-tier-preview i {
    flex-shrink: 0;
    font-size: 1rem;
    color: #818cf8;
}

.pm-tier-preview strong {
    color: #a78bfa;
}

/* ── Action buttons ──────────────────────────────────────── */
.pm-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.pm-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pm-btn:active {
    transform: scale(0.97);
}

.pm-btn-cancel {
    background: rgba(255,255,255,0.07);
    color: var(--text-muted, #aaa);
    flex: 0 0 auto;
    padding: 14px 18px;
}

.pm-btn-cancel:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary, #f0f0f0);
}

.pm-btn-pay {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.pm-btn-pay:hover:not(:disabled) {
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.pm-btn-pay:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Light theme overrides */
[data-theme="light"] .pm-dialog {
    background: #ffffff;
    color: #1a1a2e;
}

[data-theme="light"] .pm-field input {
    background: #f4f4f8;
    border-color: #e0e0ea;
    color: #1a1a2e;
}

[data-theme="light"] .pm-field input:focus {
    border-color: #6366f1;
    background: rgba(99,102,241,0.05);
}

[data-theme="light"] .pm-title {
    color: #1a1a2e;
}

[data-theme="light"] .pm-tier-preview {
    background: #f8f8ff;
    border-color: #e0e0f0;
    color: #555;
}

[data-theme="light"] .pm-tier-preview.pm-tier-active {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.35);
    color: #1a1a2e;
}

[data-theme="light"] .pm-close {
    background: rgba(0,0,0,0.06);
    color: #555;
}

[data-theme="light"] .pm-btn-cancel {
    background: #f0f0f5;
    color: #555;
}

/* Scrollbar */
.pm-dialog::-webkit-scrollbar {
    width: 4px;
}
.pm-dialog::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}
