body.test-page {
  background: #f8fafc;
}

.test-hero {
  background-color: #f8fafc;
  background-image: url("../img/backgraund/test.png");
  background-position: center right;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 1px solid #e5e7eb;
  padding: 76px 0 56px;
  position: relative;
}

.test-hero::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.test-hero-grid,
.exam-hero-grid {
  align-items: stretch;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.test-hero-grid {
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.exam-hero-grid {
  grid-template-columns: minmax(0, 1fr);
}

.test-hero-copy,
.exam-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
}

.test-hero h1,
.exam-hero h1 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 56px;
  font-weight: 900;
  line-height: 1.06;
  max-width: 820px;
}

.test-hero p,
.exam-hero p {
  color: #4b5563;
  font-size: 19px;
  line-height: 31px;
  margin-top: 24px;
  max-width: 680px;
}

.test-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.test-catalog {
  background: #f8fafc;
  padding: 72px 0 80px;
}

.test-section-head {
  margin: 0 auto 42px;
  max-width: 860px;
  text-align: center;
}

.test-section-head h2,
.theory-heading h2 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 42px;
  font-weight: 900;
  line-height: 48px;
}

.test-section-head p {
  color: #6b7280;
  font-size: 16px;
  line-height: 25px;
  margin: 16px auto 0;
  max-width: 700px;
}

.test-section-head h2 {
  text-wrap: balance;
}

.tests-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.test-card-link {
  align-items: center;
  aspect-ratio: 1;
  background: #ffffff;
  background-image: url("../img/test/image-cards/11.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid #dfe5ed;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px;
  text-align: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.test-card-link:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(15, 35, 65, 0.08);
  transform: translateY(-3px);
}

.test-card-link:active {
  transform: translateY(0) scale(0.985);
}

.test-card-link strong {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.12;
}

.test-card-link small {
  color: var(--navy);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 800;
  line-height: 1.3;
  margin-top: 8px;
}

.test-card-link em {
  align-items: center;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 1px;
  justify-content: center;
  line-height: 18px;
  margin-top: 22px;
  min-height: 44px;
  text-transform: uppercase;
  transition: background-color 0.16s ease, color 0.16s ease;
  width: 100%;
}

.test-card-link:hover em {
  background: var(--navy);
  color: #ffffff;
}

.theory-course {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 80px 0;
}

.theory-layout {
  display: block;
}

.theory-heading {
  margin-bottom: 28px;
  max-width: 760px;
}

.theory-heading h2 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 38px;
  font-weight: 900;
  line-height: 1.12;
}

.theory-heading p {
  color: #6b7280;
  font-size: 16px;
  line-height: 25px;
  margin-top: 10px;
}

.exam-help-link {
  align-items: center;
  background: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 12px;
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.8px;
  line-height: 18px;
  margin-top: 28px;
  min-height: 50px;
  padding: 13px 18px;
  text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.exam-help-link:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--navy);
  transform: translateY(-1px);
}

.exam-help-link:active {
  transform: translateY(1px) scale(0.99);
}

