:root {
  --ink: #16202a;
  --muted: #607080;
  --line: #dce4e8;
  --paper: #fffdf8;
  --panel: #ffffff;
  --azure: #0078d4;
  --azure-dark: #005a9e;
  --success: #107c10;
  --danger: #c42b1c;
  --warn: #ffb900;
  --teal: #0b7a75;
  --shadow: 0 20px 55px rgba(22, 32, 42, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(255, 185, 0, 0.08) 44%, rgba(16, 124, 16, 0.08)),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.9), transparent 32%),
    var(--paper);
  font-family: Manrope, sans-serif;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 1px solid rgba(22, 32, 42, 0.1);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--azure), var(--teal));
  border-radius: 8px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-weight: 800;
}

.brand span,
.exam-meta span,
.progress-copy,
.question-status,
.source-link,
.muted {
  color: var(--muted);
  font-size: 0.87rem;
}

.exam-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  font-weight: 700;
  font-size: 0.84rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(18px, 4vw, 48px) clamp(18px, 4vw, 56px) 40px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 92px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(22, 32, 42, 0.11);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 36px rgba(22, 32, 42, 0.07);
}

.sidebar h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.position-summary {
  margin-top: 18px;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 800;
}

.progress-track {
  height: 10px;
  background: #ecf2f5;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 8px;
}

.progress-bar {
  height: 100%;
  width: var(--progress);
  background: linear-gradient(90deg, var(--azure), var(--teal));
}

.position-track {
  height: 8px;
  margin: 12px 0 20px;
}

.main {
  display: grid;
  gap: 18px;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.hero-strip h1 {
  font-family: "Source Serif 4", serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.96;
  margin: 0;
  max-width: 760px;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(22, 32, 42, 0.11);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  background: var(--ink);
  color: white;
}

.result-card span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 800;
}

.result-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.result-percent {
  min-width: 92px;
  text-align: right;
  color: #9ee8c7;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800;
}

.question-card {
  padding: clamp(18px, 4vw, 38px);
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.question-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.22;
}

