/* ============================================================
   CPR Training Module — design.css
   Matching the Figma design exactly:
   • Dark teal header  (#3d6e7e)
   • Light steel-blue header  (#aec7ce)
   • Quiz cards  (#cfdde3)
   • Inter Bold throughout
   ============================================================ */

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

:root {
  --teal-dark:     #3d6e7e;   /* main header, congrats banner, info box */
  --teal-mid:      #4a7a88;   /* hover states / accents */
  --teal-light:    #aec7ce;   /* light header bars */
  --teal-lighter:  #c8dce1;   /* congrats sub bar  */
  --quiz-bg:       #cfdde3;   /* quiz card background */
  --white:         #ffffff;
  --black:         #111111;
  --grey-text:     #333333;
  --radio-blue:    #4a90d9;
  --btn-black:     #111111;
  --btn-black-hover: #333333;
  --green-btn:     #2d8a3e;
  --green-hover:   #237032;
  --font:          'Inter', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  overflow: hidden;          /* one screen at a time */
}

/* ── Screen System ─────────────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--white);
  overflow-y: auto;
  overflow-x: hidden;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Screens 5 & fail use centered flex */
#screen-5.active,
#screen-fail.active {
  justify-content: center;
  align-items: center;
}

/* ── Header — Dark Teal (Screen 1) ─────────────────────────── */
.header-dark {
  background: var(--teal-dark);
  width: 100%;
  padding: 28px 40px;
  text-align: center;
  flex-shrink: 0;
}

.title-main {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 80px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--white);
  white-space: nowrap;
}

/* ── Header — Light Steel-Blue (Screens 1 sub / 2, 3, 4) ───── */
.header-light {
  background: var(--teal-light);
  width: 100%;
  padding: 14px 40px;
  text-align: center;
  flex-shrink: 0;
}

.header-light-only {
  background: var(--teal-light);
  width: 100%;
  padding: 18px 40px;
  text-align: center;
  flex-shrink: 0;
}

.title-sub {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 36px);
  letter-spacing: -0.04em;
  line-height: 1.32;
  color: var(--white);
}

.title-sub.dark-text {
  color: var(--black);
}

/* ── Content Area ──────────────────────────────────────────── */
.content-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 32px 80px 60px;
  flex: 1;
}

/* ── Video Block ───────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.module-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 4px;
  background: #000;
}

.eye-icon {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  background: var(--black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  cursor: pointer;
}

.eye-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--white);
}

/* ── Quiz Box (mini + final cards) ─────────────────────────── */
.quiz-box {
  background: var(--quiz-bg);
  border-radius: 8px;
  padding: 24px 32px 28px;
  width: 100%;
  max-width: 480px;
}

.quiz-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-align: center;
  color: var(--black);
  margin-bottom: 14px;
}

.quiz-question {
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 16px;
  text-align: center;
}

/* ── Radio Options ─────────────────────────────────────────── */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--black);
  user-select: none;
}

.option-label input[type="radio"] {
  display: none;   /* hide native */
}

.radio-custom {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #8aacb4;
  background: var(--white);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

/* Selected state — blue filled circle (like in Figma) */
.option-label input[type="radio"]:checked + .radio-custom {
  background: var(--radio-blue);
  border-color: var(--radio-blue);
}

.option-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--white);
  border-radius: 50%;
}

/* Correct / Incorrect highlight after submission */
.option-label.correct .radio-custom {
  background: #28a745;
  border-color: #28a745;
}
.option-label.incorrect .radio-custom {
  background: #dc3545;
  border-color: #dc3545;
}
.option-label.correct .radio-custom::after,
.option-label.incorrect .radio-custom::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--white);
  border-radius: 50%;
}

/* ── Feedback messages ─────────────────────────────────────── */
.quiz-feedback {
  min-height: 24px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 6px;
  transition: opacity 0.2s;
}