.theory-list {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.theory-topic {
  background: #f7f8fa;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  position: relative;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.theory-topic:hover {
  background: #f1f3f6;
  transform: translateY(-2px);
}

.theory-topic-number {
  background: var(--navy);
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 16px;
  margin: 0 0 9px;
  padding: 4px 7px;
  width: fit-content;
}

.theory-topic-image {
  aspect-ratio: 1 / 1;
  background: #eef2f6;
  display: block;
  flex: 0 0 auto;
  margin-bottom: 16px;
  object-fit: cover;
  width: 100%;
}

.theory-topic strong {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 21px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.theory-topic-action {
  align-items: center;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.7px;
  margin-top: auto;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.theory-topic:hover .theory-topic-action {
  background: var(--navy);
  color: #ffffff;
}

.exam-hero {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 64px 0 48px;
}

.exam-back-link {
  color: #6b7280;
  font-size: 14px;
  font-weight: 800;
  line-height: 20px;
  margin-bottom: 24px;
  width: fit-content;
}

.exam-back-link:hover {
  color: var(--gold);
}

.exam-workspace {
  background: #f8fafc;
  padding: 56px 0 80px;
}

.exam-layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.exam-card,
.exam-side-card {
  background: #ffffff;
  border: 1px solid #dfe5ed;
  border-radius: 18px;
  box-shadow: 0 18px 34px -30px rgba(11, 31, 58, 0.45);
}

.exam-card {
  padding: 32px;
}

body.exam-finished .exam-card,
body.exam-finished .exam-sidebar {
  display: none;
}

.exam-result-card[hidden] {
  display: none;
}

.exam-result-card {
  background: #ffffff;
  border: 1px solid #dfe5ed;
  border-radius: 18px;
  box-shadow: 0 18px 34px -30px rgba(11, 31, 58, 0.45);
  grid-column: 1 / -1;
  margin: 0 auto;
  max-width: 840px;
  padding: 36px;
  width: 100%;
}

.exam-result-label {
  color: var(--gold);
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;
  line-height: 16px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.exam-result-card h2 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 40px;
  font-weight: 900;
  line-height: 46px;
}

.exam-result-score {
  align-items: end;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 16px;
  margin-top: 26px;
  padding-bottom: 24px;
}

.exam-result-score strong {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 64px;
  font-weight: 900;
  line-height: 64px;
}

.exam-result-score small {
  color: #6b7280;
  font-size: 18px;
  font-weight: 900;
  line-height: 26px;
  padding-bottom: 6px;
}

.exam-result-card p {
  color: #4b5563;
  font-size: 17px;
  line-height: 27px;
  margin-top: 22px;
  max-width: 680px;
}

.exam-result-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.exam-topic-practice .exam-result-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exam-result-stats div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.exam-result-stats span {
  color: #6b7280;
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 16px;
  text-transform: uppercase;
}

.exam-result-stats strong {
  color: var(--navy);
  display: block;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 34px;
  margin-top: 6px;
}

.exam-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.exam-result-actions .exam-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.exam-review {
  margin-top: 28px;
}

.exam-review[hidden] {
  display: none;
}

.exam-review summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dfe5ed;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  font-size: 16px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 15px 18px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.exam-review summary::-webkit-details-marker {
  display: none;
}

.exam-review summary::after {
  color: var(--navy);
  content: '+';
  font-size: 22px;
  line-height: 1;
  margin-left: 16px;
}

.exam-review[open] summary::after {
  content: '-';
}

.exam-review summary:hover {
  background: #eef3f8;
  border-color: #cbd5e1;
}

.exam-review summary:focus-visible {
  outline: 3px solid rgba(26, 91, 146, 0.35);
  outline-offset: 3px;
}

.exam-review-content {
  padding-top: 14px;
}

.exam-review-list {
  display: grid;
  gap: 12px;
}

.exam-review-item {
  background: #f8fafc;
  border-left: 3px solid #dc2626;
  padding: 16px;
}

.exam-review-item strong,
.exam-review-item p {
  display: block;
  line-height: 1.5;
}

.exam-review-item strong {
  color: var(--navy);
}

.exam-review-item p {
  color: #4b5563;
  margin-top: 6px;
}

body.exam-timeout [data-exam-timer] {
  color: #dc2626;
}

body.exam-timeout .exam-card {
  border-color: rgba(220, 38, 38, 0.35);
}

.exam-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.exam-topline span {
  color: #9ca3af;
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  line-height: 16px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.exam-topline strong,
.exam-topline time {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 30px;
}

.exam-topline time {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
}

.exam-topline time[hidden] {
  display: none;
}

.exam-progress {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  margin: 28px 0 32px;
  overflow: hidden;
}

.exam-progress span {
  background: var(--gold);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.2s ease;
  width: 5%;
}

.exam-card h2 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 30px;
  font-weight: 900;
  line-height: 38px;
}

.exam-question-image {
  align-items: center;
  background: linear-gradient(140deg, #eef2f6, #e1e7ee);
  color: #677386;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 22px;
  min-height: 180px;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

.exam-question-image[hidden] {
  display: none;
}

.exam-question-image strong {
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.exam-question-image span {
  font-size: 14px;
  margin-top: 6px;
}

.exam-question-image img {
  display: block;
  height: auto;
  max-height: min(62vh, 560px);
  object-fit: contain;
  width: 100%;
}

.exam-question-image img[hidden] {
  display: none;
}

.exam-note {
  color: #6b7280;
  font-size: 15px;
  line-height: 23px;
  margin-top: 12px;
}

.exam-note:empty {
  display: none;
}

.exam-note.is-correct {
  color: #15803d;
  font-weight: 800;
}

.exam-note.is-wrong {
  color: #dc2626;
  font-weight: 800;
}

.exam-answers {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.exam-answers[hidden],
.exam-controls[hidden],
.exam-sidebar[hidden],
.exam-result-stats [hidden] {
  display: none;
}

.exam-answer {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  font-size: 16px;
  font-weight: 700;
  gap: 14px;
  line-height: 24px;
  min-height: 68px;
  padding: 16px;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  width: 100%;
}

.exam-answer span {
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  color: #6b7280;
  display: inline-flex;
  flex: 0 0 36px;
  font-size: 13px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.exam-answer:hover,
.exam-answer.is-selected {
  background: #fffcf2;
  border-color: var(--gold);
}

.exam-answer:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.exam-answer.is-correct:disabled,
.exam-answer.is-wrong:disabled {
  opacity: 1;
}

.exam-answer.is-selected span {
  background: var(--gold);
  color: #ffffff;
}

.exam-answer.is-correct {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}

.exam-answer.is-correct span {
  background: #16a34a;
  color: #ffffff;
}

.exam-answer.is-wrong {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.exam-answer.is-wrong span {
  background: #dc2626;
  color: #ffffff;
}

.exam-controls {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
}

.exam-controls [data-exam-prev] {
  order: 1;
}

.exam-controls [data-exam-reset] {
  order: 2;
}

.exam-controls [data-exam-next] {
  order: 3;
}

.exam-finish-callout[hidden] {
  display: none;
}

.exam-finish-callout {
  align-items: center;
  background: #fffcf2;
  border: 1px solid rgba(212, 175, 55, 0.72);
  border-radius: 12px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px;
}

.exam-finish-callout strong {
  color: var(--navy);
  display: block;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 24px;
}

.exam-finish-callout span {
  color: #6b7280;
  display: block;
  font-size: 14px;
  line-height: 21px;
  margin-top: 3px;
}

.exam-btn {
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  min-height: 52px;
  padding: 12px 20px;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.exam-btn-light {
  background: #ffffff;
  border: 2px solid var(--navy);
  color: var(--navy);
}

.exam-btn-gold {
  background: var(--gold);
  border: 2px solid var(--gold);
  color: #ffffff;
}

.exam-btn-light:hover {
  background: var(--navy);
  color: #ffffff;
}

.exam-btn-gold:hover {
  background: var(--navy);
  border-color: var(--navy);
}

.exam-btn:active {
  transform: translateY(1px) scale(0.99);
}

.exam-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.exam-sidebar {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 96px;
}

.exam-side-card {
  padding: 24px;
}

.exam-side-card h3 {
  color: var(--navy);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 26px;
  margin-bottom: 18px;
}

.exam-map {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 3px;
}

.exam-map-btn {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  height: 40px;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.exam-map-btn:hover,
.exam-map-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.exam-map-btn.is-answered:not(.is-active) {
  background: #fffcf2;
  border-color: rgba(212, 175, 55, 0.72);
  color: var(--navy);
}

.exam-map-btn.is-correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.exam-map-btn.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.exam-map-btn.is-answered.is-correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #14532d;
}

.exam-map-btn.is-answered.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.exam-map-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.exam-help-card {
  background: var(--navy);
  border-color: var(--navy);
}

.exam-help-card h3 {
  color: #ffffff;
}

.exam-help-card p {
  color: #cbd5e1;
  font-size: 15px;
  line-height: 23px;
}

.exam-help-link:hover {
  border-color: var(--gold);
}

@media (max-width: 1280px) {
  .tests-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .theory-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .exam-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1120px) {
.test-hero-grid,
  .exam-hero-grid,
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .tests-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .theory-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .exam-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .test-hero,
  .exam-hero {
    padding: 52px 0 42px;
  }

  .test-hero {
    background-position: 68% center;
    background-size: auto 100%;
  }

  .test-hero::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.92) 68%, rgba(255, 255, 255, 0.86));
  }

  .test-hero-grid,
  .exam-hero-grid {
    gap: 28px;
  }

  .test-hero h1,
  .exam-hero h1 {
    font-size: 36px;
    line-height: 42px;
  }

  .test-hero p,
  .exam-hero p {
    font-size: 16px;
    line-height: 24px;
    margin-top: 18px;
  }

  .test-hero-actions,
  .exam-controls {
    flex-direction: column;
  }

  .test-hero-actions .btn,
  .exam-btn {
    width: 100%;
  }

  .exam-controls {
    gap: 10px;
  }

  .exam-controls [data-exam-next] {
    min-height: 58px;
    order: 1;
  }

  .exam-controls [data-exam-prev] {
    font-size: 14px;
    min-height: 46px;
    order: 2;
    padding: 9px 16px;
  }

  .exam-controls [data-exam-reset] {
    background: var(--navy);
    border-color: var(--navy);
    color: #ffffff;
    font-size: 14px;
    margin-top: 4px;
    min-height: 46px;
    order: 3;
    padding: 9px 16px;
  }

  .exam-result-actions [data-exam-result-reset] {
    background: var(--navy);
    border-color: var(--navy);
    color: #ffffff;
  }

  .exam-card,
  .exam-side-card {
    border-radius: 16px;
    padding: 22px;
  }

  .test-catalog,
  .theory-course,
  .exam-workspace {
    padding: 52px 0;
  }

  .test-section-head {
    margin-bottom: 26px;
  }

  .test-section-head h2,
  .theory-heading h2 {
    font-size: 32px;
    line-height: 38px;
  }

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

  .test-card-link {
    min-height: 76px;
    padding: 15px;
  }

  .test-card-link strong {
    font-size: clamp(25px, 6vw, 30px);
    line-height: 1.15;
  }

  .test-card-link small {
    font-size: 16px;
  }

  .theory-topic strong {
    font-size: 17px;
    line-height: 22px;
  }

  .theory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theory-topic strong {
    font-size: 15px;
    line-height: 19px;
  }

  .exam-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .exam-card h2 {
    font-size: 24px;
    line-height: 31px;
  }

  .exam-answer {
    align-items: flex-start;
    font-size: 15px;
    line-height: 22px;
  }

  .exam-result-card {
    border-radius: 16px;
    margin-bottom: 112px;
    padding: 24px;
  }

  .exam-result-card h2 {
    font-size: 32px;
    line-height: 38px;
  }

  .exam-result-score {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .exam-result-score strong {
    font-size: 52px;
    line-height: 56px;
  }

  .exam-result-stats {
    grid-template-columns: 1fr;
  }

  .exam-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-finish-callout {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .tests-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 480px) {
  .theory-list {
    grid-template-columns: 1fr;
  }
}
