:root {
    --bg: #ffffff;
    --bg-alt: #f8f9ff;
    --text: #1a1a1f;
    --muted: #6b7280;
    --accent: #7c4dff;
    --accent-hover: #6a3de8;
    --accent-soft: #ede7ff;
    --border: #e5d8ff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

[data-theme="dark"] {
    --bg: #050608;
    --bg-alt: #0f141a;
    --text: #e0f2f1;
    --muted: #9ca3af;
    --accent: #66bb6a;
    --accent-hover: #55aa5e;
    --accent-soft: #1a3c2e;
    --border: #1f2937;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s;
}

[data-theme="dark"] header {
    background: rgba(5,6,8,0.9);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #b794f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.hero {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px 0;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #b794f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--bg-alt);
    padding: 16px 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

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

.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
    margin-bottom: 60px;
}

.quiz-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    display: block;
}

.quiz-card:not(.disabled):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.quiz-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quiz-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.quiz-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.quiz-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.quiz-status.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.quiz-status.inactive {
    background: var(--border);
    color: var(--muted);
}

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.test-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
}

.back-btn:hover {
    text-decoration: underline;
}

.progress-bar {
    background: var(--border);
    border-radius: 10px;
    height: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: var(--accent);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.question-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.question-card:hover {
    border-color: var(--accent);
}

.question-text {
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 16px;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

input[type="radio"] {
    accent-color: var(--accent);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    justify-content: center;
}

.submit-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 32px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.result-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

.result-stats {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg);
    border-radius: 12px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: var(--accent);
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 30px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--accent-soft);
}

.footer-note {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.quiz-card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    .quizzes-grid { grid-template-columns: 1fr; }
    .options { flex-direction: column; }
    .option-label { justify-content: center; }
    .form-actions { flex-direction: column; }
    .submit-btn, .reset-btn { width: 100%; }
}
