/* Online exam page only — do not merge into main.css */

.exam-page {
  position: relative;
}

.exam-page__question-card {
  position: relative;
  z-index: 1;
}

.exam-page__sidebar {
  position: relative;
  z-index: 2;
}

.exam-page__status-card {
  position: relative;
  z-index: 2;
}

.exam-page__status-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.exam-page__status-label,
.exam-page__status-time,
.exam-page__question-grid,
.exam-page__submit {
  position: relative;
  z-index: 1;
}

.exam-page__matching-marker {
  pointer-events: auto;
  cursor: pointer;
}

.exam-page--locked .exam-page__inner,
.exam-page--locked .exam-page__pager {
  pointer-events: none;
  user-select: none;
}

.exam-page--locked .sun-editor,
.exam-page--locked .sun-editor-editable {
  pointer-events: none !important;
}

.exam-page--locked [data-question-visual],
.exam-page--locked [data-question-options] {
  opacity: 0.72;
}

.exam-page__lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
}

.exam-page__lock-overlay[hidden] {
  display: none !important;
}

.exam-page__lock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 18rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.exam-page__lock-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: exam-page-lock-spin 0.8s linear infinite;
}

.exam-page__lock-message {
  color: #1e293b;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.exam-page__lock-overlay--duplicate-tab {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}

.exam-page__lock-overlay--duplicate-tab .exam-page__lock-spinner {
  display: none;
}

.exam-page__lock-overlay--duplicate-tab .exam-page__lock-panel {
  max-width: 24rem;
}

body.exam-lock-overlay-open {
  overflow: hidden;
}

.exam-page--locked .exam-page__workspace,
.exam-page--locked .exam-page__sidebar,
.exam-page--locked .exam-page__breadcrumb {
  pointer-events: none;
  user-select: none;
}

@keyframes exam-page-lock-spin {
  to {
    transform: rotate(360deg);
  }
}

.exam-submit-modal--expired .exam-submit-modal__button--cancel {
  display: none !important;
}

.exam-submit-modal__dialog {
  max-width: 42rem;
  width: calc(100% - 1.5rem);
  margin: 1rem auto;
}

.exam-submit-modal__content {
  border-radius: 1.5rem;
  box-shadow: 0 24px 56px rgba(40, 28, 22, 0.22);
  background: #fff;
}

.exam-submit-modal__hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 1.35rem 1.5rem 1.25rem;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, #f6ebff 0%, #f9eef7 42%, #fde8ef 100%);
  overflow: hidden;
}

.exam-submit-modal__hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #9b6cff, #7c3aed);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.28);
}

.exam-submit-modal__hero-copy {
  min-width: 0;
  padding-right: 0.25rem;
}

.exam-submit-modal__title {
  color: #6b1a2f;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
}

.exam-submit-modal__subtitle {
  margin-top: 0.35rem !important;
  color: #6b5f74;
  font-size: 0.86rem;
  line-height: 1.5;
}

.exam-submit-modal__hero-art {
  position: relative;
  width: 6.75rem;
  height: 5.1rem;
  margin-right: -0.15rem;
}

.exam-submit-modal__hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  filter: drop-shadow(0 8px 14px rgba(88, 50, 90, 0.14));
  pointer-events: none;
  user-select: none;
}

.exam-submit-modal__body {
  padding: 1.25rem 1.5rem 1.35rem;
}

.exam-submit-modal__section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem !important;
  color: #5c2434;
  font-size: 1rem;
  font-weight: 800;
}

.exam-submit-modal__section-title > i {
  color: #8b3a4a;
  font-size: 1.05rem;
}

.exam-submit-modal__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
  text-align: left;
}

.exam-submit-modal__field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  color: #5c2434;
  font-size: 0.86rem;
  font-weight: 700;
}

.exam-submit-modal__field strong {
  color: #c81d24;
  font-weight: 800;
}

.exam-submit-modal__optional {
  color: #9aa3b2;
  font-weight: 500;
}

.exam-submit-modal__control {
  position: relative;
  display: block;
}

.exam-submit-modal__control > i {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  transform: translateY(-50%);
  color: #9aa3b2;
  font-size: 0.95rem;
  pointer-events: none;
}

.exam-submit-modal__control input,
.exam-submit-modal__control select {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid #efc3c8;
  border-radius: 0.8rem;
  padding: 0.6rem 0.9rem 0.6rem 2.45rem;
  background: #fff;
  color: #1f2937;
  font-size: 0.94rem;
  font-weight: 500;
}

.exam-submit-modal__control select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa3b2' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

.exam-submit-modal__field--optional .exam-submit-modal__control input {
  border-color: #e5e7eb;
}

.exam-submit-modal__control input::placeholder {
  color: #b0b7c3;
}

.exam-submit-modal__control input:focus,
.exam-submit-modal__control select:focus {
  outline: 2px solid rgba(200, 29, 36, 0.12);
  border-color: #d4545c;
}

.exam-submit-modal__control input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

.exam-submit-modal__error {
  grid-column: 1 / -1;
  color: #c81d24;
  font-size: 0.84rem;
  font-weight: 650;
}

.exam-submit-modal__summary {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 0.95rem;
  background: #f6f2ff;
  border: 1px solid #ebe4fb;
}

