/* ============================================================
           RESET & VARIABEL — GRAYSCALE ONLY
           ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
}

:root {
    --bg-body: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --text: #f0f0f0;
    --text-muted: #999;
    --text-dim: #555;
    --text-dark: #222;
    --white: #fff;
    --black: #000;
    --glass-blur: blur(14px);
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

html,
body {
    height: 100%;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: var(--bg-body);
    color: var(--text);
    overflow-x: hidden;
}

/* ============================================================
           LATAR BELAKANG — efek grid halus
           ============================================================ */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}
.bg-glow:nth-child(2) {
    width: 500px;
    height: 500px;
    top: -150px;
    right: -150px;
    background: #fff;
    animation: floatGlow 16s ease-in-out infinite alternate;
}
.bg-glow:nth-child(3) {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    background: #fff;
    animation: floatGlow 20s ease-in-out infinite alternate-reverse;
}
@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(60px, -40px) scale(1.2);
    }
}

/* ============================================================
           KONTAINER UTAMA
           ============================================================ */
.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
           GLASS CARD — hitam putih
           ============================================================ */
.glass-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 0;
    overflow: hidden;
    transition: opacity 0.35s ease, transform 0.35s ease;
    width: 100%;
}

/* ============================================================
           HALAMAN (page)
           ============================================================ */
.page {
    display: none;
    animation: pageFadeIn 0.40s ease;
}
.page.active {
    display: block;
}

@keyframes pageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
           HEADER (shared)
           ============================================================ */
.header {
    padding: 22px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.header .logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 2px solid var(--text-muted);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}
.header h1 {
    font-size: 14px;
    color: var(--text);
    letter-spacing: 1px;
    line-height: 1.4;
}
.header .sub {
    font-size: 8px;
    color: var(--text-muted);
    display: block;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* ============================================================
           KONTEN
           ============================================================ */
.content {
    padding: 22px 24px 28px;
}

/* ============================================================
           TOMBOL — grayscale
           ============================================================ */
.btn {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    padding: 14px 24px;
    border: none;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 16px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    min-height: 48px;
}
.btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}
.btn:active {
    transform: scale(0.95);
}
.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
}
.btn-primary:hover {
    background: rgba(255, 255, 255, 0.14);
}
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    color: #ccc;
}
.btn-danger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-back {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
    font-size: 8px;
    padding: 8px 14px;
    min-height: auto;
}
.btn-back:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    font-size: 8px;
    padding: 10px 14px;
    min-height: auto;
}

/* ============================================================
           HALAMAN FAQ
           ============================================================ */
.faq-intro {
    text-align: center;
    margin-bottom: 24px;
}
.faq-intro .faq-icon {
    width: 56px;
    height: 56px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 12px;
    display: inline-block;
}
.faq-intro h2 {
    font-size: 12px;
    color: var(--text);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.faq-intro p {
    font-size: 8px;
    color: var(--text-muted);
    line-height: 1.8;
    letter-spacing: 0.5px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
}
.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.08);
}
.faq-item.open {
    border-color: rgba(255, 255, 255, 0.12);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    font-size: 8px;
    color: var(--text);
    letter-spacing: 0.5px;
    line-height: 1.6;
}
.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}
.faq-question .q-icon {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.faq-question .q-text {
    flex: 1;
}
.faq-question .q-arrow {
    width: 14px;
    height: 14px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.faq-item.open .faq-question .q-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0 16px;
}
.faq-item.open .faq-answer {
    max-height: 800px;
    padding: 0 16px 16px;
}
.faq-answer p {
    font-size: 7.5px;
    color: var(--text-muted);
    line-height: 2;
    letter-spacing: 0.4px;
}
.faq-answer p strong {
    color: var(--text);
    font-weight: normal;
}
.faq-answer ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
}
.faq-answer ul li {
    font-size: 7.5px;
    color: var(--text-muted);
    line-height: 2;
    letter-spacing: 0.4px;
    padding-left: 16px;
    position: relative;
}
.faq-answer ul li::before {
    content: "◆";
    color: var(--text-muted);
    position: absolute;
    left: 0;
    font-size: 6px;
}

.faq-cta {
    text-align: center;
    padding-top: 8px;
}
.faq-cta .btn {
    font-size: 11px;
    padding: 16px 32px;
}

/* ============================================================
           HALAMAN QRIS
           ============================================================ */
.qris-input-group {
    margin-bottom: 18px;
}
.qris-input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.qris-input-group label svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
}
.qris-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.qris-input-wrapper input {
    flex: 1;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.20);
}
.qris-input-wrapper input::placeholder {
    color: var(--text-dim);
    font-size: 8px;
}
.qris-input-wrapper input:focus {
    border-color: var(--text-muted);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.03), inset 0 2px 8px rgba(0, 0, 0, 0.20);
}
.qris-input-hint {
    font-size: 7px;
    color: var(--text-dim);
    display: block;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* QR area */
.qris-qr-area {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    border: 1px solid var(--border);
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.qris-qr-area.active {
    display: block;
}
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.qris-qr-area img {
    max-width: 200px;
    width: 100%;
    image-rendering: pixelated;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);
}

.qris-info {
    margin-top: 14px;
    font-size: 8px;
    color: var(--text-muted);
    line-height: 1.8;
    letter-spacing: 0.5px;
}
.qris-info .info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 4px 0;
}
.qris-info .info-row svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
}
.qris-info .order-id {
    color: var(--text);
    font-weight: bold;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    user-select: all;
    border: 1px solid var(--border);
    transition: 0.2s;
    font-size: 9px;
}
.qris-info .order-id:hover {
    background: rgba(255, 255, 255, 0.10);
}
.qris-info .amount-display {
    font-size: 13px;
    color: var(--text);
    margin: 6px 0;
}
.qris-info .fee-display {
    font-size: 7px;
    color: var(--text-dim);
    margin: 2px 0 6px;
}

