/* Área de exercícios do EstudaMath */
.exercise-hub-page,
.exercise-module-page {
  background: #f8fbff !important;
}

.exercise-hub-shell,
.exercise-module-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding: 52px 0 84px;
}

.exercise-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 68px);
  color: #fff;
  background: linear-gradient(135deg, #071943 0%, #075fd8 52%, #6154dc 100%);
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(7, 48, 123, .2);
}

.exercise-hero::before,
.exercise-hero::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.exercise-hero::before {
  top: -120px;
  right: -70px;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(104, 229, 255, .35), rgba(104, 229, 255, 0) 68%);
}

.exercise-hero::after {
  right: 9%;
  bottom: -130px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 0 0 34px rgba(255,255,255,.035), 0 0 0 72px rgba(255,255,255,.025);
}

.exercise-breadcrumb {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: .84rem;
  font-weight: 800;
}

.exercise-breadcrumb a { color: #bfe9ff; }
.exercise-breadcrumb span { color: rgba(255,255,255,.64); }

.exercise-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 0;
  font-family: "Nunito", "Inter", sans-serif;
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.065em;
}

.exercise-hero p {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 22px 0 0;
  color: #dbeaff;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}

.exercise-hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.exercise-hero-stats span {
  padding: 9px 13px;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.exercise-section-heading {
  margin: 58px 0 24px;
}

.exercise-section-heading h2 {
  margin: 0;
  color: #071943;
  font-family: "Nunito", "Inter", sans-serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.exercise-section-heading p {
  max-width: 720px;
  margin: 12px 0 0;
  color: #5b6a84;
  line-height: 1.7;
}

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

.exercise-module-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  min-height: 154px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dce9f7;
  border-radius: 20px;
  box-shadow: 0 18px 46px rgba(8, 24, 61, .055);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.exercise-module-card:hover {
  transform: translateY(-5px);
  border-color: #9fcfff;
  box-shadow: 0 26px 58px rgba(8, 65, 145, .12);
}

.exercise-module-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 8px;
  background: linear-gradient(145deg, #f1f8ff, #eef0ff);
  border-radius: 18px;
}

.exercise-module-card h2 {
  margin: 0 0 7px;
  color: #071943;
  font-size: 1.1rem;
  letter-spacing: -.025em;
}

.exercise-module-card p {
  margin: 0;
  color: #60708a;
  font-size: .9rem;
  line-height: 1.5;
}

.exercise-module-card strong {
  display: inline-block;
  margin-top: 10px;
  color: #0969e8;
  font-size: .8rem;
}

.practice-toolbar {
  position: sticky;
  top: 86px;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 22px;
  padding: 16px 18px;
  background: rgba(255,255,255,.95);
  border: 1px solid #dbe9f7;
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(8,24,61,.08);
  backdrop-filter: blur(14px);
}

.practice-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-filter {
  padding: 9px 13px;
  color: #52627d;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  background: #f7fbff;
  border: 1px solid #dce9f7;
  border-radius: 999px;
}

.practice-filter:hover,
.practice-filter.is-active {
  color: #fff;
  background: linear-gradient(135deg, #0878ee, #5e58df);
  border-color: transparent;
}

.practice-progress {
  min-width: 190px;
  color: #52627d;
  font-size: .86rem;
  font-weight: 750;
  text-align: right;
}

.practice-progress strong { color: #071943; }

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

.practice-question {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px;
  background: #fff;
  border: 1px solid #dce9f7;
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(8,24,61,.05);
}

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

.practice-question.is-correct { border-color: #83d7b8; box-shadow: 0 16px 42px rgba(34, 153, 112, .09); }
.practice-question.is-wrong { border-color: #efaca8; box-shadow: 0 16px 42px rgba(192, 64, 58, .08); }

.practice-question-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.practice-number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #0969e8;
  font-weight: 900;
  background: #eef7ff;
  border-radius: 11px;
}

.practice-topic {
  margin-right: auto;
  color: #61718a;
  font-size: .76rem;
  font-weight: 800;
}

.practice-question h2 {
  margin: 0 0 16px;
  color: #071943;
  font-size: 1.05rem;
  line-height: 1.5;
}

.practice-question .exercise-options {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.practice-question .exercise-options span {
  display: block;
  padding: 12px 14px;
  color: #334867;
  line-height: 1.45;
  cursor: pointer;
  background: #f8fbff;
  border: 1px solid #dce9f7;
  border-radius: 12px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.practice-question .exercise-options span:hover,
.practice-question .exercise-options span.is-selected {
  color: #075fcf;
  background: #eef7ff;
  border-color: #8fc8ff;
  transform: translateX(2px);
}

.practice-question .exercise-options span.is-correct {
  color: #075f48;
  background: #eafaf4;
  border-color: #70d0ae;
}

.practice-question .exercise-options span.is-wrong {
  color: #a03631;
  background: #fff0ef;
  border-color: #eba49f;
}

.difficulty-badge {
  white-space: nowrap;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 26px;
  padding: 22px;
  background: #fff;
  border: 1px solid #dce9f7;
  border-radius: 18px;
}

.practice-result {
  flex: 1 1 280px;
  color: #52627d;
  line-height: 1.55;
}

.practice-result strong {
  display: block;
  color: #071943;
  font-size: 1.15rem;
}

.practice-answer-key {
  margin-top: 20px;
  padding: 24px;
  background: linear-gradient(145deg, #f7fbff, #f4f2ff);
  border: 1px solid #d4e5f7;
  border-radius: 18px;
}

.practice-answer-key[hidden] { display: none; }
.practice-answer-key h2 { margin: 0 0 16px; color: #071943; }
.practice-answer-key p { margin: 9px 0 0; color: #52627d; line-height: 1.6; }

.practice-theory-link {
  color: #0969e8;
  font-weight: 800;
}

@media (max-width: 940px) {
  .exercise-module-grid,
  .practice-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .exercise-hub-shell,
  .exercise-module-shell { width: min(100% - 24px, 1180px); padding-top: 28px; }
  .exercise-hero { padding: 32px 24px; border-radius: 22px; }
  .exercise-hero h1 { font-size: clamp(2.65rem, 14vw, 4.4rem); overflow-wrap: anywhere; }
  .exercise-module-grid,
  .practice-grid { grid-template-columns: 1fr; }
  .practice-toolbar { position: static; }
  .practice-progress { width: 100%; text-align: left; }
  .practice-question { padding: 20px; }
  .exercise-module-card { grid-template-columns: 62px minmax(0, 1fr); }
  .exercise-module-card img { width: 62px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  .exercise-module-card,
  .practice-question .exercise-options span { transition: none; }
}
