* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #ccfbf1;
    --success: #15803d;
    --danger: #be123c;
    --text: #172033;
    --muted: #64748b;
    --border: #dbe4ea;
    --background: #f3f7f8;
    --shadow: 0 24px 70px rgba(15, 38, 52, 0.12);
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: radial-gradient(circle at 8% 8%, rgba(20, 184, 166, 0.13), transparent 30%), radial-gradient(circle at 92% 92%, rgba(251, 191, 36, 0.12), transparent 28%), var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.45;
}

button, input, select { font-family: inherit; }

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

.card {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 44px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-card { max-width: 520px; }

.logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
    margin-bottom: 28px;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.25);
}

.small-logo { width: 45px; height: 45px; margin: 0; font-size: 14px; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.1; margin-bottom: 12px; }
h2 { margin-bottom: 10px; }
.subtitle { color: var(--muted); margin-bottom: 32px; line-height: 1.5; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: 700; margin-bottom: 9px; font-size: 13px; color: #334155; }

input[type="text"], select {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #fbfdfe;
    color: var(--text);
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
    background: white;
}

.exam-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.exam-option { border: 1px solid var(--border); padding: 16px; border-radius: 14px; cursor: pointer; transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s; background: rgba(255, 255, 255, 0.65); }
.exam-option:hover { border-color: var(--primary); transform: translateY(-2px); }
.exam-option input { display: none; }
.exam-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 8px 18px rgba(15, 118, 110, 0.1); }
.exam-option strong, .exam-option small { display: block; }
.exam-option strong { margin-bottom: 5px; }
.exam-option small { color: var(--muted); font-size: 11px; }

.btn { border: none; border-radius: 12px; padding: 14px 22px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(15, 38, 52, 0.12); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #0d9488); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.btn-secondary { background: #eaf0f2; color: var(--text); }
.btn-success { background: var(--success); color: white; }
.login-card .btn-primary { width: 100%; margin-top: 10px; }
.admin-link { display: block; text-align: center; color: var(--muted); margin-top: 25px; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.admin-link:hover, .file-upload label:hover { color: var(--primary-dark); }

.test-container { min-height: 100vh; }
.test-header { background: rgba(255, 255, 255, 0.88); border-bottom: 1px solid var(--border); padding: 14px max(20px, 7%); display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 20px rgba(15, 38, 52, 0.04); backdrop-filter: blur(12px); }
.student-info { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.student-info span { color: var(--muted); font-size: 14px; }
.test-main { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.test-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.badge { display: inline-block; padding: 7px 12px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; }
.question-counter { font-size: 20px; font-weight: bold; }
.progress { width: 100%; height: 8px; background: #dce7e9; border-radius: 10px; overflow: hidden; margin-bottom: 25px; }
#progressBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #2dd4bf); transition: 0.3s; }
.question-card { background: rgba(255, 255, 255, 0.92); padding: 35px; border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 22px; box-shadow: var(--shadow); }
.question-card h3 { font-size: 21px; line-height: 1.5; margin-bottom: 30px; }
.answer-option { display: flex; align-items: center; gap: 15px; border: 1px solid var(--border); border-radius: 14px; padding: 17px 18px; margin-bottom: 12px; cursor: pointer; transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s; background: #fcfefe; }
.answer-option:hover { border-color: var(--primary); background: #f0fdfa; transform: translateX(3px); }
.answer-option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 8px 18px rgba(15, 118, 110, 0.1); }
.answer-letter { width: 38px; height: 38px; border-radius: 50%; background: #eaf0f2; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }
.answer-option.selected .answer-letter { background: var(--primary); color: white; }
.navigation { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; }

.result-card { text-align: center; max-width: 600px; }
.success-icon { width: 80px; height: 80px; border-radius: 50%; background: #dcfce7; color: var(--success); font-size: 45px; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; }
.student-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 25px 0; }
.student-result div { background: #f1f5f6; padding: 15px 10px; border-radius: 12px; }
.student-result span, .student-result strong { display: block; }
.student-result span { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.student-result strong { font-size: 14px; }
.score-box { padding: 30px; background: linear-gradient(135deg, #ccfbf1, #f0fdfa); border-radius: 18px; }
.score { font-size: 48px; font-weight: bold; color: var(--primary); }
.percentage { font-size: 30px; font-weight: bold; margin-top: 10px; }
.score-box p { color: var(--muted); margin-top: 5px; }
.result-statistics { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; }
.stat { padding: 20px; border-radius: 12px; display: flex; align-items: center; gap: 15px; text-align: left; }
.stat span { font-size: 25px; }
.stat strong, .stat small { display: block; }
.correct { background: #f0fdf4; color: var(--success); }
.wrong { background: #fff1f2; color: var(--danger); }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 25px; }

.admin-card { max-width: 800px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.upload-section { background: rgba(241, 245, 249, 0.78); border: 1px solid var(--border); padding: 25px; border-radius: 15px; margin-bottom: 30px; }
.file-upload { border: 2px dashed #9ccbc5; padding: 30px; border-radius: 15px; text-align: center; margin: 20px 0; background: rgba(255, 255, 255, 0.65); transition: background 0.2s, border-color 0.2s; }
.file-upload:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-upload input { display: none; }
.file-upload label { cursor: pointer; color: var(--primary); font-weight: 600; }
.test-list { border-top: 1px solid var(--border); padding-top: 25px; }
.saved-test { display: flex; justify-content: space-between; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.55); }
.saved-test-info strong, .saved-test-info small { display: block; }
.saved-test-info small { color: var(--muted); margin-top: 5px; }
.delete-btn { background: #ffe4e6; color: var(--danger); border: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.hidden { display: none !important; }

/* +@media (max-width: 650px) {
+    .card { padding: 30px 20px; border-radius: 20px; }
+    .exam-types { grid-template-columns: 1fr; }
+    .test-header { padding: 12px 20px; }
+    .test-main { margin-top: 25px; }
+    .question-card { padding: 25px 18px; }
+    .student-result, .result-statistics { grid-template-columns: 1fr; }
+    .result-actions, .navigation { flex-direction: column; }
+    .admin-header { flex-direction: column; gap: 20px; }
+    .saved-test { flex-direction: column; align-items: flex-start; gap: 15px; }
+    .navigation .btn, .result-actions .btn, .admin-header > .btn { width: 100%; }
+} */

.btn-pdf {
    background: #dc2626;
    color: white;
}

.btn-pdf:hover {
    background: #b91c1c;
}

.btn-docx {
    background: #2563eb;
    color: white;
}

.btn-docx:hover {
    background: #1d4ed8;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

@media print {

    body {
        background: white !important;
    }

    .result-card {
        box-shadow: none !important;
        max-width: 100% !important;
    }

    .result-actions {
        display: none !important;
    }

    .success-icon {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .score-box,
    .student-result,
    .result-statistics {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

@media (max-width: 650px) {

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }
}