* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  background: var(--bg-page);
  color: var(--text-main);
}

a { color: var(--navy-light); text-decoration: none; }
a:hover { color: var(--navy); }
input::placeholder { color: oklch(65% 0.01 85); }
button { font-family: inherit; }

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
/* Barra superior escura: os elementos dentro dela são claros/translúcidos,
   para contrastar com o azul da paleta sem virar um bloco de branco. */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }

.brand-logo {
  width: 42px; height: 42px; border-radius: 10px; background: #fff;
  border: 1px solid var(--card-border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; filter: var(--logo-tint); }
.brand-logo.cert { width: 64px; height: 64px; border-radius: 14px; margin: 0 auto 18px; }

.brand-name { font-family: Lora, serif; font-weight: 700; font-size: 16px; line-height: 1.25; color: #fff; max-width: 260px; }
.brand-tag { font-size: 10px; color: rgba(255, 255, 255, 0.62); letter-spacing: .05em; text-transform: uppercase; margin-top: 3px; }

.header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.lang-pill { display: flex; gap: 4px; padding: 3px; border-radius: 20px; background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.16); }
.lang-seg { cursor: pointer; padding: 5px 10px 5px 6px; border-radius: 16px; display: flex; align-items: center; gap: 5px; background: transparent; box-shadow: none; border: none; transition: background .15s; }
.lang-seg:hover { background: rgba(255, 255, 255, 0.10); }
.lang-seg.active, .lang-seg.active:hover { background: #fff; box-shadow: var(--shadow-pill); }
.lang-seg span { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.75); }
.lang-seg.active span { color: var(--navy); }
.lang-seg svg { border-radius: 2px; display: block; }

.user-box { display: flex; align-items: center; gap: 12px; }
.user-box .greet { font-size: 11px; color: rgba(255, 255, 255, 0.6); line-height: 1.2; }
.user-box .name { font-size: 13.5px; font-weight: 600; line-height: 1.2; color: #fff; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.10);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3); }

.btn { font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: 7px; padding: 9px 16px; }
.btn-outline { background: white; border: 1px solid var(--input-border); color: oklch(30% 0.02 85); }
.btn-primary { background: var(--navy); border: none; color: white; }
.btn-primary:disabled, .btn-outline:disabled { cursor: default; }

/* Os botões do cabeçalho ficam sobre o azul escuro: "Entrar" vira contorno
   claro e "Cadastre-se" vira sólido branco, para destacar a ação principal. */
.header .btn-outline {
  background: transparent; border-color: rgba(255, 255, 255, 0.4); color: #fff;
  transition: background .15s, border-color .15s;
}
.header .btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.6); }
.header .btn-primary { background: #fff; color: var(--navy); transition: background .15s; }
.header .btn-primary:hover { background: rgba(255, 255, 255, 0.88); }

main { flex: 1; display: flex; flex-direction: column; }

/* ---------- Landing ---------- */

/* Bloco de abertura sobre a foto do dia. O véu azul por cima resolve duas
   coisas: garante a leitura do texto sobre qualquer uma das fotos e esfria
   as imagens (que são quentes, de madeira e pôr do sol) para casarem com a
   paleta azul do site. */
.hero-cover { position: relative; overflow: hidden; background: var(--navy); }
.hero-cover-foto {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(0.8);
  animation: aparecer 0.9s ease both;
}
.hero-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(30, 63, 71, 0.84) 0%,
    rgba(30, 63, 71, 0.62) 45%,
    rgba(30, 63, 71, 0.88) 100%);
}
.hero-cover .hero { position: relative; z-index: 1; }

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero-cover-foto { animation: none; }
}

