:root {
  --purple-900: #4b1b86;
  --purple-800: #5f2499;
  --purple-700: #6f2fb0;
  --purple-600: #7d54d8;
  --white: #ffffff;
  --bg-soft: #eceaf4;
  --bg-ash: #f4f3f8;
  --text: #1e1a2c;
  --muted: #5a5870;
  --line: #d9d4e3;
  --card: #f0eff4;
  --card-strong: #ebedf3;
  --red: #d94a5e;
  --red-dark: #c73850;
  --blue: #2d7ae7;
  --blue-dark: #1f68d8;
  --green: #1baa7f;
  --green-dark: #148b67;
  --gold: #f0bf57;
  --gold-dark: #d29e25;
  --shadow-soft: 0 8px 28px rgba(30, 22, 54, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-soft);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
  background: linear-gradient(90deg, var(--purple-900), var(--purple-800));
  color: var(--white);
  padding: 0 28px 0 28px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08);
}

.brand {
  font-size: clamp(1.2rem, 1.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-tag {
  font-size: 0.7rem;
  opacity: 0.9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 8px;
  white-space: nowrap;
}

.nav-btn {
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.nav-btn.outline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 18px 56px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.course-hero {
  background: linear-gradient(90deg, var(--purple-900), var(--purple-800));
  border-radius: 18px;
  padding: 28px 26px 24px;
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.eyebrow,
.area-tag,
.result-badge,
.test-header-meta {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

.course-hero .eyebrow {
  opacity: 0.9;
}

.course-hero h1 {
  margin: 18px 0 18px;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.07em;
}

.course-hero p {
  margin: 0;
  max-width: 760px;
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.hero-metrics {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 30px 0 18px;
}

.section-title-row h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.06em;
}

.section-title-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 22px;
}

.course-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(77, 61, 119, 0.14);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.course-card.variant-red {
  background: #f4f0f3;
}
.course-card.variant-blue {
  background: #eef5ff;
}
.course-card.variant-green {
  background: #edf9f0;
}

.course-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.course-top .label-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  font-weight: 800;
  text-transform: uppercase;
}

.course-card.variant-red .label-badge {
  background: #fce3e6;
  color: var(--red-dark);
}

.course-card.variant-blue .label-badge {
  background: #dfeeff;
  color: var(--blue-dark);
}

.course-card.variant-green .label-badge {
  background: #dff8ee;
  color: var(--green-dark);
}

.course-number {
  font-size: 3.4rem;
  letter-spacing: -0.08em;
  line-height: 1;
  font-weight: 800;
  margin: 0 0 16px;
}

.course-card.variant-red .course-number {
  color: var(--red-dark);
}
.course-card.variant-blue .course-number {
  color: var(--blue-dark);
}
.course-card.variant-green .course-number {
  color: var(--green-dark);
}

.course-card h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.07em;
}

.course-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.55;
  min-height: 72px;
}

.card-stats {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.course-card .start-btn {
  width: 100%;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: var(--white);
  font-weight: 800;
  background: linear-gradient(90deg, var(--purple-900), var(--purple-700));
}

.notice-box {
  margin-top: 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 20, 49, 0.08);
  padding: 18px 20px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
}

.notice-box span {
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.notice-box p {
  margin: 0;
  line-height: 1.5;
}

.footer-note {
  margin-top: 26px;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(30, 26, 44, 0.75);
  text-transform: uppercase;
}

.quiz-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
}

.back-button {
  background: transparent;
  border: none;
  color: var(--purple-900);
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
}

.compact {
  gap: 8px;
}

.test-header {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 18px 0 10px;
}

.test-header-meta {
  color: var(--purple-900);
  margin-bottom: 8px;
}

.test-header h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3rem);
  letter-spacing: -0.06em;
}

.test-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.progress-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(85, 67, 127, 0.1);
  border-radius: 14px;
  padding: 18px 20px 14px;
  margin-top: 24px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress-bar {
  width: 100%;
  background: rgba(120, 110, 150, 0.12);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple-900), var(--purple-700));
}

.progress-dots {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.progress-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(107, 102, 146, 0.13);
  border: 1px solid rgba(72, 60, 123, 0.12);
}

.progress-dot.active {
  background: linear-gradient(180deg, var(--purple-900), var(--purple-700));
}

.progress-dot.correct {
  background: #dff8ee;
  border-color: rgba(29, 167, 112, 0.35);
}

.progress-dot.wrong {
  background: #fce6ea;
  border-color: rgba(204, 74, 82, 0.35);
}

.quiz-card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(85, 67, 127, 0.1);
  border-radius: 18px;
  padding: 22px 18px 18px;
  margin-top: 24px;
}

