/* ═══════════════════════════════════════════════════════
   EpiPen Administration Module — Design System
   Target: 1920 × 1080 desktop, single-page JS app
═══════════════════════════════════════════════════════ */

/* ── Reset & base ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 17px;
  color: #1B1919;
  background-color: #ABCBDF;
}

/* ── Screen 1 welcome bullet list ───────────────────── */
#screen-1 ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
}

#screen-1 ul li {
  padding: 6px 0 6px 22px;
  position: relative;
  line-height: 1.5;
}

#screen-1 ul li::before {
  content: '•';
  position: absolute;
  left: 0;
}

/* ── Screen system ───────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.screen.active {
  display: flex;
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: #F2F2F2;
  border-radius: 20px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.14);
  padding: 56px 80px 48px;
  width: 1520px;
  height: 840px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.card--drag {
  width: 1520px;
  height: 840px;
}

.card--completion {
  width: 1520px;
  height: 840px;
  text-align: center;
  justify-content: center;
  gap: 0;
}

/* ── Split layout (text left, image/video right) ─────── */
.split-layout {
  display: flex;
  gap: 80px;
  align-items: center;
  margin-bottom: 24px;
}

.split-layout--top {
  align-items: flex-start;
}

/* Screen 1: stretch children so split-text fills image height */
.split-layout--stretch {
  align-items: stretch;
}

.split-text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.split-image {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Screen 1 — Get Started button pushed to bottom of text column */
.s1-action {
  margin-top: auto;
  padding-top: 36px;
  display: flex;
  justify-content: center;
}

/* ── Images ──────────────────────────────────────────── */
/* Default — quiz screens 5, 6, 7 */
.card-img {
  width: 280px;
  height: 360px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: #c8dde8;
}

/* Screen 1 — tall portrait to fill card height */
.card-img--welcome {
  width: 360px;
  height: 660px;
}

/* Screen 4 — quiz intro portrait */
.card-img--intro {
  width: 300px;
  height: 420px;
}

/* ── YouTube embed ───────────────────────────────────── */
.video-embed {
  width: 580px;
  height: 326px;
  border-radius: 10px;
  display: block;
}

/* ── Typography ──────────────────────────────────────── */
h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1B1919;
}

h2.screen-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: #1B1919;
}

h2.screen-title--left {
  text-align: left;
  margin-bottom: 20px;
}

p {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.footnote {
  font-size: 16px;
  margin-top: 20px;
  color: #1B1919;
}

/* ── Symptom screen ──────────────────────────────────── */
.two-col-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 80px;
  margin-bottom: 28px;
}

.two-col-list ul {
  list-style: none;
  padding: 0;
}

.two-col-list ul li {
  padding: 8px 0 8px 22px;
  position: relative;
  line-height: 1.5;
  font-size: 17px;
}

.two-col-list ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #1B1919;
}

.symptom-note {
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
  font-size: 17px;
}

.mnemonic {
  color: #567CA8;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  font-size: 18px;
}

/* ── Video/Admin screen ──────────────────────────────── */
.steps-list {
  padding-left: 22px;
  margin-bottom: 24px;
}

.steps-list li {
  margin-bottom: 14px;
  line-height: 1.5;
  font-size: 17px;
}

.warning-text {
  margin-bottom: 20px;
  line-height: 1.6;
  font-size: 17px;
}

/* ── Progress bar ────────────────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  margin-bottom: 20px;
}

.progress-track {
  position: relative;
  height: 12px;
  background: #C8C8C8;
  border-radius: 6px;
}

.progress-fill {
  height: 100%;
  background: #4C9E5F;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #4C9E5F;
  border-radius: 50%;
  transition: left 0.3s ease;
}

.progress-label {
  font-size: 16px;
  color: #333;
  margin-top: 8px;
}

/* ── MCQ options ─────────────────────────────────────── */
.question-text {
  font-size: 20px;
  margin-bottom: 22px;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1.4;
}

.option input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #567CA8;
}

/* ── Check Answer button row ─────────────────────────── */
.check-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

/* ── Feedback messages ───────────────────────────────── */
.feedback {
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
}

.feedback.hidden {
  display: none;
}

.feedback-correct {
  background: #D4EDDA;
  border-left: 4px solid #4CAF50;
  color: #2E6B3E;
  display: block;
}

.feedback-incorrect {
  background: #F8D7DA;
  border-left: 4px solid #E53935;
  color: #7B1C1C;
  display: block;
}