.hero { padding: 88px 24px 76px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; max-width: 720px; margin: 0 auto; width: 100%; }
.hero h1 { font-family: Lora, serif; font-size: 34px; font-weight: 700; margin: 0; line-height: 1.2; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25); }
.hero p { font-size: 16.5px; line-height: 1.65; color: rgba(255, 255, 255, 0.88); margin: 0; max-width: 580px; }
.hero-ctas { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.hero-ctas .btn { padding: 14px 26px; font-size: 15px; border-radius: var(--radius-btn); }
/* Mesmo par de botões da barra superior: sólido branco para a ação
   principal, contorno claro para a secundária. */
.hero-ctas .btn-primary { background: #fff; color: var(--navy); transition: background .15s; }
.hero-ctas .btn-primary:hover { background: rgba(255, 255, 255, 0.88); }
.hero-ctas .btn-outline {
  background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff;
  transition: background .15s, border-color .15s;
}
.hero-ctas .btn-outline:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.7); }

.steps-grid { max-width: 920px; margin: 0 auto; width: 100%; padding: 12px 24px 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step-card { background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 22px; }
.step-card .num { font-family: Lora, serif; font-weight: 700; font-size: 22px; color: var(--orange); }
.step-card .title { font-weight: 600; font-size: 15px; margin-top: 8px; }
.step-card .desc { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

.modules-section { max-width: 920px; margin: 0 auto; width: 100%; padding: 0 24px 72px; }
.modules-section h2 { font-family: Lora, serif; font-size: 21px; font-weight: 700; margin: 0 0 16px; color: var(--navy-title); }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.module-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 9px; background: white; border: 1px solid var(--card-border); }
.module-row .badge { width: 26px; height: 26px; border-radius: 50%; background: oklch(95% 0.01 85); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.module-row .title { font-size: 13.5px; font-weight: 500; }

/* ---------- Auth ---------- */
.auth-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 20px; }
.auth-card { width: 100%; max-width: 400px; background: white; border: 1px solid var(--card-border); border-radius: 14px; padding: 32px 28px; }
.auth-card h2 { font-family: Lora, serif; font-size: 23px; font-weight: 700; margin: 0 0 6px; color: var(--navy-title); }
.auth-card > p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 22px; }
.field { margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: oklch(35% 0.02 85); display: block; margin-bottom: 6px; }
.field input { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--input-border); border-radius: 7px; font-size: 14.5px; font-family: inherit; color: inherit; background: white; }
.auth-error { font-size: 13px; color: var(--error); margin: 10px 0 0; padding: 9px 11px; background: var(--error-bg); border-radius: 7px; }
.auth-submit { width: 100%; margin-top: 18px; padding: 12px; border-radius: var(--radius-btn); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--text-secondary); }
.auth-switch a { font-weight: 600; }
.auth-ok { font-size: 13px; color: var(--success); margin: 0 0 16px; padding: 9px 11px; background: var(--success-bg); border-radius: 7px; }

/* Campo-isca do cadastro: sai da tela sem usar display:none, que alguns
   robôs sabem ignorar. Ninguém vê, ninguém tabula até ele. */
.campo-isca { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Meu cadastro ---------- */
.field select { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--input-border); border-radius: 7px; font-size: 14.5px; font-family: inherit; color: inherit; background: white; }
.field label .opcional { font-weight: 500; color: var(--text-muted); text-transform: none; }
.conta-card { max-width: 480px; }
.conta-secao { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--card-border); }
.conta-secao h3 { font-family: Lora, serif; font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--navy-title); }
.conta-dica { font-size: 12.5px; color: var(--text-secondary); margin: 0 0 16px; }

/* ---------- Course shell ---------- */
.course-shell { flex: 1; display: flex; align-items: flex-start; max-width: 1180px; margin: 0 auto; width: 100%; gap: 28px; padding: 28px 24px 60px; }

.sidebar { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.progress-card { background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 16px 18px; }
.progress-card .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-card .label { font-size: 13px; font-weight: 600; }
.progress-card .pct { font-size: 13px; font-weight: 700; color: var(--navy); }
.progress-track { height: 7px; border-radius: 5px; background: oklch(92% 0.01 85); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 5px; background: var(--orange); }
.progress-card .sub { font-size: 11.5px; color: var(--text-muted); margin-top: 7px; }

.nav-card { background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 8px; max-height: calc(100vh - 250px); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.nav-item.locked { cursor: default; }
.nav-item .info { flex: 1; min-width: 0; }
.nav-item .badge-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-muted); }
.nav-item .item-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .mark { flex-shrink: 0; display: flex; align-items: center; }
.nav-item .mark svg { display: block; }
.nav-section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-faint); padding: 14px 12px 6px; }

