* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #17211d;
  background: #f7f3ea;
  line-height: 1.5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 8%;
  background: #fffdf8;
  border-bottom: 1px solid rgba(23, 33, 29, 0.12);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-logo {
  height: 52px;
  width: auto;
  display: block;
}

.top-nav {
  display: flex;
  gap: 18px;
}

.top-nav a {
  text-decoration: none;
  color: #17211d;
  font-weight: 700;
  font-size: 14px;
}

.quiz-page {
  width: min(1050px, 92%);
  margin: 32px auto 70px;
}

.hero-card,
.quiz-section,
.result-card,
.review-section {
  background: #ffffff;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
  margin: 0 0 10px;
}

.hero-card h1,
.quiz-section h2,
.review-section h2,
.result-card h2 {
  margin-top: 0;
}

.hero-text,
.section-note {
  color: #4e5954;
}

.primary-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  background: #5f3dc4;
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:hover {
  opacity: 0.92;
}

.hidden {
  display: none;
}

.question-card {
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 16px;
  padding: 18px;
  background: #fffdfa;
  margin-bottom: 16px;
}

.question-number {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.65;
  margin-bottom: 8px;
}

.question-text {
  font-weight: 700;
  margin-bottom: 12px;
}

.options-group {
  display: grid;
  gap: 10px;
}

.option-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f3ea;
  cursor: pointer;
}

.option-label input {
  margin-top: 2px;
}

.matching-legend {
  padding: 18px;
  border-radius: 16px;
  background: #f7f3ea;
  margin-bottom: 18px;
}

.matching-legend ul {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  gap: 32px;
}

.matching-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  align-items: center;
}

.matching-row select,
.fill-input,
.written-answer {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(23, 33, 29, 0.18);
  border-radius: 12px;
  font-size: 15px;
  background: white;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 16px;
  background: #f7f3ea;
}

.word-bank span {
  padding: 6px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid rgba(23, 33, 29, 0.14);
  font-size: 14px;
}

.written-answer {
  min-height: 120px;
  resize: vertical;
}

.submit-wrap {
  text-align: center;
  margin: 34px 0 20px;
}

.score-big {
  font-size: 34px;
  font-weight: 800;
  margin: 6px 0 0;
}

.score-sub {
  color: #4e5954;
}

.review-block {
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 16px;
  padding: 18px;
  background: #fffdfa;
  margin-bottom: 16px;
}

.correct {
  color: #0d7a37;
  font-weight: 700;
}

.incorrect {
  color: #b42318;
  font-weight: 700;
}

.model-answer {
  background: #f7f3ea;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    gap: 14px;
  }

  .matching-row {
    grid-template-columns: 1fr;
  }

  .matching-legend ul {
    columns: 1;
  }
}
.hidden {
  display: none !important;
}

.quiz-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 7% 100px;
}

/* MODE SELECT */

.mode-screen h1,
.result-screen h1 {
  margin: 0 0 48px;
  font-size: clamp(46px, 6vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.mode-card {
  min-height: 250px;
  padding: 30px;
  text-align: left;
  border: 1px solid #17211d;
  background: #ffffff;
  color: #17211d;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-4px);
}

.mode-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.mode-card strong {
  display: block;
  margin: 28px 0 12px;
  font-size: 28px;
  line-height: 1.15;
}

.mode-card p {
  margin: 0;
  max-width: 350px;
  font-size: 15px;
  line-height: 1.65;
}

/* PROGRESS */

.quiz-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-bottom: 42px;
  background: #e7e2d8;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: #6f3fd6;
  transition: width 0.25s ease;
}

/* QUESTION */

.question-card {
  padding: 34px;
  border: 1px solid #d9d4ca;
  border-radius: 22px;
  background: #ffffff;
}

.question-number {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.6;
}

.question-type {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6f3fd6;
  text-transform: uppercase;
}

.question-card h2 {
  margin: 0 0 30px;
  font-size: 28px;
  line-height: 1.35;
}

/* MULTIPLE CHOICE */

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-option {
  width: 100%;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f5f0e6;
  color: #17211d;
  text-align: left;
  font-size: 17px;
  cursor: pointer;
}

.answer-option:hover {
  border-color: rgba(111, 63, 214, 0.45);
}

.answer-option.selected {
  border-color: #6f3fd6;
  background: #f0e8ff;
}

.answer-option.correct {
  border-color: #4f8b57;
  background: #dff4df;
}

.answer-option.wrong {
  border-color: #c15b5b;
  background: #f8dddd;
}

/* WRITTEN */

.written-area label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.written-area textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 180px;
  padding: 18px;
  border: 1px solid #cfc9be;
  border-radius: 14px;
  background: #faf8f3;
  color: #17211d;
  font: inherit;
  line-height: 1.6;
}

