:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-main);
}

.checkout-container {
    background-color: var(--surface);
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 16px 20px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.khqr-banner {
    margin: -16px -20px 12px -20px;
    padding: 14px 20px;
    background: linear-gradient(90deg, #E11D48 0%, #DC2626 60%, #F97316 120%);
    color: #fff;
}

.khqr-logo {
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 28px;
    line-height: 1;
    text-align: center;
}

/* Bank Logo Grid */
.bank-logos-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bank-logos-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: #EEF2FF;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bank-logos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.bank-logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.bank-logo-item img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.bank-logo-item img:hover {
    transform: scale(1.1);
}

.header {
    text-align: center;
    margin-bottom: 12px;
}

.amount-display {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.amount-display span {
    font-size: 20px;
}

/* Countdown (linear progress) */
.countdown-box {
    margin: 8px auto 12px auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.countdown-box.expired {
    opacity: 0.6;
}

.timer-top-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.timer-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.timer-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.linear-progress-track {
    width: 100%;
    height: 10px;
    background: #E5E7EB;
    border-radius: 999px;
    overflow: hidden;
}

.linear-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--warning);
    border-radius: 999px;
    transition: width 1s linear, background-color 0.2s ease;
}

.countdown-box.expired .linear-progress-fill {
    background: var(--error);
}

.order-info {
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: #EEF2FF;
    color: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #E0E7FF;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px 0 4px 0;
    flex-direction: column;
    display: none;
    width: 100%;
}

.qr-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.qrcode-placeholder {
    width: 170px;
    height: 170px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px dashed var(--border);
    margin-bottom: 6px;
    padding: 8px;
    box-sizing: border-box;
}

.save-qr-btn {
    margin-top: 10px;
    width: min(260px, 80%);
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 12px;
    font-size: 14px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.success {
    background: #D1FAE5;
    color: var(--success);
}

.status-badge.expired {
    background: #FEE2E2;
    color: var(--error);
}

.status-message {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading-view {
    text-align: center;
    padding: 40px 0;
}

#error-view {
    text-align: center;
    padding: 40px 0;
    display: none;
    color: var(--error);
}

#content-view {
    display: none;
}