* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #a7f3d0;
    --secondary: #0f766e;
    --accent: #f59e0b;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #34d399;
        --primary-dark: #10b981;
        --primary-light: #047857;
        --secondary: #06b6d4;
        --accent: #f59e0b;
        --bg: #1f2937;
        --bg-secondary: #111827;
        --text: #f3f4f6;
        --text-secondary: #d1d5db;
        --border: #374151;
        --success: #34d399;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    background: var(--bg);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    max-width: 650px;
    width: 100%;
    padding: 50px;
    animation: slideIn 0.6s ease-out;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .container {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    background: var(--border);
    height: 6px;
    border-radius: 10px;
    margin-bottom: 35px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.4s ease;
}

h1 {
    color: var(--text);
    margin-bottom: 35px;
    font-size: 28px;
    line-height: 1.5;
    font-weight: 600;
    transition: color 0.3s ease;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 35px;
}

.option {
    padding: 18px 24px;
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    transition: left 0.3s ease;
}

.option:hover {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}

.option:hover::before {
    left: 100%;
}

.option input[type="radio"] {
    margin-right: 14px;
    cursor: pointer;
    accent-color: var(--primary);
    width: 20px;
    height: 20px;
}

.option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 100%;
    font-weight: 500;
    color: var(--text);
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.success-screen {
    text-align: center;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: 90px;
    margin-bottom: 25px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.success-text {
    color: var(--success);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.success-subtext {
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 40px;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.error-message {
    color: #ef4444;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #fee2e2;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid #ef4444;
    font-weight: 500;
    animation: shake 0.4s ease;
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .error-message {
        background: rgba(239, 68, 68, 0.1);
        color: #fca5a5;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.question-counter {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: color 0.3s ease;
}

.finish-btn {
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
    margin-top: 25px;
}

.finish-btn:hover {
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.hidden {
    display: none;
}

.start-screen {
    text-align: center;
    animation: slideIn 0.6s ease-out;
}

.start-icon {
    font-size: 80px;
    margin-bottom: 30px;
    animation: bounce 0.6s ease;
}

.start-screen h1 {
    color: var(--text);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.start-description {
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.start-info, .camera-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.info-icon, .notice-icon {
    font-size: 30px;
}

.start-info p, .camera-notice p {
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

.camera-notice {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
}

.start-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.scanner-screen {
    text-align: center;
    animation: slideIn 0.6s ease-out;
}

.scanner-icon {
    font-size: 70px;
    margin-bottom: 25px;
    animation: bounce 0.6s ease;
}

.scanner-screen h1 {
    color: var(--text);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.scanner-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.qr-reader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px auto;
    padding: 0;
    background: transparent;
    border-radius: 20px;
    border: 3px solid var(--primary);
    animation: fadeIn 0.4s ease;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.2);
    max-width: 400px;
    position: relative;
}

#reader video {
    width: 100% !important;
    height: auto !important;
    border-radius: 17px;
    object-fit: cover;
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scanner-status {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin: 15px 0;
    font-weight: 500;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.scanner-status.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

/* Sustainable design elements */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.container > * {
    position: relative;
    z-index: 1;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 35px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .success-icon {
        font-size: 70px;
    }
    
    .success-text {
        font-size: 26px;
    }
    
    .option {
        padding: 15px 18px;
    }
}
