:root {
  --sand: #f4ead5;
  --sand-dark: #e6d5b0;
  --olive: #3d4a2a;
  --olive-light: #5b6b3c;
  --sunset: #d9782d;
  --sunset-dark: #b85f1b;
  --ink: #2b2418;
  --muted: #6f6450;
  --ok: #4f7a35;
  --bad: #b3412e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--sand);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(217, 120, 45, .18), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(61, 74, 42, .15), transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--olive);
  color: var(--sand);
}
.brand { font-weight: 700; letter-spacing: .02em; }
.progress-label { font-size: .9rem; opacity: .9; }

.progress { height: 5px; background: var(--sand-dark); }
.progress-bar { height: 100%; width: 0; background: var(--sunset); transition: width .35s ease; }

.card {
  max-width: 760px;
  margin: 24px auto 40px;
  background: #fffaf0;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(43, 36, 24, .15);
  overflow: hidden;
}

.photo {
  background: #1f1a12;
  display: flex;
  justify-content: center;
}
.photo img {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
}

.content { padding: 20px 24px 24px; }

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--olive);
  line-height: 1.25;
  margin: 0 0 12px;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }

.qnum {
  color: var(--sunset-dark);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}

p { margin: 0 0 14px; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }

input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 10px;
  background: #fff;
}
input[type="text"]:focus { outline: none; border-color: var(--sunset); }

.answers { display: grid; gap: 10px; margin: 16px 0 20px; }

.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 14px 16px;
  border: 2px solid var(--sand-dark);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.answer:hover { border-color: var(--sunset); }
.answer .dot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
}
.answer[aria-checked="true"] { border-color: var(--sunset); background: #fdf0e3; }
.answer[aria-checked="true"] .dot { border-color: var(--sunset); background: radial-gradient(var(--sunset) 45%, transparent 50%); }

.nav { display: flex; gap: 12px; flex-wrap: wrap; }
.nav .btn { flex: 1 1 160px; }

.btn {
  font: inherit;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--sunset); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sunset-dark); }
.btn-secondary { background: transparent; border-color: var(--olive-light); color: var(--olive); }
.btn-secondary:hover:not(:disabled) { background: var(--sand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.error { color: var(--bad); font-weight: 600; min-height: 1.5em; margin: 8px 0; }

.score {
  font-family: Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--sunset-dark);
  text-align: center;
  margin: 4px 0 12px;
}

.review { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.review li {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sand);
  font-size: .95rem;
  border-left: 4px solid var(--ok);
}
.review li.wrong { border-left-color: var(--bad); }
.review .q { font-weight: 600; }
.review .a { color: var(--muted); }

.greeting { font-family: Georgia, serif; font-style: italic; font-size: 1.15rem; }

.noscript { text-align: center; padding: 24px; }

@media (max-width: 600px) {
  .card { margin: 0; border-radius: 0; box-shadow: none; }
  .content { padding: 16px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  .photo img { max-height: 38vh; }
}