/* Status badge — grayscale */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 8px;
    padding: 6px 16px;
    border-radius: 40px;
    letter-spacing: 1px;
    border: 1px solid var(--border);
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}
.status-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.status-pending {
    border-color: rgba(255, 255, 255, 0.15);
    color: #bbb;
    animation: pulse 1.4s infinite;
}
.status-settlement {
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.status-expired {
    border-color: rgba(255, 255, 255, 0.08);
    color: #777;
}
.status-cancelled {
    border-color: rgba(255, 255, 255, 0.06);
    color: #555;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Timer */
.timer-display {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.timer-display svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.timer-display.warning {
    color: #eee;
    animation: pulse 0.8s infinite;
}

/* Action row */
.qris-action-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.qris-action-row .btn {
    flex: 1;
    min-width: 100px;
    font-size: 8px;
    padding: 10px 12px;
    min-height: auto;
}

/* History */
.qris-history-section {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
}
.qris-history-section.active {
    display: block;
}
.qris-history-section h3 {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 1px;
}
.qris-history-section h3 svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
}

.history-item {
    font-size: 7px;
    padding: 10px 12px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-muted);
}
.history-item .hi-status {
    font-weight: bold;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 7px;
}
.history-item .hi-status svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.history-item .hi-status.sukses {
    color: #fff;
}
.history-item .hi-status.gagal {
    color: #777;
}

.history-clear-btn {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 7px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 40px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px auto 0;
    letter-spacing: 1px;
    transition: 0.2s;
}
.history-clear-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}
.history-clear-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.history-empty {
    font-size: 8px;
    text-align: center;
    color: var(--text-dim);
    padding: 12px;
}

/* ============================================================
           LOADING OVERLAY
           ============================================================ */
.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(8px);
    border-radius: 28px;
    z-index: 10;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.loading-overlay.active {
    display: flex;
}
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.04);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-text {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 14px;
    letter-spacing: 2px;
}

/* ============================================================
           TOAST
           ============================================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 100;
    font-size: 9px;
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.60);
    transition: transform 0.40s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 92%;
    letter-spacing: 0.5px;
}
.toast svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast-success {
    border-color: rgba(255, 255, 255, 0.20);
}
.toast-error {
    border-color: rgba(255, 255, 255, 0.08);
}
.toast-info {
    border-color: rgba(255, 255, 255, 0.10);
}

/* ============================================================
           SCROLLBAR
           ============================================================ */
.qris-history-section::-webkit-scrollbar {
    width: 4px;
}
.qris-history-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.qris-history-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 20px;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #111;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 20px;
}

/* ============================================================
           RESPONSIF
           ============================================================ */
@media (max-width: 600px) {
    .header h1 {
        font-size: 11px;
    }
    .header .sub {
        font-size: 7px;
    }
    .header .logo {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .content {
        padding: 16px 18px 22px;
    }
    .btn {
        font-size: 8px;
        padding: 10px 16px;
        min-height: 42px;
    }
    .btn svg {
        width: 16px;
        height: 16px;
    }
    .qris-input-wrapper input {
        font-size: 9px;
        padding: 12px 14px;
    }
    .qris-qr-area img {
        max-width: 160px;
    }
    .qris-action-row .btn {
        font-size: 7px;
        padding: 8px 10px;
        min-height: auto;
    }
    .glass-card {
        border-radius: 18px;
    }
    .faq-intro h2 {
        font-size: 10px;
    }
    .faq-question {
        font-size: 7px;
        padding: 12px 14px;
    }
    .faq-answer p,
    .faq-answer ul li {
        font-size: 7px;
    }
    .faq-cta .btn {
        font-size: 9px;
        padding: 14px 24px;
    }
}

@media (max-width: 400px) {
    .app-wrapper {
        padding: 12px 8px 24px;
    }
    .content {
        padding: 12px 12px 18px;
    }
    .header {
        padding: 14px 14px 12px;
        gap: 8px;
    }
    .header h1 {
        font-size: 9px;
    }
    .btn {
        font-size: 7px;
        padding: 8px 12px;
        gap: 6px;
        min-height: 36px;
    }
    .btn svg {
        width: 14px;
        height: 14px;
    }
    .qris-input-wrapper {
        flex-wrap: wrap;
    }
    .qris-input-wrapper input {
        font-size: 8px;
        padding: 10px 12px;
    }
    .qris-input-wrapper .btn {
        flex: 1;
        min-width: 70px;
    }
    .qris-action-row .btn {
        min-width: 70px;
    }
}