:root {
  --navy: #193650;
  --navy-soft: #36584d;
  --green-dark: #175b46;
  --green: #24765c;
  --green-light: #e3f4e9;
  --green-pale: #f4fff9;
  --blue-pastel: #d7e5f0;
  --blue-border: #8aaec7;
  --mint: #d8e9de;
  --coral: #f08e72;
  --coral-pale: #fff0ed;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(31, 104, 77, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--navy);
  background: var(--green-pale);
  font-family: "DM Sans", sans-serif;
  line-height: 1.5;
}

.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 4px solid var(--coral);
}

.header-inner,
.page-shell,
.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 52px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.lesson-label {
  color: #d7e5f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.lesson-label span { color: var(--coral); margin: 0 7px; }

.page-shell { padding: 66px 0 82px; }

.intro-panel {
  position: relative;
  max-width: none;
  margin-bottom: 68px;
  padding: 62px 60px 58px;
  overflow: hidden;
  color: var(--white);
  background: var(--navy);
  border-radius: 16px;
}

.intro-panel::before,
.intro-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(215, 229, 240, .13);
  border-radius: 50%;
}

.intro-panel::before {
  width: 440px;
  height: 440px;
  top: -300px;
  right: -70px;
}

.intro-panel::after {
  width: 330px;
  height: 330px;
  top: -190px;
  right: 40px;
}

.intro-panel > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

.intro-panel .eyebrow { color: #d7e5f0; }

h1,
h2,
p { margin-top: 0; }

h1,
h2 {
  font-family: Fraunces, Georgia, serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--white);
  font-size: clamp(48px, 8vw, 82px);
  line-height: .95;
}

.intro-panel > p {
  max-width: 800px;
  margin-bottom: 0;
  color: #d7e5f0;
  font-size: 17px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--mint);
}

.section-heading-second { margin-top: 76px; }

.drill-note {
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 600;
}

.section-kicker { margin-bottom: 8px; }

h2 {
  margin-bottom: 0;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.1;
}

h2 span {
  color: var(--navy-soft);
  font-family: "DM Sans", sans-serif;
  font-size: .5em;
  font-weight: 500;
  vertical-align: middle;
}

.progress-wrap { min-width: 170px; }

.progress-wrap > span {
  display: block;
  margin-bottom: 8px;
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  background: var(--mint);
  border-radius: 99px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width .3s ease;
}

