* {
    font-family: 'Sarabun', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4a4a4a;
}

.card-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 480px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.header-section h2 {
    color: #4a148c;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 5px;
}
.header-section p {
    color: #7b1fa2;
    font-weight: 300;
    font-size: 14px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.mode-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    background: #f3e5f5;
    padding: 6px;
    border-radius: 16px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #6a1b9a;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-btn.active {
    background: linear-gradient(45deg, #7b1fa2, #ab47bc);
    color: white;
    box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
}

/* Input Styles */
.input-section label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 36px;
    font-weight: 700;
    color: #4a148c;
    text-align: center;
    border: 2px solid #e1bee7;
    border-radius: 16px;
    background: #fff;
    outline: none;
    transition: all 0.3s;
}

input[type="number"]::placeholder {
    color: #d1d1d1;
    opacity: 1;
}

input[type="number"]:focus {
    border-color: #8e24aa;
    box-shadow: 0 0 0 4px rgba(142, 36, 170, 0.1);
}

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 25px 0;
}

.rfid-section {
    position: relative;
    margin-bottom: 20px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink { 50% { opacity: 0.4; } }

.instruction-text {
    color: #888;
    font-size: 14px;
}

.rfid-hidden {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

/* Status Box */
.status-box {
    min-height: 140px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #d1c4e9;
    transition: all 0.3s ease;
    overflow: hidden;
}

.placeholder-content p {
    color: #aaa;
    font-size: 14px;
    margin-top: 10px;
}

.status-box.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: none;
    color: #1b5e20;
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.15);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-box.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: none;
    color: #b71c1c;
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.15);
    animation: shake 0.4s;
}

.status-box.processing {
    background: #e3f2fd;
    border: none;
    color: #0d47a1;
}

.result-title { font-weight: 700; font-size: 22px; margin-bottom: 8px; }
.result-detail { font-size: 16px; margin-bottom: 4px; opacity: 0.9; }
.result-balance-box { margin-top: 12px; background: rgba(255, 255, 255, 0.6); padding: 8px 20px; border-radius: 12px; width: 100%; }
.result-label { font-size: 14px; font-weight: 600; opacity: 0.7; }
.result-value { font-size: 26px; font-weight: 800; color: #333; }

@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }