:root {
  --ink: #172033;
  --ink-soft: #576174;
  --paper: #fcf8f1;
  --card: rgba(255, 255, 255, 0.9);
  --stroke: rgba(23, 32, 51, 0.08);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.09);
  --verb: #d97706;
  --syntax: #2563eb;
  --grammar: #b91c5c;
  --vocab: #0f766e;
  --reading: #0891b2;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.17), transparent 24%),
    radial-gradient(circle at 82% 8%, rgba(37, 99, 235, 0.14), transparent 22%),
    linear-gradient(180deg, #fbf7ef, #f3eee3 48%, #f7f4ee);
}

a { color: inherit; }
button, input { font: inherit; }

.site-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 56px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0 24px;
}

.logo {
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--ink);
}

.logo span { color: var(--verb); }

.nav-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--ink); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.88fr);
  gap: 24px;
  align-items: stretch;
  overflow: hidden;
  background: linear-gradient(150deg, #172033, #223860 60%, #1a2846);
  color: #fff;
  border-radius: 30px;
  padding: 34px 32px;
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.18);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 320px;
  height: 320px;
  top: -140px;
  right: -50px;
  background: rgba(255, 180, 125, 0.12);
}

.hero::after {
  width: 220px;
  height: 220px;
  bottom: -120px;
  left: 40%;
  background: rgba(37, 99, 235, 0.14);
}

.eyebrow,
.section-kicker,
.hero-panel-label,
.tip-label,
.module-tag,
.lesson-chip,
.quiz-topic,
.mistake-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.eyebrow {
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.3rem, 3.2vw, 3.7rem);
  line-height: 1.04;
  max-width: 13ch;
}

.hero p {
  margin: 14px 0 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.72;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-primary {
  border: 0;
  background: var(--verb);
  color: #fff;
  box-shadow: 0 12px 22px rgba(217, 119, 6, 0.22);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-ghost {
  border: 1px solid rgba(23, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover { transform: translateY(-1px); }

.hero-panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(4px);
}

.hero-panel-label {
  background: rgba(255, 180, 125, 0.16);
  color: #ffd2b2;
  padding: 7px 10px;
  margin-bottom: 10px;
}

.hero-panel-grid {
  display: grid;
  gap: 10px;
}

.hero-mini-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px;
}

.hero-mini-card strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.hero-mini-card span {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.55;
  font-size: 0.9rem;
}

.stats,
.guide-grid,
.lessons-grid,
.vocab-grid,
.mistake-list {
  display: grid;
  gap: 18px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 26px 0 46px;
}

.stat-card,
.guide-card,
.finder-panel,
.module-block,
.tip-box,
.quiz-box,
.finder-empty {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.stat-card {
  border-radius: 22px;
  padding: 24px;
}

.stat-value {
  font-size: clamp(2.2rem, 3vw, 2.8rem);
  font-weight: 700;
  color: var(--verb);
}

.stat-label {
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.section-heading { margin-bottom: 18px; }

.section-kicker {
  background: #efe2d7;
  color: #8a431c;
  padding: 6px 10px;
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
}

.guide-section,
.finder-section,
.vocab-section,
.quiz-section { margin-bottom: 46px; }

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

.guide-card {
  border-radius: 22px;
  padding: 24px;
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.guide-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.finder-panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 239, 0.92));
}

.finder-top {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.search-field {
  flex: 1;
  display: grid;
  gap: 10px;
}

.search-label,
.filter-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #677185;
}

.search-field input {
  width: 100%;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1rem;
}

.search-field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.32);
}

.filter-groups {
  display: grid;
  gap: 18px;
}

.filter-group { display: grid; gap: 10px; }

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

