:root {
  --white: #fdfdfd;
  --light-blue: #a1cbfe;
  --blue: #4395d7;
  --blue-2: #5295d0;
  --muted-blue: #99bcdf;
  --dark: #0f131a;
  --ok: #16a34a;   /* green */
  --ko: #dc2626;   /* red */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--white);
  background: var(--dark) no-repeat center/cover fixed;
  background-image: url("monaco-26-banner.jpg");
  position: relative;
  min-height: 100svh;
}

/* Dark overlay for readability on top of the background image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
      to bottom,
      rgba(15, 19, 26, 0.75),
      rgba(15, 19, 26, 0.65)
    ),
    radial-gradient(60% 60% at 50% 20%, rgba(67, 149, 215, 0.25), transparent);
  pointer-events: none;
  z-index: 0;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.container {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: calc(100svh - 96px);
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 520px;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  color: var(--dark);
  border: 1px solid color-mix(in srgb, var(--muted-blue) 45%, white 55%);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(15, 19, 26, 0.28),
    0 3px 10px rgba(15, 19, 26, 0.15);
  padding: 20px;
  backdrop-filter: saturate(1.2) blur(6px);
}

.title {
  margin: 6px 0 4px;
  font-size: 1.4rem;
  line-height: 1.25;
}

.subtitle {
  margin: 0 0 16px;
  color: #2d3748;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-weight: 600;
  color: #111827;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--muted-blue);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  outline: none;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--light-blue) 60%, transparent);
}

.error {
  color: #b91c1c;
  min-height: 1em;
}

.privacy {
  margin-top: 8px;
  color: #4b5563;
  font-size: 0.9rem;
}

.btn {
  appearance: none;
  border: 1.5px solid var(--blue-2);
  background: linear-gradient(180deg, var(--blue), var(--blue-2));
  color: var(--white);
  padding: 12px 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  transition: transform 80ms ease, filter 120ms ease;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--blue-2);
  border-color: var(--muted-blue);
}

.btn.primary {
  margin-top: 8px;
}

.quiz-actions .btn.primary {
  margin-top: 0;
}

.quiz-actions .btn {
  min-height: 48px;
}

.step.hidden {
  display: none;
}
.step.active {
  display: block;
}

/* Quiz */
.quiz-header {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.progress {
  width: 100%;
  height: 10px;
  background: color-mix(in srgb, var(--muted-blue) 45%, white 55%);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--light-blue), var(--blue));
  border-radius: 999px;
}

.q-meta {
  display: flex;
  justify-content: space-between;
  color: #1f2937;
  font-weight: 600;
}

.question-wrap {
  display: grid;
  gap: 12px;
}

.explanation {
  display: none;
  background: #eef5ff;
  border: 1px solid color-mix(in srgb, var(--light-blue) 45%, white 55%);
  color: #0f172a;
  border-radius: 10px;
  padding: 10px 12px;
}
.explanation.show {
  display: block;
}

.question {
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 700;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1.5px solid color-mix(in srgb, var(--muted-blue) 45%, white 55%);
  border-radius: 12px;
  background: #fff;
}

.option.is-correct {
  border-color: color-mix(in srgb, var(--ok) 70%, white 30%);
  background: #f0fdf4;
}
.option.is-wrong {
  border-color: color-mix(in srgb, var(--ko) 70%, white 30%);
  background: #fef2f2;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.result-grid {
  display: grid;
  gap: 16px;
  align-items: center;
}
.donut {
  --pct: 0%;
  width: 160px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--light-blue) var(--pct), #e5edf7 0);
  display: grid;
  place-items: center;
  margin: 6px auto;
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  width: 68%;
  height: 68%;
  background: #fff;
  border-radius: 50%;
}
.donut > span {
  position: relative;
  font-weight: 800;
  color: #0f172a;
}
.result-info .subtitle {
  margin-bottom: 12px;
}

.save-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.save-status.loading {
  background: #eef5ff;
  color: var(--blue-2);
  border: 1px solid var(--muted-blue);
}

.save-status.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}

.save-status.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.save-status.info {
  background: #eef5ff;
  color: var(--blue-2);
  border: 1px solid var(--muted-blue);
}

.site-footer {
  text-align: center;
  padding: 12px 16px 18px;
  color: #dce7f6;
  opacity: 0.95;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo {
  height: 24px;
  width: auto;
  opacity: 0.9;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Larger screens: slightly increase card size */
@media (min-width: 760px) {
  .result-grid {
    grid-template-columns: 180px 1fr;
    align-items: center;
  }
  .card {
    padding: 24px;
  }
  .title {
    font-size: 1.5rem;
  }
}