/* Atalho para a revisão, recuado sob a lição a que pertence. */
.nav-revisao { display: flex; align-items: center; gap: 7px; margin: -4px 0 2px; padding: 5px 12px 5px 26px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-secondary); }
.nav-revisao:hover { background: var(--accent-tint); color: var(--navy); }
.nav-revisao.ativa { background: var(--accent-tint); color: var(--navy); font-weight: 600; }
.nav-revisao .seta { color: var(--text-faint); font-size: 12px; line-height: 1; }
.nav-revisao .texto { flex: 1; }
.nav-revisao .nota { font-size: 11px; font-weight: 700; color: var(--success); }

.course-content { flex: 1; min-width: 0; }

/* ---------- Lesson ---------- */
.lesson-badge { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; }
.lesson-title { font-family: Lora, serif; font-size: 29px; font-weight: 700; margin: 0 0 22px; line-height: 1.25; color: var(--navy-title); }

.topic-card { background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 22px 24px; margin-bottom: 16px; }
/* Sem text-transform: o nome do tópico vem do banco já na forma correta, e
   forçar caixa alta aqui apagaria a distinção entre "Espírito Santo" e
   "santo" — além de somar maiúsculas onde o alemão já capitaliza os
   substantivos. Um pouco maior para compensar a perda de peso visual. */
.topic-card .topic-subtitle { font-family: Lora, serif; font-weight: 700; font-size: 16.5px; letter-spacing: .01em; color: var(--navy); margin-bottom: 14px; }
.topic-body { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.topic-figure { width: 300px; max-width: 100%; height: 159px; flex-shrink: 0; border-radius: 10px; object-fit: cover; }
.topic-figure.topic-figure-placeholder { background: oklch(95% 0.01 85); border: 1px dashed oklch(80% 0.01 85); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11.5px; color: var(--text-muted); padding: 8px; box-sizing: border-box; }
.topic-text { flex: 1; min-width: 220px; }
.topic-quote { font-size: 15.5px; line-height: 1.65; font-style: italic; padding: 12px 16px; background: var(--accent-tint); border-left: 3px solid var(--orange-strong); border-radius: 0 8px 8px 0; margin-bottom: 6px; }
.topic-reference { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; margin-bottom: 12px; }
.topic-explanation { font-size: 14.5px; line-height: 1.7; color: oklch(30% 0.015 85); }

.start-review { margin-top: 8px; border: 1.5px solid var(--navy); border-radius: var(--radius-card); padding: 18px 22px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: var(--bg-header); }
.start-review .label { font-weight: 700; font-size: 15px; color: var(--navy); letter-spacing: .02em; text-transform: uppercase; }

/* ---------- Quiz ---------- */
.quiz-wrap { max-width: 640px; }
.quiz-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.quiz-progress-label { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); }
.quiz-header .lesson-name { font-size: 12.5px; color: var(--text-secondary); }
.quiz-track { height: 6px; border-radius: 4px; background: oklch(92% 0.01 85); overflow: hidden; margin-bottom: 26px; }
.quiz-fill { height: 100%; border-radius: 4px; background: var(--navy); }
.quiz-stem { font-family: Lora, serif; font-size: 21px; font-weight: 700; margin: 0 0 20px; line-height: 1.4; color: var(--navy-title); }

.quiz-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; border: 1.5px solid var(--card-border); background: white; cursor: pointer; margin-bottom: 10px; }
.quiz-option.selected { border-color: var(--navy); background: var(--accent-tint); }
.quiz-option .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid oklch(75% 0.01 85); background: transparent; flex-shrink: 0; margin-top: 2px; }
.quiz-option.selected .dot { border-color: var(--navy); background: var(--navy); }
.quiz-option .text { font-size: 15px; line-height: 1.55; }