.quiz-feedback.correct-msg  { color: #1a7a30; }
.quiz-feedback.incorrect-msg { color: #b00020; }

.final-feedback {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  margin-top: 16px;
  min-height: 28px;
}

.final-feedback.pass-msg  { color: #1a7a30; }
.final-feedback.fail-msg  { color: #b00020; }

/* ── Submit Button (black pill) ────────────────────────────── */
.submit-btn {
  display: block;
  margin: 16px auto 0;
  padding: 14px 52px;
  background: var(--btn-black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}

.submit-btn:hover  { background: var(--btn-black-hover); }
.submit-btn:active { transform: scale(0.97); }

/* ── Navigation Arrows ─────────────────────────────────────── */
.nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background 0.18s, opacity 0.2s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.nav-btn svg {
  width: 38px;
  height: 38px;
  fill: var(--white);
}

.nav-btn:hover  { background: #333; transform: translateY(-50%) scale(1.07); }
.nav-btn:active { transform: translateY(-50%) scale(0.95); }

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.nav-btn:disabled:hover {
  background: var(--black);
  transform: translateY(-50%);
}

.nav-left  { left:  18px; }
.nav-right { right: 18px; }

/* ── Critical Fail Steps — Teal Info Box ───────────────────── */
.info-box {
  background: var(--teal-dark);
  border-radius: 8px;
  padding: 26px 32px 30px;
  width: 100%;
  max-width: 540px;
  color: var(--white);
}

.info-box-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--white);
}

.info-list {
  list-style: disc;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-list li {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--white);
}

.info-list li strong {
  font-weight: 700;
}

/* ── Final Quiz Layout ─────────────────────────────────────── */
.final-quiz-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  padding: 28px 90px 60px;
  flex: 1;
  justify-content: center;
}

.infographic-col {
  flex: 0 0 auto;
  max-width: 260px;
}

.cpr-infographic {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.final-questions-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 440px;
}

.final-quiz-card {
  max-width: 100%;
}

/* ── Complete Button (green checkmark + label, right edge) ─── */
.complete-btn-group {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.complete-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-btn);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.complete-btn svg {
  width: 38px;
  height: 38px;
  fill: var(--white);
}

.complete-btn:hover  { background: var(--green-hover); transform: scale(1.07); }
.complete-btn:active { transform: scale(0.95); }

.complete-label {
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  color: var(--black);
  letter-spacing: -0.01em;
}

/* ── Congratulations Screen ────────────────────────────────── */
.congrats-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.shield-icon {
  display: flex;
  justify-content: center;
  padding: 36px 0 28px;
}

.shield-icon img {
  width: 130px;
  height: 130px;
  object-fit: contain;
}

.congrats-banner {
  background: var(--teal-dark);
  width: 100%;
  padding: 30px 40px;
  text-align: center;
}

.congrats-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--white);
  white-space: nowrap;
}

.congrats-sub {
  background: var(--teal-lighter);
  width: 100%;
  padding: 22px 40px;
  text-align: center;
}

.congrats-message {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(14px, 1.8vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--black);
}

.restart-btn {
  margin-top: 36px;
  padding: 16px 56px;
  background: var(--btn-black);
  color: var(--white);
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}

.restart-btn:hover  { background: #333; }
.restart-btn:active { transform: scale(0.97); }

/* ── Failed Screen ─────────────────────────────────────────── */
.fail-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.fail-icon {
  display: flex;
  justify-content: center;
  padding: 36px 0 28px;
}

.fail-icon svg {
  width: 120px;
  height: 120px;
  fill: #b00020;
}

.fail-banner {
  background: #8b1a2a;
  width: 100%;
  padding: 30px 40px;
  text-align: center;
}

.fail-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(36px, 4.5vw, 72px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--white);
}

.fail-sub {
  background: #e8c5cb;
  width: 100%;
  padding: 22px 40px;
  text-align: center;
}

.fail-message {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(14px, 1.8vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--black);
}

.fail-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.secondary-btn {
  background: var(--teal-dark);
}

.secondary-btn:hover { background: var(--teal-mid); }

/* ── Scrollbar (subtle) ───────────────────────────────────── */
.screen::-webkit-scrollbar { width: 6px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: #b0c8d4; border-radius: 3px; }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 900px) {
  .final-quiz-layout {
    flex-direction: column;
    align-items: center;
    padding: 24px 40px 60px;
  }

  .infographic-col {
    max-width: 200px;
  }

  .final-questions-col {
    max-width: 100%;
    width: 100%;
  }

  .content-area {
    padding: 24px 40px 60px;
  }
}

@media (max-width: 600px) {
  .title-main  { font-size: 32px; white-space: normal; }
  .title-sub   { font-size: 18px; }
  .congrats-title { font-size: 32px; white-space: normal; }
  .nav-btn { width: 50px; height: 50px; }
  .nav-btn svg { width: 30px; height: 30px; }
  .complete-btn { width: 50px; height: 50px; }
  .complete-btn svg { width: 30px; height: 30px; }
  .content-area { padding: 20px 24px 60px; }
  .final-quiz-layout { padding: 20px 24px 60px; }
  .infographic-col { max-width: 160px; }
}
