/*
  Quiz redesign (redesign.html). Loaded after style.css; only overrides what the task changes.
  Stays in the live look: same colours, Poppins, radii and button shapes.
*/

/* ---------- Header: title left, actions right, so Previous / Next fit beside Submit ---------- */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px 0 24px;
}
.header-title {
  min-width: 0;
  text-align: left;
}
.header-title span {
  max-width: 100%;
}
.header-actions {
  position: static;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.nav-group {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}
/* Secondary style so Submit stays the main action */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #fff;
  border-radius: 16px;
  background: #fff;
  color: var(--blue-first);
  font: 700 14px/24px var(--font-poppins);
}
.btn-nav .fe {
  font-size: 18px;
}
.btn-nav:hover:not(:disabled) {
  background: var(--blue-5th);
  border-color: var(--blue-5th);
}
.btn-nav:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn-nav:focus-visible,
.btn-primary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- "Finish all questions first" popup ---------- */
.left-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}
/* Number chips in the sidebar's unanswered circle style (grey), blue on hover like the active circle */
.left-list {
  max-width: 340px;
  margin-inline: auto;
}
.left-chip {
  width: 37px;
  height: 37px;
  padding: 0;
  border: 2px solid var(--gray-rd);
  border-radius: 50%;
  background: #fff;
  color: var(--gray-nd);
  font: 400 16px/33px var(--font-poppins);
}
.left-chip:hover,
.left-chip:focus-visible {
  border-color: var(--blue-first);
  background: var(--blue-first);
  color: #fff;
  outline: none;
}
.left-more {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--gray-nd);
  font: 700 14px/37px var(--font-poppins);
}
/* ---------- Prototype switch (stands in for the admin setting) ---------- */
.proto-switch__row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.proto-switch__samples {
  margin-top: 6px;
  padding-left: 46px;
}
.proto-switch__samples a {
  color: var(--blue-first);
}
.proto-switch__samples a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.proto-switch {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px dashed var(--gray-first);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.09);
  color: var(--gray-nd);
  font: 400 13px/18px var(--font-poppins);
  cursor: pointer;
}
.proto-switch input {
  position: absolute;
  opacity: 0;
}
.proto-switch__track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--gray-rd);
  transition: background 0.2s;
}
.proto-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.proto-switch input:checked + .proto-switch__track {
  background: var(--blue-first);
}
.proto-switch input:checked + .proto-switch__track::after {
  transform: translateX(16px);
}
.proto-switch input:focus-visible + .proto-switch__track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Mobile ----------
   A 375 px header only fits the title, Save & Exit and Submit (as live). Previous / Next move
   to the bottom bar instead, in the place of live's yellow arrows, and keep their text labels. */
@media (max-width: 767px) {
  .quiz-header {
    gap: 8px;
    padding: 0 8px 0 12px;
  }
  .header-actions {
    gap: 3px;
  }
  .nav-group {
    display: none;
  }
  .option li {
    padding-inline: 2px;
  }
  .marrow button {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: auto;
    padding: 0 8px;
    font: 700 13px/1 var(--font-poppins);
  }
  .marrow .fe {
    font-size: 18px;
  }

  /* Prototype switch: compact strip above the bottom bar */
  .proto-switch {
    right: 8px;
    bottom: 68px;
    left: 8px;
    max-width: none;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 15px;
  }
  .proto-switch__samples {
    margin-top: 2px;
    padding-left: 46px;
  }
  .question-content {
    padding-bottom: 150px;
  }
  .left-list {
    gap: 6px;
  }
}

/* ---------- Option B (?nav=progress): Previous / Next in the progress row, after the timer ----------
   The header goes back to live (centred title, buttons on the right). Desktop only;
   on a phone both options use the bottom bar. */
@media (min-width: 768px) {
  [data-nav="progress"] .quiz-header {
    display: block;
    padding: 0;
  }
  [data-nav="progress"] .header-title {
    padding: 15px 0;
    text-align: center;
  }
  [data-nav="progress"] .header-title span {
    max-width: 700px;
  }
  [data-nav="progress"] .header-actions {
    position: absolute;
    gap: 3px;
    padding: 10px 32px 10px 20px;
  }
  [data-nav="progress"] .protime {
    gap: 12px;
  }
  /* The timer no longer touches the right edge, so it gets all four corners rounded */
  [data-nav="progress"] .times {
    padding-right: 0;
    overflow: hidden;
    border-radius: 8px;
  }
  [data-nav="progress"] .nav-group {
    align-items: center;
    height: 38px;
    margin: 4px 24px 0 0;
  }
  /* On the white row the buttons take a blue outline instead of the white fill */
  [data-nav="progress"] .btn-nav {
    padding: 6px 16px;
    border-color: var(--blue-first);
  }
}