.question-type {
  color: var(--azure-dark);
  font-weight: 800;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.answers {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.answer {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  width: 100%;
  min-height: 62px;
  padding: 15px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.answer:hover {
  border-color: rgba(0, 120, 212, 0.55);
}

.answer .box {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #8b99a5;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 800;
}

.answer.selected {
  border-color: var(--azure);
  background: #f2f8fd;
}

.answer.selected .box {
  color: white;
  background: var(--azure);
  border-color: var(--azure);
}

.answer.correct {
  border-color: rgba(16, 124, 16, 0.65);
  background: #f1fbf1;
}

.answer.wrong {
  border-color: rgba(196, 43, 28, 0.58);
  background: #fff4f2;
}

.answer small {
  color: var(--muted);
  font-weight: 800;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.btn.primary {
  background: var(--azure);
  color: white;
  border-color: var(--azure);
}

.btn.primary:hover {
  background: var(--azure-dark);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.feedback {
  display: none;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.feedback.visible {
  display: block;
}

.feedback h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.feedback.correct h3 {
  color: var(--success);
}

.feedback.wrong h3 {
  color: var(--danger);
}

.reference {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.reference h2 {
  margin: 0;
  font-size: 1.05rem;
}

.source-link {
  color: var(--azure-dark);
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .topbar,
  .hero-strip,
  .question-head {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .question-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    max-height: 180px;
  }
}

@media (max-width: 540px) {
  .topbar {
    gap: 14px;
  }

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

  .question-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  }

  .answer {
    grid-template-columns: 24px 1fr;
  }

  .answer small {
    grid-column: 2;
  }
}

/* AZ-900 simulator */
.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar .brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.azure-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--azure);
  color: #fff;
  font-size: 1.25rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.exam-pill {
  border: 1px solid #b8d8ef;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--azure-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.tabs button,
.text-button {
  border: 0;
  border-radius: 6px;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tabs button:hover,
.tabs .active {
  background: #e6f3fb;
  color: var(--azure-dark);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  min-height: 300px;
  margin-bottom: 22px;
  padding: clamp(26px, 5vw, 54px);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #0078d4, #004578 64%, #002b50);
  color: #fff;
}

.hero h1,
.panel h1 {
  margin: 7px 0 12px;
  font-family: "Source Serif 4", serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.98;
}

.hero p {
  max-width: 540px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  gap: 10px 14px;
  min-width: 160px;
}

.hero-stats strong { font-size: 1.65rem; }
.hero-stats span { align-self: center; font-size: 0.78rem; text-transform: uppercase; }
.eyebrow { color: var(--azure-dark); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hero .eyebrow { color: #b9e4ff; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b6c9d5;
  border-radius: 7px;
  padding: 11px 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.button:hover { border-color: var(--azure); color: var(--azure-dark); }
.button.primary { border-color: var(--azure); background: var(--azure); color: #fff; }
.button.primary:hover { background: var(--azure-dark); color: #fff; }
.button.light { border-color: #fff; background: #fff; color: var(--azure-dark); }
.button.wide { width: 100%; margin-top: 28px; }
.button.danger { margin-top: 20px; border-color: #df8d84; color: var(--danger); }

.domain-grid,
.choice-grid,
.flash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.domain-grid { margin-bottom: 22px; }
.domain-grid article,
.learn-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 36px rgba(22, 32, 42, 0.07);
}

.domain-grid article { padding: 22px; }
.domain-grid span { font-size: 1.4rem; }
.domain-grid h2,
.learn-card h2,
.tips h2 { margin: 12px 0 7px; font-size: 1rem; }
.domain-grid p,
.learn-card p,
.panel > p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

.learn-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
}

.panel { padding: clamp(22px, 5vw, 46px); }
.setup { max-width: 780px; margin: 0 auto; }
.setup h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.setup h2 { margin: 28px 0 12px; font-size: 1rem; }

.choice-grid { grid-template-columns: repeat(2, 1fr); }
.choice {
  min-height: 130px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.choice strong,
.choice span { display: block; }
.choice strong { margin-bottom: 7px; }
.choice span { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.choice.selected { border-color: var(--azure); background: #f2f8fd; }

.quantity { display: flex; gap: 8px; }
.quantity button {
  min-width: 56px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: #fff;
  font-weight: 800;
}
.quantity .selected { border-color: var(--azure); background: var(--azure); color: #fff; }

.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.exam-head strong { display: block; margin-top: 3px; }
.timer { padding: 8px 12px; border-radius: 6px; background: #e6f3fb; color: var(--azure-dark); font-weight: 800; }
.progress { height: 6px; margin-bottom: 18px; overflow: hidden; border-radius: 999px; background: #dce8ef; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--azure), var(--teal)); transition: width 0.2s ease; }
.question-prompt { margin: 0 0 8px; font-size: clamp(1.2rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.3; }
.selection-note { margin: 0 0 22px; color: var(--muted); font-size: 0.85rem; }
.answers { display: grid; gap: 10px; }
.answer {
  grid-template-columns: 30px 1fr;
  min-height: 58px;
  border-radius: 7px;
  font-weight: 600;
}
.answer > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e2eff7;
  color: var(--azure-dark);
  font-size: 0.75rem;
  font-weight: 800;
}
.answer.selected { border-color: var(--azure); background: #f2f8fd; }
.answer.selected > span { background: var(--azure); color: #fff; }
.answer.correct { border-color: var(--success); background: #f0faed; }
.answer.correct > span { background: var(--success); color: #fff; }
.answer.wrong { border-color: var(--danger); background: #fff2f0; }
.answer.wrong > span { background: var(--danger); color: #fff; }

.explanation { margin-top: 22px; padding: 16px; border-left: 4px solid var(--azure); background: #f3f9fc; }
.explanation.success { border-color: var(--success); }
.explanation.danger { border-color: var(--danger); }
.explanation p { margin: 7px 0; line-height: 1.55; }
.explanation a { color: var(--azure-dark); font-weight: 800; }
.exam-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.exam-actions > div { display: flex; gap: 8px; }

.result { max-width: 650px; margin: 0 auto; text-align: center; }
.score { display: grid; width: 150px; aspect-ratio: 1; place-items: center; margin: 0 auto 24px; border: 8px solid var(--azure); border-radius: 50%; color: var(--azure-dark); font-size: 2.35rem; font-weight: 800; }
.result h1 { font-size: 3rem; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

.flash-grid { margin-top: 26px; }
.flashcard {
  min-height: 165px;
  padding: 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--azure), var(--azure-dark));
  color: #fff;
  text-align: left;
}
.flashcard strong { display: block; font-size: 1.15rem; }
.flashcard span { display: none; margin-top: 10px; font-size: 0.85rem; line-height: 1.5; }
.flashcard.flipped { background: #f2f8fd; border: 2px solid #b8d8ef; color: var(--ink); }
.flashcard.flipped span { display: block; }

.tips article { margin-top: 16px; padding: 16px; border-left: 4px solid var(--azure); background: #f4f9fc; }
.tips article:nth-of-type(2) { border-color: var(--success); background: #f2faef; }
.tips article:nth-of-type(3) { border-color: var(--warn); background: #fff9e7; }
.tips article h2 { margin-top: 0; }
.tips article p { margin: 0; line-height: 1.6; }

.history { display: grid; gap: 10px; margin-top: 22px; }
.history article { display: flex; align-items: center; gap: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; }
.history strong { color: var(--azure-dark); font-size: 1.25rem; }
.history span { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 700px) {
  .hero, .learn-card { align-items: flex-start; flex-direction: column; }
  .hero-stats { grid-template-columns: repeat(3, auto); }
  .hero-stats span { display: none; }
  .domain-grid, .flash-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .exam-head { align-items: flex-start; flex-wrap: wrap; }
  .exam-actions { align-items: stretch; flex-direction: column-reverse; }
  .exam-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .exam-actions .button { width: 100%; }
}