:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-color: #0F172A;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    --danger: #EF4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

@media (min-width: 481px) {
    .app-container {
        min-height: auto;
        padding: 2rem;
    }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.highlight {
    color: var(--secondary);
}

.section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }

/* ZALO QR CONTAINER */
.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    margin: 0 auto;
    width: fit-content;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
}

#zaloQrCanvas {
    width: 220px !important;
    height: 220px !important;
}

/* MOBILE ONLY HELPERS */
.mobile-only {
    display: none;
}
@media (max-width: 480px) {
    .mobile-only {
        display: block;
    }
}

/* BUTTONS */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.btn-outline:hover {
    color: white;
    border-color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-block { width: 100%; }

.btn-back {
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.btn-back:hover { color: white; }

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
}

/* LOADER */
.loader {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* USER INFO */
.user-info {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 2rem;
    gap: 1rem;
}

.avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    object-fit: cover;
}

.user-details { flex-grow: 1; }
.user-details h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.vip-status { font-size: 0.85rem; color: var(--secondary); }
.vip-status.inactive { color: var(--text-muted); }

/* PACKAGES */
.packages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.package-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.2);
}

.package-card.popular {
    border-color: var(--secondary);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(16, 185, 129, 0.1));
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-bottom-left-radius: 12px;
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.package-header h3 { font-size: 1.25rem; font-weight: 600; }
.price { font-size: 1.5rem; font-weight: 700; color: white; }
.package-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }

/* CHECKOUT */
.order-summary {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}
.summary-row.total {
    margin-top: 1rem;
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    color: white;
    font-weight: 600;
    align-items: center;
}
.price-highlight {
    font-size: 1.5rem;
    color: var(--secondary);
}

.payment-btn {
    display: flex;
    align-items: center;
    width: 100%;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: left;
}
.payment-btn:active { transform: scale(0.98); }
.pay-logo { height: 40px; margin-right: 1rem; }
.pay-text { display: flex; flex-direction: column; }
.pay-text strong { color: #1e293b; font-size: 1rem; }
.pay-text span { color: #64748b; font-size: 0.85rem; }
