/* ============================================================
   ALIEN LAB — Chapter 3 course notes (13 units)
   ============================================================ */

/* banner */
.brand-banner {
  position: relative;
  margin: 22px 0 0;
  border: 1px solid rgba(88, 240, 210, 0.22);
  border-radius: 22px;
  overflow: hidden;
  background: #060a12;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
}

.brand-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
  object-position: center 70%;
}

.brand-banner figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.85);
}

.brand-banner figcaption span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.brand-banner figcaption b {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-banner figcaption b em {
  font-style: italic;
  color: #8dff4a;
}

/* unit intro line */
.unit-intro {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 12px;
}

.unit-lead {
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* objectives */
.objectives {
  counter-reset: obj;
  display: grid;
  gap: 8px;
  margin: 14px 0 6px;
}

.objectives li {
  counter-increment: obj;
  position: relative;
  padding: 12px 14px 12px 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 19, 33, 0.45);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-soft);
}

.objectives li::before {
  content: counter(obj);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(88, 240, 210, 0.3);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

/* oil rig + comparison tables reuse .data-table / .oil-rig from lesson.css */

/* steps 1-2-3 blocks */
.step-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  counter-reset: stp;
}

.step-list li {
  counter-increment: stp;
  position: relative;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 19, 33, 0.5);
}

.step-list li::before {
  content: counter(stp);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(88, 240, 210, 0.1);
  border: 1px solid rgba(88, 240, 210, 0.28);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
}

.step-list h4 {
  font-size: 12.5px;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}

.step-list p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.step-list code {
  display: block;
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #b9fff2;
}

/* result chips */
.result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}

.result-chips span {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 180, 84, 0.28);
  background: rgba(255, 180, 84, 0.07);
  color: #ffd9a6;
}

.result-chips span.ok {
  border-color: rgba(88, 240, 210, 0.3);
  background: rgba(88, 240, 210, 0.07);
  color: #b9fff2;
}

.result-chips span.mix {
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
  color: #d5c9ff;
}

/* mistake cards */
.mistakes {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.mistake {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 19, 33, 0.45);
}

.mistake > div {
  padding: 13px 15px;
}

.mistake .bad {
  border-right: 1px solid var(--line);
  background: rgba(255, 111, 134, 0.05);
}

.mistake .good {
  background: rgba(88, 240, 210, 0.04);
}

.mistake h4 {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--red);
}

.mistake .good h4 {
  color: var(--cyan);
}

.mistake p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.mistake strong {
  color: var(--text-soft);
  font-weight: 600;
}

/* interactive quiz */
.unit-quiz {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 16, 28, 0.7);
  overflow: hidden;
}

.unit-quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(150, 190, 255, 0.03);
}

.unit-quiz-head span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.unit-quiz-head b {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--cyan);
}

.unit-quiz form {
  display: grid;
  gap: 2px;
}

.q-item {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(150, 190, 255, 0.06);
}

.q-item:last-of-type {
  border-bottom: 0;
}

.q-item legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
}

.q-item legend b {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--cyan);
  margin-right: 6px;
}

.q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.q-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(6, 13, 23, 0.55);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.q-option:hover {
  border-color: rgba(88, 240, 210, 0.3);
  color: var(--text-soft);
}

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

.q-option .letter {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--muted-2);
}

.q-option input:checked ~ .letter {
  background: rgba(88, 240, 210, 0.14);
  border-color: rgba(88, 240, 210, 0.5);
  color: var(--cyan);
}

.q-option input:checked ~ span:last-child {
  color: var(--text);
}

.q-option input:focus-visible ~ .letter {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.q-option.is-correct {
  border-color: rgba(68, 230, 168, 0.55);
  background: rgba(68, 230, 168, 0.09);
  color: #d5ffee;
}

.q-option.is-wrong {
  border-color: rgba(255, 111, 134, 0.55);
  background: rgba(255, 111, 134, 0.08);
  color: #ffd4da;
}

.q-explain {
  display: none;
  margin-top: 8px;
  padding: 9px 11px;
  border-left: 2px solid rgba(88, 240, 210, 0.5);
  border-radius: 0 7px 7px 0;
  background: rgba(88, 240, 210, 0.05);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.q-explain.is-shown {
  display: block;
}

.q-explain b {
  color: var(--text-soft);
}

.unit-quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.q-score {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.q-score b {
  color: var(--cyan);
  font-weight: 500;
}

/* completion banner */
.complete-card {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 22px;
  border: 1px solid rgba(141, 255, 74, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgba(141, 255, 74, 0.1), transparent 60%),
    linear-gradient(145deg, rgba(14, 27, 45, 0.9), rgba(7, 14, 25, 0.9));
}

.complete-card .trophy {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(141, 255, 74, 0.35);
  background: rgba(141, 255, 74, 0.08);
  color: #b6ff8a;
  font-size: 22px;
}

.complete-card h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.complete-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 52ch;
}

/* definition list for short glossaries */
.gloss {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

dl.gloss { margin: 14px 0; }

.gloss div {
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(10, 19, 33, 0.4);
}

.gloss dt {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.gloss dd {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.62;
  color: var(--muted);
}

@media (max-width: 760px) {
  .brand-banner img { max-height: 220px; }
  .q-options { grid-template-columns: 1fr; }
  .mistake { grid-template-columns: 1fr; }
  .mistake .bad { border-right: 0; border-bottom: 1px solid var(--line); }
  dl.gloss { margin: 14px 0; }

.gloss div { grid-template-columns: 1fr; gap: 3px; }
}

@media print {
  .unit-quiz-foot .btn,
  .q-explain { display: none !important; }
  .q-option { break-inside: avoid; }
  .brand-banner { display: none; }
}

/* fieldset reset: no native borders / gaps between questions */
.unit-quiz form {
  gap: 0;
}

.q-item {
  border: 0;
  border-bottom: 1px solid rgba(150, 190, 255, 0.06);
  margin: 0;
  min-width: 0;
}

.q-item legend {
  width: 100%;
  box-sizing: border-box;
}

.q-option.is-correct input:checked ~ .letter {
  background: var(--green);
  border-color: var(--green);
  color: #04130d;
}

.q-option.is-wrong input:checked ~ .letter {
  background: var(--red);
  border-color: var(--red);
  color: #1b0408;
}

.q-option.is-correct input:checked ~ span:last-child { color: #d5ffee; }
.q-option.is-wrong input:checked ~ span:last-child { color: #ffd4da; }

.unit-quiz-foot .text-link {
  font-size: 10.5px;
}
