/* =====================================================
   MEDIMODULES – DESIGN SYSTEM
   Extracted from Figma: NnFVv8Xsk1I7NREeB5MLXI
   Stack: Vanilla HTML/CSS/JS
   ===================================================== */

/* ─── RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Cabin', sans-serif;
  background-color: #e3e8f2;
  color: #2d2d2f;
  font-size: 16px;
  line-height: 1.4;
}

/* ─── NAV ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 72px;
  background-color: #42589a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-radius: 0 0 20px 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-logo-box {
  background: #f5f7ff;
  border-radius: 10px;
  width: 52px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  line-height: 1;
}

.nav-logo-mm {
  font-family: 'Rethink Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #2a3d73;
}

.nav-logo-plus {
  font-family: 'Rethink Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #2a3d73;
  margin-top: -2px;
}

.nav-brand {
  font-family: 'Rethink Sans', sans-serif;
  font-size: 32px;
  color: #f5f7ff;
  letter-spacing: -0.5px;
}

.nav-brand-light { font-weight: 400; }
.nav-brand-bold  { font-weight: 700; }

.nav-more {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: #f5f7ff;
  cursor: default;
  user-select: none;
}

/* ─── DROPDOWN MENU ─────────────────────────────────── */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.nav-dropdown-icon {
  width: 20px;
  height: 20px;
  color: #f5f7ff;
  stroke-width: 2.5;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-icon {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  background: #ffffff;
  border: 2px solid #9fadda;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 220px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

.dropdown-item {
  padding: 14px 18px;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  color: #2d2d2f;
  border-bottom: 1px solid #e3e8f2;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f0f3fb;
  color: #3f74df;
}

/* ─── SCREEN LAYOUT ─────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  padding: 96px 20px 40px;
  align-items: flex-start;
  justify-content: center;
}

.screen.active {
  display: flex;
}

/* ─── CARD ──────────────────────────────────────────── */
.card {
  background: #fafbfe;
  border: 2px solid #9fadda;
  border-radius: 32px;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── CARD HEADER ───────────────────────────────────── */
.card-header {
  padding: 24px 48px 0;
}

.card-header.no-progress {
  padding-bottom: 0;
}

.section-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #6d6d74;
  letter-spacing: 0.5px;
  text-transform: none;
  margin-bottom: 6px;
}

/* ─── PROGRESS BAR ──────────────────────────────────── */
.progress-bar-wrap {
  margin-bottom: 20px;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background-color: #d4daf0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #2a8a50;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ─── STEP BADGE ─────────────────────────────────────── */
.step-badge {
  display: inline-block;
  background-color: #3f74df;
  color: #ffffff;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 26px;
  padding: 8px 22px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* ─── CARD TITLE ─────────────────────────────────────── */
.card-title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: #2d2d2f;
  line-height: 1.2;
  margin-bottom: 8px;
}

.card-title-pass { color: #0d873e; }
.card-title-fail { color: #c0392b; }

/* ─── CARD BODY ──────────────────────────────────────── */
.card-body {
  padding: 20px 48px 28px;
  flex: 1;
}

/* ─── CARD FOOTER ────────────────────────────────────── */
.card-footer {
  padding: 16px 48px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
.body-text {
  font-family: 'Cabin', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: #2d2d2f;
  margin-bottom: 14px;
}

.body-text-note {
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #42589a;
  margin-bottom: 18px;
}

.intro-list {
  padding-left: 24px;
  margin-top: 6px;
}

.intro-list li {
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.5;
}

/* ─── PRACTICE POINT PILL ────────────────────────────── */
.practice-point-pill {
  display: inline-block;
  background-color: #3f74df;
  color: #ffffff;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ─── QUESTION TEXT ─────────────────────────────────── */
.question-text {
  font-family: 'Cabin', sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: #2d2d2f;
  margin-bottom: 14px;
}

.question-sub {
  font-family: 'Cabin', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  color: #2d2d2f;
  margin-bottom: 20px;
}

/* ─── MULTIPLE CHOICE OPTIONS ────────────────────────── */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.mc-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 2px solid #9fadda;
  border-radius: 6px;
  background: #fafbfe;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  color: #2d2d2f;
  user-select: none;
}

.mc-option:hover {
  border-color: #3f74df;
  background: #eef2fb;
}

.mc-option input[type="radio"],
.mc-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #9fadda;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.mc-option input[type="checkbox"] {
  border-radius: 4px;
}

.mc-option input[type="radio"]:checked,
.mc-option input[type="checkbox"]:checked {
  border-color: #3f74df;
  background-color: #3f74df;
}

.mc-option input[type="radio"]:checked::after,
.mc-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
}

.mc-option input[type="checkbox"]:checked::after {
  top: 2px; left: 4px;
  width: 8px;
  height: 8px;
  background: none;
  border-radius: 0;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
}

/* correct / incorrect option states */
.mc-option.correct {
  border-color: #0d873e;
  background: #e8f7ee;
}
.mc-option.correct input[type="radio"]:checked,
.mc-option.correct input[type="checkbox"]:checked {
  border-color: #0d873e;
  background: #0d873e;
}

.mc-option.incorrect {
  border-color: #c0392b;
  background: #fdf0ee;
}
.mc-option.incorrect input[type="radio"]:checked,
.mc-option.incorrect input[type="checkbox"]:checked {
  border-color: #c0392b;
  background: #c0392b;
}

/* ─── TRUE / FALSE OPTIONS ───────────────────────────── */
.tf-options {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.tf-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 36px;
  border: 2px solid #9fadda;
  border-radius: 6px;
  background: #fafbfe;
  cursor: pointer;
  font-family: 'Cabin', sans-serif;
  font-size: 17px;
  color: #2d2d2f;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.tf-option:hover {
  border-color: #3f74df;
  background: #eef2fb;
}

.tf-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #9fadda;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.tf-option input[type="radio"]:checked {
  border-color: #3f74df;
  background-color: #3f74df;
}

.tf-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
}

.tf-option.correct {
  border-color: #0d873e;
  background: #e8f7ee;
}
.tf-option.correct input:checked {
  border-color: #0d873e;
  background: #0d873e;
}
.tf-option.incorrect {
  border-color: #c0392b;
  background: #fdf0ee;
}
.tf-option.incorrect input:checked {
  border-color: #c0392b;
  background: #c0392b;
}

/* ─── FILL IN THE BLANK ──────────────────────────────── */
.fitb-sentence {
  font-family: 'Cabin', sans-serif;
  font-size: 17px;
  line-height: 2;
  color: #2d2d2f;
  margin-bottom: 20px;
}

.fitb-blank {
  display: inline-block;
  min-width: 130px;
  padding: 2px 10px;
  border: none;
  border-bottom: 2.5px solid #3f74df;
  background: transparent;
  color: #2d2d2f;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  border-radius: 0;
  transition: background 0.15s;
  vertical-align: middle;
}

.fitb-blank:hover {
  background: #eef2fb;
}

.fitb-blank.active-blank {
  background: #dce7fb;
  border-bottom-color: #1a4fba;
}

.fitb-blank.filled {
  color: #1a4fba;
}

.fitb-blank.correct-blank {
  border-bottom-color: #0d873e;
  color: #0d873e;
}

.fitb-blank.incorrect-blank {
  border-bottom-color: #c0392b;
  color: #c0392b;
}

/* text input variant */
.fitb-input {
  display: inline-block;
  min-width: 180px;
  padding: 4px 10px;
  border: none;
  border-bottom: 2.5px solid #3f74df;
  background: transparent;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  color: #2d2d2f;
  outline: none;
  vertical-align: middle;
}

.fitb-input:focus {
  background: #eef2fb;
}

.fitb-input.correct-input {
  border-bottom-color: #0d873e;
  color: #0d873e;
}

.fitb-input.incorrect-input {
  border-bottom-color: #c0392b;
  color: #c0392b;
}

/* ─── WORD BANK ──────────────────────────────────────── */
.word-bank-label {
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  margin-bottom: 10px;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.word-tile {
  padding: 9px 20px;
  border: 2px solid #9fadda;
  border-radius: 6px;
  background: #fafbfe;
  font-family: 'Cabin', sans-serif;
  font-size: 15px;
  color: #2d2d2f;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.word-tile:hover {
  border-color: #3f74df;
  background: #eef2fb;
}

.word-tile.used {
  opacity: 0.35;
  pointer-events: none;
}

/* ─── FEEDBACK ───────────────────────────────────────── */
.feedback {
  margin-top: 12px;
  font-family: 'Cabin', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 0;
}

.feedback.show-correct {
  color: #0d873e;
  font-weight: 600;
}

.feedback.show-incorrect {
  color: #c0392b;
}

.feedback .feedback-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.inline-feedback {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.inline-feedback.show-correct {
  background: #e8f7ee;
  border-left: 3px solid #0d873e;
}

.inline-feedback.show-incorrect {
  background: #fdf0ee;
  border-left: 3px solid #c0392b;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #3f74df;
  color: #f5f7ff;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 20px;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: #2e60c7;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #9fadda;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: #3f74df;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 20px;
  padding: 14px 32px;
  border: 2px solid #3f74df;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background-color: #eef2fb;
}

/* ─── VIDEO EMBED ─────────────────────────────────────── */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #303033;
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-embed-sm {
  max-width: 560px;
  margin: 16px 0 20px;
}

/* ─── WELCOME LAYOUT ─────────────────────────────────── */
.welcome-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.welcome-text { }

.welcome-image {
  border-radius: 24px;
  overflow: hidden;
}

.welcome-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

/* ─── REFLECTION BOX ─────────────────────────────────── */
.reflection-box {
  width: 100%;
  min-height: 180px;
  padding: 16px 20px;
  border: 2.5px solid #9fadda;
  border-radius: 14px;
  background: #fafbfe;
  font-family: 'Cabin', sans-serif;
  font-size: 16px;
  color: #2d2d2f;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  margin-top: 10px;
}

.reflection-box::placeholder { color: #9fadda; }

.reflection-box:focus {
  border-color: #3f74df;
}

.reflection-box-lg { min-height: 300px; }

.self-grade-note {
  margin-top: 16px;
  padding: 14px 18px;
  background: #eef2fb;
  border-left: 4px solid #3f74df;
  border-radius: 0 8px 8px 0;
  font-family: 'Cabin', sans-serif;
  font-size: 15px;
  color: #2d2d2f;
  line-height: 1.5;
}

/* ─── REVIEW QUESTION BLOCKS ─────────────────────────── */
.review-q-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 36px;
}

.review-q-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: #3f74df;
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-top: 2px;
}

.review-q-content { flex: 1; }

/* ─── DRAG & DROP REORDER ────────────────────────────── */
.reorder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

.drag-source-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drag-card {
  background: #fafbfe;
  border: 2px solid #9fadda;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Cabin', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #2d2d2f;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.drag-card:hover {
  border-color: #3f74df;
  box-shadow: 0 2px 8px rgba(63,116,223,0.15);
}

.drag-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.drag-card.placed {
  opacity: 0.3;
  pointer-events: none;
}

.drop-zones-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drop-zone {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 68px;
}

.zone-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #3f74df;
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  align-self: center;
}

.zone-slot {
  flex: 1;
  border: 2px dashed #9fadda;
  border-radius: 8px;
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  transition: border-color 0.15s, background 0.15s;
  background: #f0f3fb;
}

.zone-slot.drag-over {
  border-color: #3f74df;
  background: #dce7fb;
}

.zone-slot.slot-correct {
  border-color: #0d873e;
  border-style: solid;
  background: #e8f7ee;
}

.zone-slot.slot-incorrect {
  border-color: #c0392b;
  border-style: solid;
  background: #fdf0ee;
}

/* card placed inside a zone */
.zone-slot .drag-card {
  width: 100%;
  cursor: default;
  font-size: 13px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  margin: 0;
}

/* ─── RESULT SCREENS ─────────────────────────────────── */
.result-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.score-badge {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: white;
  padding: 24px 40px;
  border-radius: 14px;
  align-self: center;
  margin: 10px 0 20px;
  min-width: 160px;
  text-align: center;
}

.score-badge-pass { background: #0d873e; }
.score-badge-fail { background: #c0392b; }

.result-center { text-align: center; width: 100%; }

.missing-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 16px;
}

.missing-step-card {
  padding: 12px 18px;
  border: 2px solid #9fadda;
  border-radius: 8px;
  font-family: 'Cabin', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #2d2d2f;
  background: #fdf0ee;
  border-color: #c0392b;
}