.filter-chip {
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #435067;
  padding: 10px 14px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter-chip:hover { transform: translateY(-1px); }

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.finder-summary {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-weight: 500;
}

.finder-empty {
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 20px;
}

.finder-empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.finder-empty p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.module-block,
.lesson-card {
  --theme-color: var(--ink);
  --theme-soft: #eef2ff;
  --theme-tint: rgba(23, 32, 51, 0.05);
}

.theme-verb { --theme-color: var(--verb); --theme-soft: #fff2df; --theme-tint: rgba(217, 119, 6, 0.08); }
.theme-syntax { --theme-color: var(--syntax); --theme-soft: #e8f0ff; --theme-tint: rgba(37, 99, 235, 0.08); }
.theme-grammar { --theme-color: var(--grammar); --theme-soft: #fde8f1; --theme-tint: rgba(185, 28, 92, 0.08); }
.theme-vocab { --theme-color: var(--vocab); --theme-soft: #e3f6f3; --theme-tint: rgba(15, 118, 110, 0.08); }
.theme-reading { --theme-color: var(--reading); --theme-soft: #e0f7ff; --theme-tint: rgba(8, 145, 178, 0.08); }

.module-block {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 28px;
  margin-bottom: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 250, 244, 0.92)),
    var(--theme-tint);
}

.module-block::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--theme-color);
}

.module-block.is-empty,
.lesson-card.is-hidden { display: none; }

.module-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.module-lead {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.module-symbol,
.lesson-glyph {
  display: grid;
  place-items: center;
  color: var(--theme-color);
  background: var(--theme-soft);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.module-symbol {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 0.96rem;
}

.module-tag {
  background: var(--theme-soft);
  color: var(--theme-color);
  padding: 6px 10px;
  margin-bottom: 10px;
}

.module-header h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.module-header p,
.module-note {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.module-aside {
  min-width: 180px;
  display: grid;
  gap: 10px;
}

.module-count {
  width: fit-content;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(23, 32, 51, 0.08);
  padding: 10px 14px;
  font-weight: 700;
}

.lessons-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 24px;
  padding: 20px;
  min-height: 238px;
  background: linear-gradient(180deg, #fff, #fdfaf4);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lesson-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 24px 24px 0 0;
  background: var(--theme-color);
}

.lesson-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 32, 51, 0.16);
  box-shadow: 0 22px 34px rgba(15, 23, 42, 0.09);
}

.lesson-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.lesson-glyph {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  font-size: 0.92rem;
  flex: 0 0 auto;
}

.lesson-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lesson-chip { padding: 6px 10px; }

.chip-level.intermediate { background: #fff1da; color: #8a4c0c; }
.chip-level.advanced { background: #fde7ef; color: #8f3057; }
.chip-quiz { background: #e7f0ff; color: #285fc8; }
.chip-review { background: #e3f6f3; color: #0f766e; }
.chip-new { background: #f3e8ff; color: #7c3aed; }

.lesson-card h4 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.lesson-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.lesson-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed rgba(23, 32, 51, 0.12);
  color: #647086;
  font-size: 0.88rem;
}

.lesson-meta strong { color: var(--theme-color); }

.vocab-intro {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.vocab-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.vocab-card {
  position: relative;
  border: 0;
  border-radius: 24px;
  min-height: 150px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s ease;
}

.vocab-card:hover { transform: translateY(-3px); }

.vocab-card::after {
  content: 'clique para virar';
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.vocab-verb { background: linear-gradient(160deg, #c96c04, #f59e0b); }
.vocab-syntax { background: linear-gradient(160deg, #1d4ed8, #2563eb); }
.vocab-grammar { background: linear-gradient(160deg, #a21656, #db2777); }
.vocab-vocab { background: linear-gradient(160deg, #0b5c55, #0f766e); }

.vocab-front,
.vocab-back {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-front strong,
.vocab-back strong {
  font-size: 1.12rem;
}

.vocab-front small,
.vocab-back small {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.vocab-card .vocab-back { display: none; }
.vocab-card.flipped .vocab-front { display: none; }
.vocab-card.flipped .vocab-back { display: flex; }

.tip-box {
  border-radius: 26px;
  padding: 24px 26px;
  margin-bottom: 46px;
  background: linear-gradient(135deg, rgba(227, 246, 243, 0.78), rgba(255, 255, 255, 0.92));
}

.tip-label {
  background: #dff3ef;
  color: #0f766e;
  padding: 6px 10px;
  margin-bottom: 10px;
}

.tip-box p {
  margin: 0;
  color: #244b53;
  line-height: 1.8;
}

.quiz-box {
  border-radius: 30px;
  padding: 28px;
}

.quiz-progress {
  height: 10px;
  background: #ece6db;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.quiz-progress-fill {
  width: 12.5%;
  height: 100%;
  background: linear-gradient(90deg, var(--syntax), var(--verb));
  border-radius: 999px;
  transition: width 0.24s ease;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #677185;
  font-size: 0.94rem;
  margin-bottom: 14px;
}

.quiz-topic {
  background: #efe9de;
  color: #5c6477;
  padding: 7px 11px;
  margin-bottom: 14px;
}

.question {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 16px;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 18px;
  background: #fbfaf7;
  color: var(--ink);
  padding: 15px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(217, 119, 6, 0.34);
  background: #fff8f0;
}

.option:disabled { cursor: default; }
.option.correct { background: #e6f5df; border-color: #4b8c2e; color: #315e1e; }
.option.wrong { background: #fde8e8; border-color: #b94b4b; color: #8e3030; }

.feedback {
  min-height: 24px;
  margin-top: 14px;
  font-weight: 700;
}

.feedback.success { color: #315e1e; }
.feedback.error { color: #8e3030; }

.explanation-card {
  margin-top: 10px;
  border: 1px solid rgba(217, 119, 6, 0.16);
  background: #fff6e9;
  border-radius: 18px;
  padding: 16px;
  color: #6b4d2d;
  line-height: 1.7;
}

.quiz-actions,
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.quiz-result,
.mistake-review {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(248, 244, 236, 0.96));
  border: 1px solid rgba(23, 32, 51, 0.08);
  padding: 24px;
}

.quiz-score-big {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 5vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
}

.quiz-result h3,
.mistake-review-head h3 {
  margin: 10px 0 8px;
  font-size: 1.32rem;
}

.quiz-result p,
.mistake-review-head p,
.mistake-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.quiz-result a {
  color: var(--syntax);
  font-weight: 700;
  text-decoration: none;
}

.quiz-result a:hover { text-decoration: underline; }

.mistake-review { margin-top: 18px; }

.mistake-list {
  margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mistake-card {
  background: #fff;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 20px;
  padding: 18px;
}

.mistake-card h4 {
  margin: 12px 0 10px;
  line-height: 1.45;
  font-size: 1rem;
}

.mistake-pill {
  padding: 6px 10px;
  background: #ece6ff;
  color: #5b3cc4;
}

.footer {
  padding-top: 22px;
  text-align: center;
  color: #687286;
}

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .site-shell { width: min(100% - 22px, 1240px); }
  .navbar,
  .finder-top,
  .module-header,
  .module-lead,
  .quiz-meta { flex-direction: column; align-items: flex-start; }
  .hero { padding: 30px 24px; }
  .finder-panel,
  .module-block,
  .quiz-box,
  .tip-box { padding: 22px; }
  .guide-grid,
  .stats,
  .mistake-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .nav-links,
  .hero-actions,
  .filter-row,
  .lesson-tags,
  .quiz-actions,
  .result-actions { width: 100%; }
  .nav-links a,
  .btn-primary,
  .btn-secondary,
  .btn-ghost { width: 100%; text-align: center; justify-content: center; }
  .hero h1 { max-width: none; }
  .lesson-head { flex-direction: column; }
  .lesson-tags { justify-content: flex-start; }
  .lesson-meta { flex-direction: column; align-items: flex-start; }
}
