:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #22c55e;
    --danger: #ef4444;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 { margin: 0; font-size: 28px; }
header p { color: var(--muted); margin: 8px 0 0; }

.card, .upload-card, .banks-card, .quiz-card, .result-card, .wrong-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

h2 { margin-top: 0; font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

input[type="text"], input[type="file"], button, .btn, a.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 16px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

button, .btn, a.btn {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

button:hover, .btn:hover, a.btn:hover { background: var(--primary-hover); }

button:disabled { background: #9ca3af; cursor: not-allowed; }

.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }

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

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

.bank-info h3 { margin: 0; font-size: 16px; }
.bank-info p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.bank-actions { display: flex; gap: 8px; }
.bank-actions a, .bank-actions button {
    width: auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 14px;
}

.delete-btn { background: var(--danger); }

.question {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 18px;
    white-space: pre-wrap;
}

.type-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}
.type-badge.single { background: #e0e7ff; color: #3730a3; }
.type-badge.multiple { background: #fef3c7; color: #92400e; }
.type-badge.truefalse { background: #d1fae5; color: #065f46; }

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.option {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.option:hover { background: #f3f4f6; }
.option.selected { border-color: var(--primary); background: #eef2ff; }
.option.correct { border-color: var(--success); background: #f0fdf4; }
.option.wrong { border-color: var(--danger); background: #fef2f2; }

.feedback {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.feedback.correct { background: #f0fdf4; color: #166534; }
.feedback.wrong { background: #fef2f2; color: #991b1b; }
.hidden { display: none; }

.progress { text-align: center; color: var(--muted); margin-bottom: 12px; }

.score {
    font-size: 56px;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin: 10px 0;
}

.summary { text-align: center; color: var(--muted); margin-bottom: 20px; }

.wrong-item {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.wrong-item:last-child { border-bottom: none; }
.wrong-item h4 { margin: 0 0 8px; font-size: 15px; }
.wrong-item p { margin: 4px 0; color: var(--muted); font-size: 14px; }
.wrong-item .correct-ans { color: var(--success); font-weight: 500; }
.wrong-item .your-ans { color: var(--danger); font-weight: 500; }

#upload-msg { margin-top: 10px; font-size: 14px; }