/* PRACTICE FEEDBACK */

.practice-feedback {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 12px;
  background: #f5f0e6;
  font-weight: 700;
}

.model-answer-btn {
  margin-top: 20px;
  padding: 13px 18px;
  border: 1px solid #17211d;
  background: transparent;
  color: #17211d;
  font-weight: 700;
  cursor: pointer;
}

.model-answer {
  margin-top: 20px;
  padding: 22px;
  border-left: 4px solid #6f3fd6;
  background: #f3effc;
}

.model-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.model-answer p:last-child {
  margin-bottom: 0;
  line-height: 1.65;
}

/* NAVIGATION */

.quiz-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.primary-btn,
.secondary-btn {
  display: inline-block;
  padding: 14px 20px;
  border: 1px solid #17211d;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-btn {
  background: #17211d;
  color: #ffffff;
}

.secondary-btn {
  background: transparent;
  color: #17211d;
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* RESULTS */

.score-box {
  display: flex;
  align-items: end;
  gap: 24px;
  margin-bottom: 26px;
}

.score-box strong {
  font-size: clamp(48px, 7vw, 76px);
  line-height: 1;
}

.score-box span {
  font-size: 26px;
  font-weight: 700;
}

.written-note {
  max-width: 700px;
  margin-bottom: 42px;
  line-height: 1.6;
}

.result-item {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid #d9d4ca;
  background: #ffffff;
}

.result-item p {
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 14px;
  margin-top: 40px;
}

/* MOBILE */

@media (max-width: 750px) {
  .quiz-page {
    padding: 50px 6% 80px;
  }

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

  .question-card {
    padding: 24px;
  }

  .quiz-navigation {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .score-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .result-actions {
    flex-direction: column;
  }
}
.matching-term {
  color: #6f3fd6;
}

.matching-options {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
}

.matching-options div {
  padding: 10px 12px;
  background: #f7f3ea;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .matching-options {
    grid-template-columns: 1fr;
  }
}

.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}

.question-nav-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #cfc9be;
  background: #ffffff;
  color: #17211d;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
}

.question-nav-btn.answered {
  background: #e9defd;
  border-color: #6f3fd6;
}

.question-nav-btn.current {
  background: #17211d;
  color: #ffffff;
  border-color: #17211d;
}

.question-nav-btn.unanswered {
  background: #ffffff;
}
.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 28px;
}

.result-summary-item {
  padding: 12px 16px;
  border: 1px solid #d5d0c7;
  background: #ffffff;
  font-weight: 700;
}

.result-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.result-filter {
  padding: 10px 16px;
  border: 1px solid #17211d;
  background: transparent;
  color: #17211d;
  font-weight: 700;
  cursor: pointer;
}

.result-filter.active {
  background: #17211d;
  color: #ffffff;
}

.result-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.result-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.result-nav-btn.correct {
  background: #e4f4e8;
  border: 2px solid #3f9b59;
}

.result-nav-btn.incorrect {
  background: #fde8e8;
  border: 2px solid #df5b5b;
}

.result-nav-btn.written {
  background: #eee7fb;
  border: 2px solid #6f3fd6;
}

.result-item.correct {
  border-left: 6px solid #3f9b59;
  background: #f4fbf5;
}

.result-item.incorrect {
  border-left: 6px solid #df5b5b;
  background: #fff5f5;
}

.result-item.written {
  border-left: 6px solid #6f3fd6;
  background: #f7f3fc;
}

.result-status {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 700;
}

.result-status.correct {
  color: #2f7d45;
}

.result-status.incorrect {
  color: #bf4141;
}

.result-status.written {
  color: #6f3fd6;
}