/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&family=Raleway:wght@500;600&display=swap');

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

html, body {
  width: 100%; height: 100%;
  font-family: 'Raleway', sans-serif;
  background: #ffffff;
  color: #545c79;
}

/* ===== MODULE WRAPPER ===== */
#module-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  gap: 40px;
}

/* ===== HEADER / PROGRESS ===== */
/* Header lives outside the page animation layer — never fades */
.header {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  width: 100%;
  max-width: 1240px;
  flex-shrink: 0;
}

/* ===== PAGES CONTAINER ===== */
/* Wraps all .page sections; provides the relative positioning context for absolute pages */
#pages-container {
  position: relative;
  width: 100%;
  max-width: 1240px;
  flex: 1;
}

/* ===== PAGE ===== */
.page {
  display: flex;
  flex-direction: column;
  gap: 56px;
  width: 100%;
  /* hidden by default — opacity + pointer-events lets us animate */
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(18px);
  transition: opacity 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}
.page.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  transform: translateY(0);
}
.page.exit {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #5f7f8d;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 236px;
  flex-shrink: 0;
}
.progress-track {
  position: relative;
  flex: 1;
  height: 14px;
  margin-top: 0;
}
.progress-bg {
  width: 100%;
  height: 14px;
  background: #ffffff;
  border: 2px solid #d9e9ef;
  border-radius: 25px;
}
.progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 14px;
  background: #e4f0f5;
  border-radius: 25px;
  transition: width 0.5s ease;
}

/* ===== CARD ===== */
.card {
  background: #e4f0f5;
  border-radius: 20px;
  width: 100%;
  min-height: 614px;
  padding: 107px 105px;
  display: flex;
  align-items: flex-start;
  gap: 133px;
  position: relative;
}

/* Card centered layout (quiz/test questions) */
.card.card-center {
  align-items: center;
  justify-content: center;
}

/* ===== CARD CONTENT ===== */
.card-text {
  flex: 0 0 500px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.step-label {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #6d7491;
}

.card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 36px;
  line-height: 1.25;
  color: #232c50;
}

.card-body {
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 30px;
  color: #545c79;
}
.card-body p + p { margin-top: 11px; }
.card-body ul {
  list-style: disc;
  padding-left: 30px;
}
.card-body ul + p { margin-top: 11px; }
.card-body p + ul { margin-top: 11px; }

/* ===== CARD IMAGE ===== */
.card-image {
  flex-shrink: 0;
  width: 400px;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  object-fit: cover;
}
.card-image.sm {
  width: 274px;
  height: 274px;
}
.card-image.xs {
  width: 248px;
  height: 248px;
}
.card-image.bg-white {
  background: #ffffff;
}

/* ===== QUIZ / CENTERED CONTENT ===== */
.quiz-inner {
  width: 100%;
  max-width: 1006px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  align-items: center;
}

.question-label {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #6d7491;
  text-align: center;
}

.question-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 36px;
  line-height: 1.25;
  color: #232c50;
  text-align: center;
}

.question-spacer { height: 60px; }

/* ===== ANSWER OPTIONS ===== */
.answer-options {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.answer-btn {
  background: #ffffff;
  border: 2px solid #6d7491;
  border-radius: 12px;
  padding: 15px 35px;
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 30px;
  color: #6d7491;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.answer-btn:hover {
  background: #d9e9ef;
}
.answer-btn.selected {
  background: #5f7f8d;
  color: #ffffff;
  border-color: #5f7f8d;
}

/* ===== TEXT INPUT ANSWER ===== */
.answer-input-wrap {
  width: 100%;
  max-width: 1000px;
}
.answer-input {
  width: 100%;
  background: #ffffff;
  border: 2px solid #6d7491;
  border-radius: 12px;
  padding: 15px 35px;
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 30px;
  color: #545c79;
  outline: none;
  transition: border-color 0.2s;
}
.answer-input::placeholder {
  color: rgba(109,116,145,0.45);
}
.answer-input:focus {
  border-color: #5f7f8d;
}

/* ===== RESULT ICON ===== */
.result-icon {
  width: 176px;
  height: 176px;
  border-radius: 12px;
  object-fit: cover;
}
.result-icon.fail {
  width: 150px;
  height: 150px;
}

/* ===== NAV BUTTONS ===== */
.nav-buttons {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: flex-end;
}
.nav-buttons.center { justify-content: center; }

.btn {
  border-radius: 50px;
  padding: 15px 35px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 20px;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-return {
  border: 2px solid #d9e9ef;
  color: #5f7f8d;
}
.btn-return:hover { background: #e4f0f5; }

.btn-continue {
  border: 2px solid #6d7491;
  color: #6d7491;
}
.btn-continue:hover { background: #e4f0f5; }
.btn-continue:disabled,
.btn-continue.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-begin {
  border: 2px solid #6d7491;
  color: #232c50;
}
.btn-begin:hover { background: #e4f0f5; }

/* ===== CORRECT ANSWER HINT ===== */
.correct-hint {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #5f7f8d;
  text-align: center;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}
.correct-hint.visible {
  opacity: 1;
  max-height: 60px;
}

/* ===== ANSWER REQUIRED TOAST ===== */
#answer-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #232c50;
  color: #ffffff;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 18px;
  padding: 16px 36px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
}
#answer-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .card {
    flex-direction: column;
    padding: 50px 40px;
    gap: 40px;
  }
  .card-text { flex: unset; width: 100%; }
  .card-image, .card-image.sm, .card-image.xs {
    width: 100%; max-width: 400px; height: auto;
    margin: 0 auto; display: block;
  }
  .header-title { font-size: 16px; min-width: 160px; }
}

@media (max-width: 600px) {
  .card { padding: 30px 20px; }
  .card-title, .question-title { font-size: 26px; }
  .card-body, .step-label, .question-label { font-size: 16px; }
  .answer-btn, .btn { font-size: 16px; padding: 12px 20px; }
  .answer-options { flex-direction: column; }
}
