:root {
  --bg: #f3f7f0;
  --panel: #ffffff;
  --ink: #11252a;
  --muted: #496067;
  --accent: #117a65;
  --accent-soft: #d5efe8;
  --line: #d7e5e0;
  --shadow: 0 14px 34px rgba(9, 46, 57, 0.1);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #d2f1e9 0, transparent 22%),
    radial-gradient(circle at 88% 10%, #f3d4a2 0, transparent 26%),
    var(--bg);
}

.page {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 56px 0 72px;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin: 0.1rem 0 0.6rem;
  line-height: 1.1;
  max-width: 14ch;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
}

.intro {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-points span {
  background: #e8f7f2;
  border: 1px solid #c4e8dc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #176553;
}

.resource-grid {
  margin-top: 24px;
}

.resource-card {
  background: linear-gradient(155deg, #ffffff, #f8fffc);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.resource-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.resource-card p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.45;
}

.resource-card ul {
  margin: 0;
  padding-left: 18px;
  color: #28525b;
}

.resource-card li {
  margin: 6px 0;
}

.society {
  background: linear-gradient(145deg, #ffffff, #f4fff9);
}

.quiz-panel {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.panel-note {
  margin: 0;
  font-size: 0.92rem;
  color: #26705f;
  font-weight: 700;
}

.exam-selectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.compact {
  width: min(240px, 100%);
}

#mockSetField {
  display: none;
}

.field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #2b5a60;
}

select,
input[type="search"],
button,
.option-btn {
  min-height: 44px;
}

select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

input[type="search"] {
  flex: 1 1 340px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  background: #0f4f5f;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

button.secondary {
  background: #e5eff2;
  color: #17444f;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-text {
  margin: 8px 0 0;
  color: #0f5f4f;
  font-weight: 700;
  font-size: 0.92rem;
}

.result-details {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.question-nav {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#questionPosition {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.mock-toolbar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ecf8f3;
  border: 1px solid #cbe8dd;
  border-radius: 12px;
}

.timer strong {
  font-size: 1.1rem;
  color: #0f5f4f;
}

.mock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-layout {
  margin-top: 18px;
}

.question-list {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: linear-gradient(145deg, var(--panel), #fafeff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: var(--shadow);
  animation: enter 420ms ease both;
}

.card-head {
  margin-bottom: 10px;
}

.q-number {
  display: inline-block;
  background: var(--accent-soft);
  color: #114e43;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.q-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.q-options {
  list-style: none;
  margin: 14px 0 0;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.q-options li {
  margin: 0;
}

.option-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.option-btn.selected {
  border-color: #2aa181;
  background: #ebf8f3;
  color: #114e43;
  font-weight: 700;
}

.option-btn.correct {
  border-color: #2f9e44;
  border-width: 2px;
  background: #d3f9d8;
  color: #1d6f2b;
  font-weight: 700;
}

.option-btn.wrong {
  border-color: #e03131;
  border-width: 2px;
  background: #ffe0e0;
  color: #c92a2a;
  font-weight: 700;
}

/* Discourage copying of exam content from the page UI. */
.card,
.q-title,
.q-options,
.option-btn,
.result-text,
.result-details {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  filter: blur(12px);
}

.shape-1 {
  width: 280px;
  height: 280px;
  border-radius: 42% 58% 62% 38% / 46% 42% 58% 54%;
  background: #bdeee0;
  top: -40px;
  right: -60px;
  opacity: 0.4;
}

.shape-2 {
  width: 260px;
  height: 260px;
  border-radius: 67% 33% 44% 56% / 39% 58% 42% 61%;
  background: #f0cf9f;
  bottom: -40px;
  left: -80px;
  opacity: 0.3;
}

.shape-3 {
  width: 210px;
  height: 210px;
  border-radius: 49% 51% 27% 73% / 69% 39% 61% 31%;
  background: #b9d8f6;
  top: 48%;
  left: -90px;
  opacity: 0.22;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  margin-top: 24px;
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    padding-top: 22px;
  }

  .topbar {
    justify-content: stretch;
  }

  .field.compact {
    width: 100%;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .exam-selectors {
    grid-template-columns: 1fr;
  }

  .question-list {
    grid-template-columns: 1fr;
  }

  .mock-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .question-nav {
    gap: 8px;
  }

  #questionPosition {
    text-align: center;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 37, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(9, 46, 57, 0.3);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h2 {
  margin: 0 0 16px 0;
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  color: var(--ink);
  font-weight: 700;
}

.modal-content p {
  margin: 0 0 24px 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions button:first-child {
  background: var(--accent);
  color: white;
}

.modal-actions button:first-child:hover {
  background: #0f6b59;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 122, 101, 0.3);
}

.modal-actions button.secondary {
  background: var(--line);
  color: var(--muted);
}

.modal-actions button.secondary:hover {
  background: #c5d6d0;
}

@media (max-width: 640px) {
  .modal-content {
    padding: 24px;
    max-width: 90vw;
  }

  .modal-content h2 {
    font-size: 1.3rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }
}
