/* Premium submission and result layer. Scoped to the examination system only. */
body.mrph-exam-modal-open {
  overflow: hidden !important;
}

.mrph-exam-submit-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}

.mrph-exam-submit-modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.mrph-exam-submit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 14, 24, .76);
  backdrop-filter: blur(12px) saturate(.82);
  -webkit-backdrop-filter: blur(12px) saturate(.82);
}

.mrph-exam-submit-card {
  --submit-ink: #10263a;
  --submit-muted: #667d90;
  --submit-line: rgba(19, 102, 121, .14);
  --submit-cyan: #31cdd8;
  --submit-teal: #087582;
  position: relative;
  width: min(100%, 690px);
  max-height: min(90dvh, 780px);
  overflow: auto;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(142, 229, 235, .28);
  border-radius: 30px;
  color: var(--submit-ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(49, 205, 216, .13), transparent 15rem),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(246,251,252,.98));
  box-shadow: 0 38px 100px rgba(0, 14, 27, .40);
  transform: translateY(18px) scale(.975);
  transition: transform .24s cubic-bezier(.22,.8,.24,1);
}

.mrph-exam-submit-modal.is-visible .mrph-exam-submit-card {
  transform: translateY(0) scale(1);
}

.mrph-exam-submit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(8,117,130,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,117,130,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(160deg,#000,transparent 70%);
}

.mrph-exam-submit-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  border: 1px solid rgba(49,205,216,.28);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, #052437, #0c7d89);
  box-shadow: 0 18px 36px rgba(7,117,130,.20);
}

.mrph-exam-submit-emblem::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
}

.mrph-exam-submit-emblem span {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 900;
}

.mrph-exam-submit-heading {
  position: relative;
}

