:root {
    --ink: #f4f6fb;          /* page background */
    --panel: #ffffff;        /* card background */
    --panel2: #f0f3f9;       /* input/option background */
    --line: #dde3ee;         /* borders/dividers */
    --teal: #0ea89a;
    --teal-dk: #0b8277;
    --android: #1f9d56;
    --amber: #b9790a;
    --danger: #c6414f;
    --white: #ffffff;
    --text: #1b2333;         /* primary text on light background */
    --muted: #677189;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Calibri, Arial, sans-serif;
    background: var(--ink);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 60px;
}

.wrap {
    width: 100%;
    max-width: 820px;
}

header.site-header {
    text-align: center;
    margin-bottom: 24px;
}

header.site-header h1 {
    font-size: 1.6rem;
    margin: 0 0 4px;
    color: var(--text);
}

header.site-header p {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 6px 20px rgba(27, 35, 51, 0.08);
}

.card + .card { margin-top: 18px; }

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel2);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 18px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus {
    outline: 2px solid var(--teal);
    border-color: var(--teal);
}

button, .btn {
    display: inline-block;
    background: var(--teal);
    color: #06211d;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 13px 22px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover { background: var(--teal-dk); color: var(--white); }

.btn-block { width: 100%; text-align: center; }

.error-box {
    background: #fdecee;
    border: 1px solid #f1b9c1;
    color: #8a2432;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.info-box {
    background: #e8f7f5;
    border: 1px solid #a9ddd6;
    color: #0b5e55;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.question-block {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.question-block:first-of-type { border-top: none; padding-top: 0; }

.question-number {
    color: var(--teal);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.question-text {
    font-size: 1.05rem;
    margin-bottom: 12px;
    line-height: 1.45;
    white-space: pre-line;
}

.code-block {
    background: #0e1526;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #d7e3ff;
    white-space: pre;
    overflow-x: auto;
}

/* Deters casual copy-paste of question/code content into another tool.
   Not foolproof (a screenshot always works), but raises the friction. */
.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.option {
    display: block;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
    /* override the generic form-label styling (uppercase, letter-spacing,
       bold, muted color) — these are answer options, not field labels,
       and preserving case matters for code-y answers like getDouble() */
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    color: var(--text);
    font-size: 0.97rem;
}

.option:hover { border-color: var(--teal); }

.option input { margin-right: 10px; }

.unanswered { outline: 2px solid var(--amber); }

.submit-bar {
    text-align: center;
    margin-top: 24px;
    position: sticky;
    bottom: 12px;
}

.score-hero {
    text-align: center;
    padding: 18px 0 8px;
}

.score-hero .big {
    font-size: 3rem;
    font-weight: 800;
    color: var(--android);
}

.score-hero .sub {
    color: var(--muted);
    margin-top: 4px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.result-table th, .result-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.result-table th { color: var(--muted); font-weight: 600; }

.tag-correct { color: var(--android); font-weight: 700; }
.tag-wrong { color: var(--danger); font-weight: 700; }

footer.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 30px;
}

@media (max-width: 600px) {
    .card { padding: 18px; }
    .score-hero .big { font-size: 2.3rem; }
}

/* Quiz picker + admin quiz list */
.muted { color: var(--muted); font-size: 0.88rem; }
.quiz-row {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--line);
}
.quiz-row:last-child { border-bottom: none; }
.btn-link {
    background: var(--teal); color: #06211d; font-weight: 700; text-decoration: none;
    padding: 8px 18px; border-radius: 8px; white-space: nowrap;
}
.btn-link:hover { background: var(--teal-dk); color: var(--white); }
.pill-closed {
    color: var(--danger); border: 1px solid #f1b9c1; background: #fdecee;
    padding: 4px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
}

/* One-question-at-a-time navigation */
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; width: 0; background: var(--teal); transition: width .2s; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.88rem; margin-bottom: 12px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.dot {
    width: 34px; height: 34px; padding: 0; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
}
.dot:hover { background: var(--panel2); color: var(--teal-dk); border-color: var(--teal); }
.dot.answered { background: #e8f7f5; color: var(--teal-dk); border-color: #a9ddd6; }
.dot.current { background: var(--teal); color: #06211d; border-color: var(--teal-dk); }
.nav-bar { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.nav-bar #nextBtn, .nav-bar #submitBtn { margin-left: auto; }
.btn-secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line); color: var(--text); }