.exam-submit-modal__summary-title {
  margin-bottom: 0.85rem !important;
  color: #5c2434;
  font-size: 1rem;
  font-weight: 800;
}

.exam-submit-modal__summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.exam-submit-modal__summary-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.exam-submit-modal__summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
}

.exam-submit-modal__summary-icon--help,
.exam-submit-modal__summary-icon--time {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}

.exam-submit-modal__summary-icon--done {
  color: #fff;
  background: #22c55e;
}

.exam-submit-modal__summary-label {
  display: block;
  color: #8b93a1;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
}

.exam-submit-modal__summary-value {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
}

.exam-submit-modal__summary-value--primary {
  color: #5b2440;
}

.exam-submit-modal__summary-value--success {
  color: #16a34a;
}

.exam-submit-modal__actions {
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.exam-submit-modal__button {
  flex: 1 1 0;
  min-height: 2.9rem;
  border-radius: 0.75rem;
  font-size: 0.98rem;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.exam-submit-modal__button--cancel {
  border: 1.5px solid #8b1a1a;
  background: #fff;
  color: #8b1a1a;
}

.exam-submit-modal__button--cancel:hover {
  background: #fff5f5;
}

.exam-submit-modal__button--confirm {
  border: 1.5px solid #8b1a1a;
  background: #8b1a1a;
  color: #fff;
}

.exam-submit-modal__button--confirm:hover {
  background: #751616;
  border-color: #751616;
}

.exam-submit-modal__check {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.exam-submit-modal__privacy {
  margin-top: 0.95rem !important;
  color: #9aa3b2;
  font-size: 0.78rem;
  line-height: 1.45;
}

.exam-submit-modal__privacy i {
  margin-right: 0.3rem;
  color: #b0b7c3;
}

@media (max-width: 640px) {
  .exam-submit-modal__hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 1.15rem 1.15rem 1.05rem;
  }

  .exam-submit-modal__hero-art {
    display: none;
  }

  .exam-submit-modal__body {
    padding: 1.1rem 1.15rem 1.2rem;
  }

  .exam-submit-modal__form,
  .exam-submit-modal__summary-grid {
    grid-template-columns: 1fr;
  }

  .exam-submit-modal__actions {
    flex-direction: column;
  }
}

.exam-page__visual--audio-choice {
  gap: 1.5rem;
  margin-top: 1rem;
  padding-bottom: 0.35rem;
}

.exam-page__audio-picture {
  min-height: 4.5rem;
  font-size: 4rem;
}

.exam-page__audio-word {
  color: #161616;
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: none;
  text-transform: none;
}

.exam-page__options--audio {
  max-width: 30rem;
  margin-top: 1.15rem;
  gap: 1.1rem;
}

.exam-page__audio-option {
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.85rem;
  justify-content: stretch;
  align-items: center;
  width: 100%;
}

.exam-page__audio-select {
  grid-template-columns: 1.45rem 2rem minmax(0, 1fr);
  column-gap: 0.65rem;
  min-width: 0;
}

.exam-page__audio-option-key {
  overflow-wrap: anywhere;
}

.exam-page__audio-button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}


/* Image choice: 2 columns (single or multiple select) */
.exam-page__options--image-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  align-items: stretch;
}

.exam-page__image-option {
  min-height: 0;
  align-items: start;
}

.exam-page__image-option-visual {
  width: 100%;
  height: 9.5rem;
  min-height: 9.5rem;
  max-height: 9.5rem;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  box-sizing: border-box;
  color: #334155;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: pre-line;
}

.exam-page__image-option-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Animal / emoji choice — match image option card size */
.exam-page__animal-grid {
  gap: 1.5rem 2rem;
  align-items: stretch;
}

.exam-page__animal-option {
  min-height: 0;
  align-items: start;
}

.exam-page__animal-figure {
  width: 100%;
  height: 9.5rem;
  min-height: 9.5rem;
  max-height: 9.5rem;
  place-items: center;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  box-sizing: border-box;
  font-size: 4.5rem;
  line-height: 1;
  filter: saturate(1.05);
}

.exam-page__question-image {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

@media (max-width: 640px) {
  .exam-page__audio-picture {
    min-height: 4rem;
    font-size: 3.5rem;
  }

  .exam-page__audio-word {
    font-size: 1.35rem;
  }

  .exam-page__options--audio {
    max-width: none;
  }

  .exam-page__options--image-choice {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .exam-page__image-option-visual {
    height: 8rem;
    min-height: 8rem;
    max-height: 8rem;
  }

  .exam-page__animal-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .exam-page__animal-figure {
    height: 8rem;
    min-height: 8rem;
    max-height: 8rem;
    font-size: 3.5rem;
  }
}

/* Multi-select: square checkbox instead of round radio */
.exam-page__option-radio--checkbox {
  border-radius: 0.28rem;
}

.exam-page__option-radio--checkbox::after {
  inset: 0;
  border-radius: 0.15rem;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2L6.4 11.1L12.5 4.9' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 78% 78%;
}

.exam-page__option-input:checked + .exam-page__option-radio--checkbox {
  border-color: #5488f8;
  background: #5488f8;
}

.exam-page__option-input:checked + .exam-page__option-radio--checkbox::after {
  transform: scale(1);
}
