:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #1f2330;
    --muted: #6b7280;
    --border: #e2e4ea;
    --danger: #dc2626;
    --success: #16a34a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

header.topbar {
    background: var(--primary);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.topbar a {
    color: #fff;
    text-decoration: none;
}

header.topbar nav a {
    margin-left: 16px;
    font-size: 14px;
    opacity: 0.9;
}

header.topbar nav a:hover { opacity: 1; text-decoration: underline; }

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1, h2, h3 { margin-top: 0; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table th { color: var(--muted); font-weight: 600; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-secondary { background: var(--muted); }
.btn-secondary:hover { background: #4b5563; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

textarea { resize: vertical; }

.actions { margin-top: 20px; display: flex; gap: 10px; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error { background: #fee2e2; color: var(--danger); }
.alert-success { background: #dcfce7; color: var(--success); }

.question-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    margin-top: 16px;
    position: relative;
}

.question-block .remove-question {
    position: absolute;
    top: 14px;
    right: 14px;
}

.muted { color: var(--muted); font-size: 13px; }

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card { width: 100%; max-width: 380px; }

.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
}

.choice-option {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
}

.choice-option:hover { border-color: var(--primary); }

.choice-option input { margin-right: 10px; }

.qcm-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.qcm-list-item:last-child { border-bottom: none; }

.center-message {
    text-align: center;
    padding: 60px 20px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-difficulte-facile {
    background: #dcfce7;
    color: #15803d;
}

.badge-difficulte-normal {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-difficulte-difficile {
    background: #ffedd5;
    color: #c2410c;
}

.badge-difficulte-tres_difficile {
    background: #fee2e2;
    color: #b91c1c;
}