.exercise-panel {
  margin-top: 27px;
  padding: 28px;
  background: var(--white);
  border: 1px solid #d8e9de;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.instruction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.instruction-row p { margin-bottom: 0; color: var(--navy-soft); font-size: 14px; }

.status-pill {
  flex: 0 0 auto;
  padding: 6px 11px;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.quiz-list { display: grid; gap: 14px; }

.question-card {
  padding: 20px;
  background: #f7fbf8;
  border: 1px solid #e0eee5;
  border-radius: 8px;
  transition: border-color .2s ease, background .2s ease;
}

.question-card.is-correct { background: #e7f5ec; border-color: #73b88f; }
.question-card.is-wrong { background: var(--coral-pale); border-color: #e5a29a; }

.question-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
}

.question-number { color: var(--coral); font-size: 12px; font-weight: 700; }
.question-text { margin: 0; color: var(--navy); font-size: 17px; font-weight: 700; }

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }

.option label {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  color: var(--navy-soft);
  background: var(--white);
  border: 1px solid #d7e6dc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.option label:hover { border-color: var(--green); transform: translateY(-1px); }
.option input:checked + label { color: var(--navy); background: var(--blue-pastel); border-color: var(--blue-border); font-weight: 600; }
.option-letter { color: var(--green); font-weight: 700; }

.question-card.is-correct .option input:checked + label { color: var(--green-dark); background: var(--green-light); border-color: var(--green); }
.question-card.is-wrong .option input:checked + label { color: #8f3528; background: var(--coral-pale); border-color: #e28a7a; }

.feedback {
  margin: 12px 0 0 31px;
  font-size: 12px;
  font-weight: 600;
}
.feedback.correct { color: var(--green); }
.feedback.wrong { color: #a64830; }

.quiz-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding-top: 23px;
  border-top: 1px solid #e0eee5;
}

.button {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--white); background: var(--green); box-shadow: 0 8px 18px rgba(36, 118, 92, .18); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green-dark); background: var(--green-light); }
.button-secondary:hover { background: var(--mint); }

.result-panel {
  margin-top: 20px;
  padding: 17px 18px;
  color: var(--green-dark);
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.ordering-list { display: grid; gap: 14px; }

.ordering-card {
  padding: 20px;
  background: #f7fbf8;
  border: 1px solid #e0eee5;
  border-radius: 8px;
}

.ordering-card.is-correct { background: #e7f5ec; border-color: #73b88f; }
.ordering-card.is-wrong { background: var(--coral-pale); border-color: #e5a29a; }

.ordering-card-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
}

.ordering-answer {
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 14px 0 10px;
  padding: 9px;
  background: var(--white);
  border: 1px dashed #9aaa9f;
  border-radius: 6px;
}

.ordering-answer:empty::before {
  content: "Kéo từ vào đây";
  color: #91a79a;
  font-size: 12px;
}

.ordering-word {
  padding: 8px 11px;
  color: var(--navy-soft);
  background: var(--white);
  border: 1px solid #d7e6dc;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.ordering-word:hover { border-color: var(--blue-border); transform: translateY(-1px); }
.ordering-word.is-placed { color: var(--navy); background: var(--blue-pastel); border-color: var(--blue-border); }

.ordering-meaning {
  margin: 0 0 13px 31px;
  color: var(--navy-soft);
  font-size: 13px;
}

.ordering-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.ordering-card .feedback { margin-left: 31px; }

.ordering-substitutions {
  margin: 0 0 0 0;
  color: #6f8980;
  font-size: 13px;
}

.ordering-substitutions strong {
  color: var(--green-dark);
  font-weight: 700;
}

.ordering-substitutions span { margin-right: 12px; }

.substitution-list { display: grid; gap: 14px; }

.substitution-card {
  padding: 20px;
  background: #f7fbf8;
  border: 1px solid #e0eee5;
  border-radius: 8px;
}

.substitution-card-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.substitution-english {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.substitution-english strong {
  padding: 2px 5px;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 4px;
  font-weight: 700;
}

.substitution-meaning {
  margin: 0 0 16px 31px;
  color: var(--navy-soft);
  font-size: 13px;
}

.substitution-selected-meaning {
  margin: -7px 0 16px 31px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.substitution-label {
  display: block;
  margin: 0 0 8px 31px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.substitution-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 31px;
}

.substitution-option {
  padding: 9px 13px;
  color: var(--navy-soft);
  background: var(--white);
  border: 1px solid #d7e6dc;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.substitution-option:hover { border-color: var(--blue-border); transform: translateY(-1px); }
.substitution-option.is-selected { color: var(--navy); background: var(--blue-pastel); border-color: var(--blue-border); }

.substitution-reset {
  margin: 14px 0 0 31px;
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.substitution-reset:hover { color: var(--green-dark); }

.site-footer {
  padding: 25px 0 34px;
  color: #6f8980;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-align: center;
}

.site-footer span { color: var(--coral); margin: 0 5px; }

@media (max-width: 640px) {
  .header-inner,
  .page-shell,
  .site-footer { width: min(100% - 28px, 1080px); }
  .header-inner { min-height: 68px; }
  .brand-logo { width: 48px; height: 48px; }
  .lesson-label { font-size: 9px; }
  .page-shell { padding: 48px 0 55px; }
  .intro-panel { margin-bottom: 48px; padding: 39px 25px 35px; border-radius: 12px; }
  .section-heading { align-items: start; flex-direction: column; gap: 18px; }
  .section-heading-second { margin-top: 54px; }
  .progress-wrap { width: 100%; }
  .progress-wrap > span { text-align: left; }
  .exercise-panel { padding: 17px; }
  .instruction-row { align-items: start; flex-direction: column; gap: 10px; }
  .options { grid-template-columns: 1fr; }
  .quiz-actions { flex-wrap: wrap; }
  .button { flex: 1; }
  .ordering-card { padding: 17px; }
  .ordering-answer,
  .ordering-meaning,
  .ordering-bank,
  .ordering-substitutions,
  .ordering-card .feedback { margin-left: 0; }
  .drill-note { margin-top: -8px; }
  .substitution-card { padding: 17px; }
  .substitution-english { font-size: 15px; }
  .substitution-meaning,
  .substitution-selected-meaning,
  .substitution-label,
  .substitution-options,
  .substitution-reset { margin-left: 0; }
}