.question-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.question-label {
  font-weight: 800;
  color: var(--purple-900);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.question-points {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.quiz-card h3 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.06em;
  line-height: 1.15;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 12px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px;
  border-radius: 14px;
  border: 1px solid rgba(30, 20, 40, 0.08);
  background: #f3f7fb;
  color: var(--text);
  text-align: left;
  font-weight: 700;
  min-height: 72px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.option.selected {
  box-shadow: inset 0 0 0 2px rgba(65, 41, 117, 0.2);
}

.option.red {
  background: linear-gradient(90deg, rgba(217, 74, 94, 0.95), rgba(213, 64, 90, 0.95));
  color: var(--white);
}
.option.blue {
  background: linear-gradient(90deg, rgba(38, 113, 211, 0.96), rgba(41, 104, 197, 0.95));
  color: var(--white);
}
.option.gold {
  background: linear-gradient(90deg, rgba(240, 191, 87, 1), rgba(218, 161, 32, 1));
  color: #1e1a2c;
}
.option.green {
  background: linear-gradient(90deg, rgba(37, 170, 123, 0.96), rgba(27, 154, 118, 0.96));
  color: var(--white);
}

.option-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.option-square {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

.option-circle::after,
.option-square::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: transparent;
}

.option.selected .option-circle::after,
.option.selected .option-square::after {
  background: rgba(255, 255, 255, 0.94);
}

.option strong {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  line-height: 1.3;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 12px;
  padding: 0.95rem 1.4rem;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(90deg, var(--purple-900), var(--purple-700));
  color: var(--white);
}

.secondary-btn {
  background: rgba(111, 47, 176, 0.12);
  color: var(--purple-900);
}

.wide {
  min-width: 220px;
}

.results-header {
  padding-top: 10px;
}

.results-header h2 {
  margin: 10px 0 8px;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  letter-spacing: -0.06em;
}

.results-header p {
  margin: 0;
  color: var(--muted);
}

.score-banner {
  margin-top: 22px;
  background: linear-gradient(90deg, var(--purple-900), var(--purple-700));
  color: var(--white);
  border-radius: 18px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}

.small-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.score-value {
  font-size: clamp(3rem, 4vw, 4rem);
  letter-spacing: -0.08em;
  font-weight: 800;
  margin-top: 8px;
  line-height: 1;
}

.score-caption {
  opacity: 0.82;
  margin-top: 8px;
}

.score-right h3 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.06em;
}

.score-right p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}

.score-right small {
  color: rgba(255, 255, 255, 0.82);
}

.mini-title-row {
  margin-top: 26px;
}

.question-review-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(98px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.review-chip {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 30, 52, 0.08);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.review-chip.correct {
  background: #edf9f2;
  border-color: rgba(29, 167, 112, 0.2);
}

.review-chip.wrong {
  background: #fff0f3;
  border-color: rgba(204, 74, 82, 0.2);
}

.review-chip .chip-number {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
}

.review-chip .chip-status {
  font-size: 1.2rem;
  font-weight: 800;
}

.review-chip .chip-points {
  font-size: 0.74rem;
  color: var(--muted);
}

.review-list {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.review-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 30, 52, 0.08);
  padding: 16px 18px;
}

.review-item h4 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
}

.review-item .subline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.review-item .answer-line {
  font-size: 1rem;
  display: block;
  margin-bottom: 6px;
}

.review-item .feedback {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.review-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.gabarito-page {
  background: rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  padding: 18px 0 0;
}

.area-tag {
  color: var(--purple-900);
  margin-bottom: 10px;
}

.gabarito-page h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

.gabarito-page > p {
  margin: 12px 0 20px;
  color: var(--muted);
}

.teaching-box {
  background: rgba(111, 47, 176, 0.12);
  border: 1px solid rgba(111, 47, 176, 0.1);
  border-radius: 12px;
  padding: 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teaching-box strong {
  font-size: 1.1rem;
  color: var(--purple-900);
}

.teaching-box span {
  color: var(--muted);
  line-height: 1.5;
}

.gabarito-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 20px;
}

.gabarito-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(85, 67, 127, 0.1);
  border-radius: 14px;
  padding: 18px;
}

.gabarito-card h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  letter-spacing: -0.05em;
}

.gabarito-table {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.gabarito-table li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(143, 137, 171, 0.08);
  font-size: 0.9rem;
}

.gabarito-table .index {
  font-weight: 800;
  color: var(--muted);
  min-width: 18px;
}

.gabarito-table .answer {
  font-weight: 800;
}

.responses-panel {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(85, 67, 127, 0.1);
  border-radius: 12px;
  padding: 18px 20px;
}

.responses-panel h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.responses-panel p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 960px) {
  .course-grid,
  .gabarito-grid {
    grid-template-columns: 1fr;
  }

  .score-banner {
    grid-template-columns: 1fr;
  }

  .question-review-grid {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 18px;
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-tag {
    display: none;
  }

  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .question-review-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .review-actions {
    flex-direction: column;
  }

  .review-actions button {
    width: 100%;
  }
}
