:root {
    --primary-color: #1e3a8a;
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-color: #1f2937;
    --error-color: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

#app {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

.screen {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 500px;
}

.hidden { display: none !important; }

h1, h2 { color: var(--primary-color); margin-bottom: 1rem; }
p { color: #4b5563; margin-bottom: 1.5rem; line-height: 1.5; }

/* Loader */
.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Badge Screen */
.user-info { margin-bottom: 2rem; }
.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#canvas-qrcode { width: 100%; max-width: 250px; height: auto; }

/* Init screen */
#reader { width: 100%; margin-bottom: 1rem; border-radius: 0.5rem; overflow: hidden; }
.error-text { color: var(--error-color); font-size: 0.875rem; margin-top: 0.5rem; min-height: 1.25rem; }

/* Buttons */
.btn-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-secondary:hover { background: #f3f4f6; color: var(--text-color); }