@keyframes feedback-flash {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

.feedback-flash {
  animation: feedback-flash 0.5s ease-in-out;
}

/* ── Drag & Drop screen ──────────────────────────────── */
.drag-subtitle {
  text-align: center;
  margin-bottom: 22px;
  font-size: 18px;
}

.drag-container {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
  flex: 1 1 auto;
  min-height: 0;
}

.drag-zone-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.drag-zone-label {
  font-size: 15px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
  text-align: center;
}

.source-zone,
.drop-zone {
  flex: 1 1 auto;
  min-height: 320px;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-zone {
  background: #8A9DAB;
}

.drop-zone {
  border: 2px dashed #AAAAAA;
  background: #E8E8E8;
}

.drag-item {
  background: #7B8FA0;
  color: #FFFFFF;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 16px;
  cursor: grab;
  user-select: none;
  line-height: 1.4;
  transition: opacity 0.15s, transform 0.1s;
}

.drag-item:active,
.drag-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.drag-item.drag-over {
  transform: translateY(2px);
}

.drag-check-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Completion screen ───────────────────────────────── */
.completion-title {
  font-size: 44px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.completion-subtitle {
  font-size: 21px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 40px;
}

.completion-body {
  text-align: left;
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 17px;
}

.completion-body ul {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}

.completion-body ul li {
  padding: 4px 0 4px 18px;
  position: relative;
}

.completion-body ul li::before {
  content: '•';
  position: absolute;
  left: 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  font-size: 17px;
  font-weight: 500;
  padding: 11px 40px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-primary {
  background: #567CA8;
  color: #FFFFFF;
}

.btn-secondary {
  background: #767F89;
  color: #FFFFFF;
}

.btn-check {
  background: #567CA8;
  color: #FFFFFF;
  padding: 10px 28px;
  font-size: 16px;
}

.btn-disabled,
.btn:disabled {
  background: #BBBBBB !important;
  color: #777777 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

/* ── Button rows ─────────────────────────────────────── */
.btn-row {
  display: flex;
  margin-top: auto;
  padding-top: 28px;
}

.btn-center {
  justify-content: center;
}

.btn-split {
  justify-content: space-between;
}

/* ── Reflection screen (screen 4) ───────────────────── */
.card--reflect {
  justify-content: flex-start;
}

.reflect-question {
  font-size: 19px;
  line-height: 1.6;
  margin-bottom: 4px;
  color: #1B1919;
}

.reflect-question + .reflect-textarea {
  margin-top: 28px;
}

.reflect-textarea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 220px;
  background: rgba(110, 130, 150, 0.32);
  border: none;
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 17px;
  font-family: inherit;
  color: #1B1919;
  resize: none;
  outline: none;
  margin-top: 28px;
  margin-bottom: 20px;
}

.reflect-textarea::placeholder {
  color: rgba(27, 25, 25, 0.45);
}

.reflect-submit-row {
  display: flex;
  justify-content: center;
  padding-bottom: 4px;
}

#reflect-submit-btn {
  background: #567CA8;
  color: #ffffff;
  transition: background 0.2s, opacity 0.2s;
}

#reflect-submit-btn:hover:not(:disabled) {
  background: #3f6090;
  opacity: 1;
}

#reflect-submit-btn.submitted {
  background: #4a8c5c;
}

#reflect-submit-btn.submitted:hover:not(:disabled) {
  background: #3a7049;
  opacity: 1;
}

.reflect-error {
  text-align: center;
  color: #c0392b;
  font-size: 15px;
  font-weight: 500;
  margin-top: 8px;
  min-height: 1.4em;
}