/* ---------- Revisão já aprovada (somente leitura) ---------- */
.revisao-resumo { display: flex; align-items: center; gap: 18px; background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 18px 22px; margin-bottom: 22px; }
.revisao-resumo .nota { font-family: Lora, serif; font-size: 34px; font-weight: 700; color: var(--success); line-height: 1; }
.revisao-resumo p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.revisao-resumo .tentativas { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.revisao-questao { background: white; border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 20px 22px; margin-bottom: 16px; }
.revisao-cabecalho { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.revisao-cabecalho .numero { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); }
.revisao-questao h3 { font-family: Lora, serif; font-size: 18px; font-weight: 700; margin: 0 0 14px; color: var(--navy-title); line-height: 1.35; }

.situacao { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.situacao.acertou { background: var(--success-bg); color: var(--success); }
.situacao.errou { background: var(--error-bg); color: var(--error); }

/* Sem cursor de clique: aqui não há nada para escolher, a revisão está fechada. */
.revisao-opcao { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--card-border); background: white; margin-bottom: 8px; }
.revisao-opcao .marca { width: 20px; flex-shrink: 0; font-weight: 700; text-align: center; line-height: 1.5; color: var(--text-faint); }
.revisao-opcao .text { flex: 1; font-size: 14.5px; line-height: 1.55; }
.revisao-opcao .etiqueta { flex-shrink: 0; align-self: center; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.revisao-opcao.certa { border-color: var(--success); background: var(--success-bg); }
.revisao-opcao.certa .marca { color: var(--success); }
.revisao-opcao.errada { border-color: var(--error); background: var(--error-bg); }
.revisao-opcao.errada .marca { color: var(--error); }

.revisao-gabarito { font-size: 13px; color: var(--text-secondary); margin-top: 10px; }
.revisao-rodape { margin-top: 20px; }

.quiz-actions { display: flex; justify-content: space-between; margin-top: 24px; }
.quiz-actions .btn { padding: 11px 22px; font-size: 14px; }
.quiz-actions .btn-primary { padding: 11px 26px; }

/* ---------- Result ---------- */
.result-card { max-width: 460px; background: white; border: 1px solid var(--card-border); border-radius: 16px; padding: 36px 32px; text-align: center; }
.result-badge { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: Lora, serif; font-size: 26px; font-weight: 700; margin: 0 auto 20px; }
.result-card h2 { font-family: Lora, serif; font-size: 23px; font-weight: 700; margin: 0 0 10px; color: var(--navy-title); }
.result-card p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 26px; }
.result-card .btn-primary { width: 100%; padding: 13px; }

/* ---------- Certificate ---------- */
.certificate-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.certificate-card { width: 100%; max-width: 640px; background: white; border: 2px solid var(--orange); border-radius: 6px; padding: 52px 44px; text-align: center; }
.certificate-card .brand-line { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.certificate-card h1 { font-family: Lora, serif; font-size: 26px; font-weight: 700; margin: 0 0 22px; color: var(--navy-title); }
.certificate-card .granted-to { font-size: 14px; color: var(--text-secondary); margin: 0 0 6px; }
.certificate-card .student-name { font-family: Lora, serif; font-size: 28px; font-weight: 700; margin: 0 0 22px; }
.certificate-card .body-text { font-size: 14.5px; line-height: 1.7; color: oklch(30% 0.02 85); max-width: 460px; margin: 0 auto 26px; }
.certificate-card .date { font-size: 13px; color: var(--text-secondary); }
.certificate-card .signature { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--card-border); font-family: Lora, serif; font-style: italic; font-size: 14.5px; color: oklch(35% 0.02 85); }
.certificate-card .back-link { font-size: 13.5px; font-weight: 600; display: inline-block; margin-top: 24px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 18px 20px; font-size: 12px; color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .course-shell { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
  .nav-card { max-height: none; }
}

@media (max-width: 480px) {
  .header { padding: 12px 16px; }
  .hero { padding: 44px 16px 28px; }
  .hero h1 { font-size: 28px; }
  .course-shell { padding: 20px 16px 44px; }
  .auth-card { padding: 26px 20px; }
}
