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

/* set color variables */
:root {
    --navy-1: #1a2a3a;
    --navy-2: #241a17;
    --orange: #e2762f;
    --muted-grey: #c7c3ba;
    --white: #fff;
    --page-bg: #eef1f4;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--page-bg);
    color: #222;
    line-height: 1.6;
     display: flex;
    flex-direction: column;
    min-height: 100vh;    
}

main {
    flex: 1;
}


nav {
    background: linear-gradient(90deg, var(--navy-1), var(--navy-2));
    padding: 18px 40px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

nav a {
    color: var(--muted-grey);
}

nav a:hover {
    color:var(--white)
}

nav a.active {
    color: var(--white);
    border-bottom: 2px solid var(--orange);
}


main {
    max-width: 750px;
    margin: 50px auto;
    padding: 40px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

h1 {
    color: #1a2a3a;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 3px solid var(--orange);
    padding-bottom: 10px;
}

p {
    margin-bottom: 15px;
    font-size: 16px;
}

a {
    color: var(--orange);
    text-decoration: none;
}

a:hover {
    color: var(--orange);
    text-decoration: underline;
}

footer {
    background-color: var(--navy-1);
    color: var(--muted-grey);
    text-align: center;
    padding: 28px 20px;
    font-size: 12.5px;
    letter-spacing: 0.3px;
}

/* ---------- Quiz app ---------- */

nav a {
    margin-right: 20px;
}

h2 {
    color: var(--navy-1);
    margin: 25px 0 10px;
    font-size: 22px;
}

h3 {
    color: var(--navy-1);
    margin: 18px 0 8px;
    font-size: 17px;
}

.quiz-unit {
    border-top: 1px solid #e2e5e9;
    padding-top: 10px;
    margin-bottom: 20px;
}

.quiz-meta {
    color: #666;
    font-size: 14px;
}

.quiz-start {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.quiz-start select {
    margin-left: 6px;
    padding: 6px;
    font-size: 15px;
}

button, .quiz-button {
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 15px;
    cursor: pointer;
    display: inline-block;
}

button:hover, .quiz-button:hover {
    background: #c9611f;
    color: var(--white);
    text-decoration: none;
}

.quiz-mock-btn {
    background: var(--navy-1);
}

.quiz-secondary {
    background: #888;
    font-size: 13px;
    padding: 6px 12px;
}

.quiz-end {
    margin-top: 25px;
    text-align: right;
}

.quiz-bar {
    display: flex;
    justify-content: space-between;
    background: var(--page-bg);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.quiz-topic {
    color: var(--orange);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quiz-question {
    margin-bottom: 15px;
    font-size: 17px;
}

.quiz-code {
    background: #1e2630;
    color: #e8e8e8;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 6px 0;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.quiz-option {
    display: block;
    border: 2px solid #dde1e6;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    margin-bottom: 8px;
}

.quiz-options .quiz-option {
    margin-bottom: 0;
}

.quiz-option:hover {
    border-color: var(--orange);
}

.quiz-option input {
    margin-right: 8px;
}

.quiz-option.is-right {
    border-color: #2e8b57;
    background: #eaf7ef;
}

.quiz-option.is-wrong {
    border-color: #c0392b;
    background: #fbecea;
}

.quiz-result {
    font-weight: bold;
    font-size: 18px;
}

.quiz-result.is-right { color: #2e8b57; }
.quiz-result.is-wrong { color: #c0392b; }

.quiz-mistake, .quiz-explain, .quiz-note {
    border-left: 4px solid var(--orange);
    background: #fdf4ee;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.quiz-explain {
    border-left-color: var(--navy-1);
    background: var(--page-bg);
}

.quiz-score {
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.quiz-score.is-right { background: #eaf7ef; }
.quiz-score.is-wrong { background: #fbecea; }

.quiz-score-big {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 0;
}

.quiz-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 15px;
}

.quiz-table th, .quiz-table td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid #e2e5e9;
}

.quiz-table tr.is-weak td {
    background: #fbecea;
}

.quiz-review {
    border-top: 1px solid #e2e5e9;
    padding-top: 15px;
    margin-bottom: 20px;
}

.quiz-links {
    margin-top: 25px;
    font-size: 14px;
}

/* ---------- Login ---------- */

nav {
    display: flex;
    align-items: center;
}

.nav-user {
    margin-left: auto;
    color: var(--muted-grey);
    font-size: 14px;
}

.nav-user a {
    margin-right: 0;
}

.quiz-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 360px;
    margin-bottom: 15px;
}

.quiz-form label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: #444;
}

.quiz-form input {
    margin-top: 4px;
    padding: 8px 10px;
    font-size: 15px;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
}

.quiz-form button {
    align-self: flex-start;
}

/* ---------- Scoreboard ---------- */

.quiz-table tr.is-me td {
    background: #fdf4ee;
    font-weight: bold;
}

.quiz-pass {
    background: #2e8b57;
    color: var(--white);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* ---------- Select all that apply ---------- */

.quiz-multi {
    font-weight: bold;
    color: var(--navy-1);
    margin-bottom: 8px;
}

.quiz-option.is-missed {
    border-color: #2e8b57;
    border-style: dashed;
}