/* ═══════════════════════════════════════════════════════
   Mobile / Tablet — max-width: 768px
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Kill forced full-viewport height & background ─ */
  html, body {
    min-height: unset;
    height: auto;
    background-color: transparent;
  }

  /* ── Screen wrapper — carries the blue background ── */
  .screen {
    background-color: #ABCBDF;
    padding: 16px 12px;
    justify-content: flex-start;
    min-height: unset;
    height: auto;
  }

  /* ── Card ────────────────────────────────────────── */
  .card,
  .card--drag,
  .card--completion {
    width: 100%;
    height: auto;
    padding: 24px 18px 20px;
    border-radius: 14px;
  }

  /* ── Split layouts → vertical stack ─────────────── */
  .split-layout,
  .split-layout--top,
  .split-layout--stretch {
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
  }

  /* Screen 1 — image on top, text below */
  #screen-1 .split-layout {
    flex-direction: column-reverse;
  }

  .split-text {
    width: 100%;
  }

  .split-image {
    width: 100%;
    justify-content: center;
  }

  /* Screen 1 — action button no longer needs auto margin */
  .s1-action {
    margin-top: 20px;
    padding-top: 0;
  }

  /* ── Images ──────────────────────────────────────── */
  .card-img,
  .card-img--welcome,
  .card-img--intro {
    width: 180px;
    height: 150px;
    border-radius: 10px;
  }

  /* Hide quiz images on mobile — give full width to questions */
  #screen-6 .split-image,
  #screen-7 .split-image,
  #screen-8 .split-image {
    display: none;
  }

  /* Make split-text full width when image is hidden */
  #screen-6 .split-text,
  #screen-7 .split-text,
  #screen-8 .split-text {
    width: 100%;
    flex: 1 1 auto;
  }

  /* ── Video ───────────────────────────────────────── */
  .video-embed {
    width: 100%;
    height: 200px;
    border-radius: 8px;
  }

  /* ── Typography ──────────────────────────────────── */
  h1 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  h2.screen-title {
    font-size: 20px;
    margin-bottom: 14px;
  }

  p {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .footnote {
    font-size: 13px;
    margin-top: 12px;
  }

  #screen-1 ul li {
    font-size: 14px;
    padding: 4px 0 4px 18px;
  }

  /* ── Symptoms screen ─────────────────────────────── */
  .two-col-list {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 14px;
  }

  .two-col-list ul li {
    font-size: 14px;
    padding: 4px 0 4px 18px;
  }

  .symptom-note {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .mnemonic {
    font-size: 14px;
    margin-bottom: 14px;
  }

  /* ── Video screen ────────────────────────────────── */
  .steps-list {
    padding-left: 18px;
    margin-bottom: 14px;
  }

  .steps-list li {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .warning-text {
    font-size: 14px;
    margin-bottom: 12px;
  }

  /* ── Progress bar ────────────────────────────────── */
  .progress-bar-wrap {
    width: 100%;
    margin-bottom: 10px;
  }

  .progress-track {
    height: 8px;
    border-radius: 4px;
  }

  .progress-dot {
    width: 18px;
    height: 18px;
  }

  .progress-label {
    font-size: 13px;
    margin-top: 5px;
  }

  /* ── MCQ ─────────────────────────────────────────── */
  .question-text {
    font-size: 15px;
    margin-bottom: 16px;
    line-height: 1.5;
  }

  .options {
    gap: 10px;
    margin-bottom: 16px;
  }

  .option {
    font-size: 14px;
    gap: 10px;
  }

  .option input[type="radio"] {
    width: 16px;
    height: 16px;
  }

  .check-row {
    gap: 10px;
    margin-bottom: 10px;
  }

  .feedback {
    font-size: 13px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  /* ── Drag & Drop ─────────────────────────────────── */
  .drag-subtitle {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .drag-container {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 14px;
    flex: none;
  }

  .drag-zone-col {
    width: 100%;
    flex: none;
  }

  .drag-zone-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: left;
  }

  .source-zone,
  .drop-zone {
    flex: none;
    height: auto;
    min-height: 60px;
    width: 100%;
    padding: 12px;
    gap: 8px;
  }

  .drop-zone {
    min-height: 120px;
  }

  .drag-item {
    font-size: 13px;
    padding: 10px 12px;
  }

  .drag-check-row {
    gap: 10px;
    margin-bottom: 12px;
  }

  /* ── Reflection screen ───────────────────────────── */
  .reflect-question {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .reflect-textarea {
    min-height: 160px;
    font-size: 14px;
    padding: 14px 16px;
    margin-top: 18px;
    margin-bottom: 14px;
  }

  .reflect-submit-row {
    padding-bottom: 2px;
  }

  #reflect-submit-btn {
    padding: 10px 32px;
    font-size: 14px;
  }

  .reflect-error {
    font-size: 13px;
    margin-top: 6px;
  }

  /* ── Completion ──────────────────────────────────── */
  .completion-title {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .completion-subtitle {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .completion-body {
    font-size: 14px;
    max-width: 100%;
    margin: 0 auto 20px;
  }

  /* ── Buttons ─────────────────────────────────────── */
  .btn {
    font-size: 14px;
    padding: 10px 22px;
  }

  .btn-check {
    font-size: 13px;
    padding: 9px 18px;
  }

  .btn-row {
    padding-top: 16px;
  }

}