.mrph-exam-submit-heading small,
.mrph-result-report-header small {
  display: block;
  margin-bottom: 8px;
  color: var(--submit-teal, #087582);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.mrph-exam-submit-heading h2 {
  margin: 0;
  color: var(--submit-ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.035em;
}

[dir="rtl"] .mrph-exam-submit-heading h2 {
  letter-spacing: -.015em;
  line-height: 1.25;
}

.mrph-exam-submit-heading p {
  max-width: 590px;
  margin: 12px 0 0;
  color: var(--submit-muted);
  font-size: 14px;
  line-height: 1.75;
}

.mrph-exam-submit-exam-title {
  position: relative;
  margin-top: 20px;
  padding: 15px 17px;
  border: 1px solid var(--submit-line);
  border-radius: 15px;
  color: var(--submit-ink);
  background: rgba(255,255,255,.76);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.mrph-exam-submit-summary {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.mrph-exam-submit-summary > div {
  min-width: 0;
  padding: 15px 13px;
  border: 1px solid var(--submit-line);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
}

.mrph-exam-submit-summary b {
  display: block;
  color: var(--submit-ink);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.mrph-exam-submit-summary span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--submit-muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.mrph-exam-submit-summary .is-answered {
  border-color: rgba(40,198,213,.22);
  background: linear-gradient(145deg, rgba(40,198,213,.12), rgba(255,255,255,.92));
}

.mrph-exam-submit-summary .is-unanswered {
  border-color: rgba(226,103,111,.20);
  background: linear-gradient(145deg, rgba(226,103,111,.08), rgba(255,255,255,.92));
}

.mrph-exam-submit-summary .is-review {
  border-color: rgba(240,175,72,.24);
  background: linear-gradient(145deg, rgba(240,175,72,.10), rgba(255,255,255,.92));
}

.mrph-exam-submit-warning {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr);
  gap: 12px;
  align-items: start;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(240,175,72,.26);
  border-radius: 16px;
  background: rgba(255,248,233,.88);
}

.mrph-exam-submit-warning > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #8b5b13;
  background: rgba(240,175,72,.20);
  font-weight: 900;
}

.mrph-exam-submit-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #70460b;
  font-size: 12px;
  font-weight: 900;
}

.mrph-exam-submit-warning p {
  margin: 0;
  color: #846637;
  font-size: 11px;
  line-height: 1.6;
}

.mrph-exam-submit-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.mrph-exam-submit-actions .mrph-exam-primary,
.mrph-exam-submit-actions .mrph-exam-secondary {
  min-height: 48px;
  padding-inline: 20px;
}

.mrph-exam-submit-confirm {
  min-width: 190px;
}

/* Premium result report */
.mrph-exam-result[data-mrph-premium-result="1"] {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mrph-result-report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(17,91,111,.13);
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 16px 44px rgba(7,48,66,.07);
}

.mrph-result-report-header h2 {
  margin: 0;
  color: #10263a;
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.03em;
}

[dir="rtl"] .mrph-result-report-header h2 {
  letter-spacing: -.01em;
}

.mrph-result-report-header p {
  margin: 8px 0 0;
  color: #667d90;
  font-size: 12px;
}

.mrph-result-grade {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(49,205,216,.25);
  border-radius: 999px;
  color: #075e68;
  background: rgba(49,205,216,.10);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-result-hero {
  overflow: hidden;
  border: 1px solid rgba(115,226,233,.16);
  border-radius: 26px;
  box-shadow: 0 25px 70px rgba(3,35,52,.17);
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-result-stats {
  display: none;
}

.mrph-result-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 10px;
  margin: 14px 0;
}

.mrph-result-summary-grid article {
  min-width: 0;
  padding: 17px 15px;
  border: 1px solid rgba(17,91,111,.13);
  border-radius: 17px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 12px 32px rgba(7,48,66,.055);
}

.mrph-result-summary-grid span,
.mrph-result-summary-grid small {
  display: block;
  color: #6b8092;
  font-size: 10px;
  line-height: 1.35;
}

.mrph-result-summary-grid strong {
  display: block;
  margin: 5px 0 3px;
  color: #10263a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mrph-result-summary-grid .is-score {
  border-color: rgba(49,205,216,.30);
  background: linear-gradient(145deg, rgba(49,205,216,.16), rgba(255,255,255,.96));
}

.mrph-result-summary-grid .is-correct {
  border-color: rgba(48,185,149,.22);
  background: linear-gradient(145deg, rgba(48,185,149,.10), rgba(255,255,255,.96));
}

.mrph-result-summary-grid .is-incorrect {
  border-color: rgba(226,103,111,.20);
  background: linear-gradient(145deg, rgba(226,103,111,.09), rgba(255,255,255,.96));
}

.mrph-result-summary-grid .is-unanswered {
  border-color: rgba(240,175,72,.22);
  background: linear-gradient(145deg, rgba(240,175,72,.09), rgba(255,255,255,.96));
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review {
  border: 1px solid rgba(17,91,111,.13);
  border-radius: 24px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 18px 50px rgba(7,48,66,.07);
}

.mrph-result-review-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(17,91,111,.10);
}

.mrph-result-review-tools button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(17,91,111,.13);
  border-radius: 999px;
  color: #667d90;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.mrph-result-review-tools button b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: #476071;
  background: #eef5f7;
  font-size: 10px;
}

.mrph-result-review-tools button.active {
  color: #fff;
  border-color: #087582;
  background: linear-gradient(135deg, #075d6b, #0b8992);
  box-shadow: 0 10px 24px rgba(7,117,130,.16);
}

.mrph-result-review-tools button.active b {
  color: #075d6b;
  background: #d7f5f5;
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-list {
  gap: 12px;
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-item {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfdfe);
  box-shadow: 0 8px 24px rgba(7,48,66,.045);
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-item[hidden] {
  display: none !important;
}

.mrph-exam-review-item.unanswered {
  border-inline-start: 4px solid #f0af48 !important;
}

.mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-item h4 {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.mrph-result-question-index {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: #087582;
  background: rgba(40,198,213,.10);
  font-size: 10px;
  font-weight: 900;
}

.mrph-result-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.mrph-result-status.is-correct {
  color: #18765f;
  background: rgba(48,185,149,.12);
}

.mrph-result-status.is-incorrect {
  color: #a33f48;
  background: rgba(226,103,111,.12);
}

.mrph-result-status.is-unanswered {
  color: #8a5b16;
  background: rgba(240,175,72,.15);
}

.mrph-result-answer-row {
  padding: 11px 13px;
  border: 1px solid rgba(17,91,111,.10);
  border-radius: 12px;
  background: #f8fbfc;
  font-size: 12px !important;
  line-height: 1.55;
}

.mrph-result-answer-row.is-correct-answer,
.mrph-result-answer-row.is-verified {
  color: #356c5f !important;
  border-color: rgba(48,185,149,.18);
  background: rgba(48,185,149,.07);
}

.mrph-result-answer-row.is-candidate {
  color: #596f80 !important;
}

@media (max-width: 1120px) {
  .mrph-result-summary-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .mrph-exam-submit-modal {
    padding: 14px;
  }

  .mrph-exam-submit-card {
    border-radius: 24px;
  }

  .mrph-exam-submit-summary {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .mrph-exam-submit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mrph-exam-submit-actions button,
  .mrph-exam-submit-confirm {
    width: 100%;
  }

  .mrph-result-report-header {
    display: block;
  }

  .mrph-result-grade {
    margin-top: 14px;
  }

  .mrph-result-summary-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mrph-exam-result[data-mrph-premium-result="1"] .mrph-exam-review-item h4 {
    grid-template-columns: auto minmax(0,1fr);
  }

  .mrph-result-status {
    grid-column: 1 / -1;
    width: max-content;
  }
}

@media (max-width: 440px) {
  .mrph-result-summary-grid {
    grid-template-columns: 1fr;
  }

  .mrph-result-review-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .mrph-result-review-tools button {
    justify-content: space-between;
  }
}
