/* ============================================================
   O Guia da Renda Extra — Área de Membros
   Tema: editorial financeiro premium (tinta verde + dourado)
   ============================================================ */

:root {
  --ink-0: #0b100d;
  --ink-1: #101612;
  --ink-2: #151d18;
  --ink-3: #1c2620;
  --line: rgba(220, 194, 134, 0.13);
  --line-strong: rgba(220, 194, 134, 0.28);
  --gold: #d9a848;
  --gold-2: #e9cb84;
  --gold-deep: #9c7422;
  --cream: #f1ecdc;
  --cream-dim: #a5a394;
  --paper: #f8f3e6;
  --paper-2: #efe8d4;
  --paper-ink: #29271f;
  --paper-dim: #6f6a5a;
  --paper-line: #ddd3ba;
  --green: #7db894;
  --green-deep: #2e5c44;
  --red: #d98079;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --shadow-card: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  --sidebar-w: 268px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--cream);
  background-color: var(--ink-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Fundo atmosférico fixo (pseudo-elemento evita bugs de compositor
   que background-attachment: fixed causa em alguns navegadores). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(217, 168, 72, 0.09), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(46, 92, 68, 0.14), transparent 55%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }

::selection { background: rgba(217, 168, 72, 0.35); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink-0);
  padding: 0.6rem 1rem; z-index: 200; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.78rem 1.5rem;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }

.btn-gold {
  background: linear-gradient(160deg, var(--gold-2), var(--gold) 55%, #c3922f);
  color: #201704;
  box-shadow: 0 10px 24px -10px rgba(217, 168, 72, 0.55);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(217, 168, 72, 0.65); }
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--cream);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(220, 194, 134, 0.08); border-color: var(--gold); color: var(--gold-2); }

.btn-block { width: 100%; }

/* ---------- Formulários ---------- */

.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--cream-dim); margin-bottom: 0.45rem;
}
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field input {
  width: 100%; padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--cream);
  font-family: inherit; font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: rgba(165, 163, 148, 0.55); }
.field input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 168, 72, 0.18);
}
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.field-hint { font-size: 0.8rem; color: var(--cream-dim); margin-top: 0.4rem; }

.pw-toggle {
  background: none; border: none; color: var(--gold-2);
  font-size: 0.78rem; cursor: pointer; letter-spacing: 0.03em;
}
.pw-toggle:hover { text-decoration: underline; }

.form-error {
  background: rgba(217, 128, 121, 0.12);
  border: 1px solid rgba(217, 128, 121, 0.4);
  color: #f0b6b1; border-radius: 10px;
  padding: 0.7rem 0.9rem; font-size: 0.9rem; margin-bottom: 1rem;
}

.flash {
  border-radius: 12px; padding: 0.85rem 1.1rem; margin-bottom: 1.5rem;
  font-size: 0.95rem; border: 1px solid;
  animation: fade-up 0.4s ease both;
}
.flash-success {
  background: rgba(125, 184, 148, 0.1);
  border-color: rgba(125, 184, 148, 0.35); color: #b9dcc6;
}
.flash-error {
  background: rgba(217, 128, 121, 0.1);
  border-color: rgba(217, 128, 121, 0.35); color: #f0b6b1;
}

/* ============================================================
   Autenticação (login / registro)
   ============================================================ */

.auth-split { display: flex; min-height: 100vh; }

.auth-cover {
  flex: 1.15; position: relative; display: flex;
  align-items: center; justify-content: center;
  padding: 3rem;
  background:
    radial-gradient(700px 420px at 20% 15%, rgba(217, 168, 72, 0.14), transparent 60%),
    radial-gradient(800px 500px at 90% 90%, rgba(46, 92, 68, 0.35), transparent 60%),
    linear-gradient(160deg, #0e1410, #0a0f0c);
}
.cover-frame {
  max-width: 520px; width: 100%;
  border: 1px solid var(--line-strong);
  outline: 1px solid var(--line);
  outline-offset: 6px;
  padding: 3rem 2.75rem;
  animation: fade-up 0.7s ease both;
}
.cover-kicker {
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.4rem;
}
.cover-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-weight: 600; line-height: 1.08; margin-bottom: 1.1rem;
}
.cover-title em { font-style: italic; color: var(--gold-2); }
.cover-sub { color: var(--cream-dim); font-size: 1.02rem; margin-bottom: 1.8rem; }
.cover-list { list-style: none; display: grid; gap: 0.65rem; margin-bottom: 2rem; }
.cover-list li {
  padding-left: 1.6rem; position: relative; font-size: 0.95rem;
}
.cover-list li::before {
  content: ""; position: absolute; left: 0; top: 0.48em;
  width: 0.85rem; height: 1px; background: var(--gold);
}
.cover-rule { height: 1px; background: var(--line-strong); margin-bottom: 1.4rem; }
.cover-quote {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.15rem; color: var(--gold-2);
}

.auth-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; background: var(--ink-1);
  border-left: 1px solid var(--line);
}
.auth-card { width: 100%; max-width: 400px; animation: fade-up 0.55s ease 0.1s both; }
.auth-kicker {
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.5rem;
}
.auth-title {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 600;
  margin-bottom: 1.8rem;
}
.auth-alt { margin-top: 1.4rem; text-align: center; font-size: 0.92rem; color: var(--cream-dim); }
.auth-help { margin-top: 0.5rem; text-align: center; font-size: 0.82rem; color: var(--cream-dim); }
.auth-help a { color: var(--cream-dim); text-decoration: underline; }

/* ============================================================
   Shell interno (sidebar + main)
   ============================================================ */

.topbar {
  display: none; position: sticky; top: 0; z-index: 60;
  align-items: center; gap: 1rem;
  background: rgba(11, 16, 13, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 1rem;
}
.topbar-brand { font-family: var(--font-display); font-weight: 600; flex: 1; }
.topbar-progress { font-size: 0.85rem; color: var(--gold-2); font-weight: 600; }
.topbar-menu {
  width: 40px; height: 36px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: none; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.topbar-menu span { width: 16px; height: 1.5px; background: var(--cream); }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--ink-1);
  border-right: 1px solid var(--line);
  padding: 1.6rem 1.1rem 1.1rem;
  overflow-y: auto;
}

.sidebar-brand { display: flex; align-items: center; gap: 0.8rem; padding: 0 0.5rem 1.6rem; }
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  color: var(--gold-2);
  background: linear-gradient(160deg, #1d2620, #131a15);
  border: 1px solid var(--line-strong); border-radius: 11px;
}
.brand-text { line-height: 1.25; }
.brand-text strong { display: block; font-size: 0.95rem; font-weight: 600; }
.brand-text span {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold);
}

.sidebar-nav { display: grid; gap: 0.2rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.68rem 0.8rem; border-radius: 10px;
  color: var(--cream-dim); font-size: 0.94rem; font-weight: 500;
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-icon { width: 20px; height: 20px; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-item:hover { background: rgba(220, 194, 134, 0.06); color: var(--cream); }
.nav-item.is-active {
  background: rgba(217, 168, 72, 0.1); color: var(--gold-2);
  border-left-color: var(--gold);
}

.sidebar-progress {
  margin-top: auto; padding: 1rem 0.8rem;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 12px;
}
.sp-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cream-dim); margin-bottom: 0.55rem;
}
.sp-head strong { color: var(--gold-2); font-size: 0.95rem; letter-spacing: 0; }
.sp-bar {
  height: 6px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}
.sp-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-2));
  transition: width 0.6s ease;
}
.sp-note { display: block; font-size: 0.75rem; color: var(--cream-dim); margin-top: 0.5rem; }

.sidebar-user {
  display: flex; align-items: center; gap: 0.7rem;
  margin-top: 0.9rem; padding: 0.7rem 0.6rem;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--gold-2), var(--gold-deep));
  color: #201704; font-weight: 700; font-size: 0.95rem;
}
.sidebar-user-info { min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user-info strong { display: block; font-size: 0.88rem; }
.sidebar-user-info span {
  display: block; font-size: 0.72rem; color: var(--cream-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-logout {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--cream-dim);
}
.sidebar-logout svg { width: 18px; height: 18px; }
.sidebar-logout:hover { background: rgba(217, 128, 121, 0.12); color: var(--red); }

.sidebar-overlay { display: none; }

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 2.6rem clamp(1.2rem, 4vw, 3.2rem) 4rem;
  max-width: 1240px;
}

/* ---------- Cabeçalho de página ---------- */

.page-head { margin-bottom: 1.8rem; animation: fade-up 0.45s ease both; }
.page-kicker {
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.25rem;
}
.page-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1;
}
.page-sub { color: var(--cream-dim); margin-top: 0.6rem; max-width: 560px; }

/* ---------- Hero do dashboard ---------- */

.hero-card {
  display: flex; align-items: center; gap: 2.5rem;
  background:
    radial-gradient(500px 260px at 90% 0%, rgba(217, 168, 72, 0.12), transparent 65%),
    linear-gradient(155deg, var(--ink-3), var(--ink-1));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 2.2rem 2.4rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.4rem;
  animation: fade-up 0.5s ease 0.05s both;
}
.hero-info { flex: 1; min-width: 0; }
.hero-kicker {
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.5rem;
}
.hero-card h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.25;
  margin-bottom: 0.5rem;
}
.hero-text { color: var(--cream-dim); font-size: 0.98rem; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }

.hero-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 7; }
.ring-fill {
  fill: none; stroke: var(--gold);
  stroke-width: 7; stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}
.ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-label strong { font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-2); }
.ring-label span { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-dim); }

/* ---------- Métricas ---------- */

.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-bottom: 2.4rem;
}
.stat {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.1rem 1.3rem;
  animation: fade-up 0.5s ease both;
}
.stat:nth-child(2) { animation-delay: 0.06s; }
.stat:nth-child(3) { animation-delay: 0.12s; }
.stat-value {
  display: block; font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 600; color: var(--cream);
}
.stat-value em { font-style: normal; font-size: 1.05rem; color: var(--cream-dim); }
.stat-label {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cream-dim);
}

/* ---------- Seções de capítulos ---------- */

.part-section { margin-bottom: 2.4rem; }
.part-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.part-number {
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); white-space: nowrap;
}
.part-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.part-line { flex: 1; height: 1px; background: var(--line); }

.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem;
}
.chapter-card {
  display: flex; flex-direction: column; gap: 0.45rem;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.3rem;
  color: var(--cream);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  animation: fade-up 0.45s ease both;
}
.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--ink-3);
}
.chapter-card.is-next { border-color: rgba(217, 168, 72, 0.55); }
.chapter-card.is-read { opacity: 0.78; }

.cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc-number {
  font-family: var(--font-display); font-size: 1.05rem;
  color: var(--gold); font-weight: 600;
}
.cc-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 99px;
}
.cc-badge svg { width: 12px; height: 12px; }
.cc-done { background: rgba(125, 184, 148, 0.14); color: var(--green); }
.cc-up { background: rgba(217, 168, 72, 0.16); color: var(--gold-2); }
.cc-title { font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.cc-sub { font-size: 0.85rem; color: var(--cream-dim); line-height: 1.45; }
.cc-meta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: auto; padding-top: 0.6rem;
  font-size: 0.78rem; color: var(--cream-dim);
}
.cc-meta svg { width: 14px; height: 14px; }

/* ---------- Bônus ---------- */

.bonus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.bonus-card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem;
  color: var(--cream);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.bonus-card:hover { transform: translateY(-3px); border-color: rgba(217, 168, 72, 0.5); }
.bonus-icon {
  display: inline-flex; width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border-radius: 11px; margin-bottom: 0.9rem;
  background: rgba(217, 168, 72, 0.12); color: var(--gold-2);
}
.bonus-icon svg { width: 22px; height: 22px; }
.bonus-card h4 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.bonus-card p { font-size: 0.88rem; color: var(--cream-dim); }

/* ---------- Painéis genéricos ---------- */

.panel {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem;
  margin-bottom: 1.3rem;
  animation: fade-up 0.45s ease both;
}
.panel-muted { background: transparent; }
.panel-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.panel-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(217, 168, 72, 0.12); color: var(--gold-2);
}
.panel-icon svg { width: 22px; height: 22px; }
.panel-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.2rem; }
.panel-sub { font-size: 0.9rem; color: var(--cream-dim); }
.panel form { max-width: 460px; }

.feature-list { list-style: none; display: grid; gap: 0.55rem; margin-bottom: 1.3rem; }
.feature-list li { padding-left: 1.6rem; position: relative; font-size: 0.94rem; color: var(--cream-dim); }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 0.85rem; height: 1px; background: var(--gold);
}

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.3rem; align-items: start; }
.settings-grid .panel { margin-bottom: 0; }

.meta-list { display: grid; gap: 0.8rem; }
.meta-list div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; }
.meta-list dt { color: var(--cream-dim); font-size: 0.9rem; }
.meta-list dd { font-size: 0.9rem; font-weight: 600; text-align: right; }

.empty-state {
  text-align: center; padding: 4rem 1rem; color: var(--cream-dim);
}
.empty-state h2 { font-family: var(--font-display); color: var(--cream); margin-bottom: 0.5rem; }

/* ---------- Calculadora ---------- */

.calc { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; }
.calc-fields { max-width: none; }
.calc-result {
  background: var(--ink-1); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 1.3rem; align-self: start;
}
.calc-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
}
.calc-line span { font-size: 0.88rem; color: var(--cream-dim); flex: 1; }
.calc-line strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--gold-2); white-space: nowrap; }
.calc-line-muted strong { font-size: 1.05rem; color: var(--cream); }
.calc-note { font-size: 0.8rem; color: var(--cream-dim); margin-top: 0.8rem; }

/* ============================================================
   Leitor do ebook
   ============================================================ */

.reader {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.6rem;
  align-items: start;
}

.reader-rail {
  position: sticky; top: 1.5rem;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  max-height: calc(100vh - 3rem); display: flex; flex-direction: column;
}
.rail-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1rem 1.1rem 0.8rem;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cream-dim); border-bottom: 1px solid var(--line);
}
.rail-head strong { color: var(--gold-2); letter-spacing: 0.02em; }
.rail-list { overflow-y: auto; padding: 0.5rem; }
.rail-item {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.55rem 0.6rem; border-radius: 9px;
  color: var(--cream-dim); font-size: 0.85rem; line-height: 1.35;
}
.rail-item:hover { background: rgba(220, 194, 134, 0.06); color: var(--cream); }
.rail-item.is-current { background: rgba(217, 168, 72, 0.12); color: var(--gold-2); }
.rail-num {
  width: 20px; flex-shrink: 0; margin-top: 0.05em;
  font-family: var(--font-display); font-size: 0.8rem; color: var(--gold);
}
.rail-num svg { width: 14px; height: 14px; color: var(--green); }
.rail-item.is-done .rail-title { opacity: 0.65; }

/* Papel de leitura */

.paper {
  background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: fade-up 0.5s ease both;
}

.paper-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 2.2rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--paper-line);
}
.paper-crumb {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-dim);
}
.font-controls { display: flex; gap: 0.3rem; }
.font-controls button {
  min-width: 32px; height: 30px; padding: 0 0.4rem;
  background: none; border: 1px solid var(--paper-line); border-radius: 7px;
  color: var(--paper-dim); font-family: var(--font-display); font-size: 0.9rem;
  cursor: pointer;
}
.font-controls button span { font-size: 0.7em; vertical-align: super; }
.font-controls button.is-active { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }

.paper-head { padding: 2.6rem 2.2rem 0; max-width: 760px; margin: 0 auto; }
.paper-kicker {
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: #a1793a; margin-bottom: 0.7rem;
}
.paper-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.12;
  margin-bottom: 0.6rem;
}
.paper-subtitle {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.12rem; color: var(--paper-dim);
  padding-bottom: 1.4rem; border-bottom: 1px solid var(--paper-line);
}

.paper-body {
  padding: 1.8rem 2.2rem 2.6rem; max-width: 760px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.8;
}
.paper[data-font="small"]  .paper-body { font-size: 0.95rem; }
.paper[data-font="large"]  .paper-body { font-size: 1.18rem; }

.paper-body p { margin-bottom: 1.1em; }
.paper-body h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.5em; line-height: 1.25;
  margin: 1.8em 0 0.7em;
}
.paper-body h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.18em; margin: 1.5em 0 0.55em;
}
.paper-body h4 { font-size: 1em; margin-bottom: 0.4em; }
.paper-body ul, .paper-body ol { margin: 0 0 1.2em 1.4em; }
.paper-body li { margin-bottom: 0.45em; }
.paper-body a { color: #8a6420; text-decoration: underline; }

.paper-body > p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.1em; line-height: 0.85;
  float: left; padding: 0.08em 0.12em 0 0;
  color: #a1793a;
}

.paper-body blockquote {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.22em; line-height: 1.5; color: #4c4636;
  border-left: 3px solid var(--gold); margin: 1.6em 0;
  padding: 0.3em 0 0.3em 1.2em;
}

.paper-body .box {
  border-radius: 12px; padding: 1.2em 1.4em; margin: 1.6em 0;
  font-size: 0.97em;
}
.paper-body .box h4 {
  font-size: 0.78em; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 0.7em;
}
.paper-body .box p:last-child, .paper-body .box ul:last-child, .paper-body .box ol:last-child { margin-bottom: 0; }
.paper-body .box-tip { background: #f0e7cd; border: 1px solid #dbcda3; }
.paper-body .box-tip h4 { color: #8a6420; }
.paper-body .box-warn { background: #f3e0d8; border: 1px solid #e0c0b2; }
.paper-body .box-warn h4 { color: #a05237; }
.paper-body .box-action { background: #e7ecdd; border: 1px solid #c8d3b4; }
.paper-body .box-action h4 { color: var(--green-deep); }

.paper-body ul.checklist { list-style: none; margin-left: 0; }
.paper-body ul.checklist li {
  position: relative; padding-left: 2em; margin-bottom: 0.6em;
}
.paper-body ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.22em;
  width: 1em; height: 1em;
  border: 1.5px solid #a1793a; border-radius: 4px;
}

.paper-body table.tbl {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: 0.92em; line-height: 1.5;
}
.paper-body table.tbl th {
  text-align: left; font-size: 0.8em; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8a6420; border-bottom: 2px solid #cbbd94;
  padding: 0.5em 0.7em;
}
.paper-body table.tbl td {
  border-bottom: 1px solid var(--paper-line); padding: 0.65em 0.7em;
  vertical-align: top;
}

.paper-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center;
  padding: 1.4rem 2.2rem; border-top: 1px solid var(--paper-line);
  background: var(--paper-2);
}
.paper-nav-link { display: flex; flex-direction: column; color: var(--paper-dim); min-width: 0; }
.paper-nav-link span { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.paper-nav-link strong {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--paper-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paper-nav-link:hover strong { color: #8a6420; }
.paper-nav-link.next { text-align: right; align-items: flex-end; }
.paper-complete { text-align: center; }

/* ============================================================
   Certificado
   ============================================================ */

.cert-locked { text-align: center; padding: 3rem 2rem; }
.cert-lock-icon {
  display: inline-flex; width: 54px; height: 54px;
  align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 1rem;
  background: rgba(217, 168, 72, 0.12); color: var(--gold-2);
}
.cert-lock-icon svg { width: 26px; height: 26px; }
.cert-locked h3 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.6rem; }
.cert-locked p { color: var(--cream-dim); max-width: 460px; margin: 0 auto 1.2rem; }
.cert-bar { max-width: 320px; margin: 0 auto 1.6rem; }

.cert-actions { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.cert-tip { font-size: 0.82rem; color: var(--cream-dim); }

.certificate {
  background: var(--paper); color: var(--paper-ink);
  border-radius: 6px; padding: clamp(1.2rem, 3vw, 2.4rem);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  max-width: 900px;
}
.cert-border {
  border: 2px solid #b3924f; outline: 1px solid #d8c391; outline-offset: 5px;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}
.cert-brand {
  font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: #8a6420; margin-bottom: 2rem;
}
.cert-label {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 500;
  margin-bottom: 1.6rem;
}
.cert-conferido {
  font-size: 0.85rem; font-style: italic; color: var(--paper-dim); margin-bottom: 0.4rem;
}
.cert-name {
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15;
  margin-bottom: 1.4rem; color: #201d14;
}
.cert-text { max-width: 560px; margin: 0 auto 2.6rem; font-size: 0.98rem; line-height: 1.7; color: #4c4636; }
.cert-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.cert-foot-item { flex: 1; font-size: 0.8rem; color: var(--paper-dim); }
.cert-foot-line { display: block; border-top: 1px solid #b3924f; margin-bottom: 0.5rem; }
.cert-seal {
  width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #e9cb84, #b3924f);
  color: #201704; font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25), 0 6px 16px -6px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Página de impressão (checklist)
   ============================================================ */

.print-page { background: var(--ink-0); padding: 2rem clamp(1rem, 4vw, 3rem); }
.print-toolbar {
  display: flex; justify-content: space-between; gap: 1rem;
  max-width: 900px; margin: 0 auto 1.5rem;
}
.checklist-sheet {
  background: #fff; color: #1c1a14;
  max-width: 900px; margin: 0 auto;
  padding: clamp(1.8rem, 4vw, 3rem);
  border-radius: 6px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}
.cs-head { text-align: center; border-bottom: 2px solid #1c1a14; padding-bottom: 1.2rem; margin-bottom: 1.6rem; }
.cs-brand { font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase; color: #8a6420; margin-bottom: 0.5rem; }
.cs-head h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin-bottom: 0.8rem; }
.cs-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: #55523f; flex-wrap: wrap; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
.cs-week h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 0.2rem; }
.cs-goal { font-size: 0.8rem; font-style: italic; color: #8a6420; margin-bottom: 0.7rem; }
.cs-week ul { list-style: none; }
.cs-week li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.86rem; line-height: 1.45; margin-bottom: 0.5rem; }
.cs-box {
  width: 0.95em; height: 0.95em; flex-shrink: 0; margin-top: 0.18em;
  border: 1.5px solid #1c1a14; border-radius: 3px;
}
.cs-foot { border-top: 1px solid #d9d4c0; margin-top: 1.6rem; padding-top: 1rem; text-align: center; }
.cs-foot p { font-size: 0.82rem; font-style: italic; color: #55523f; }

/* ============================================================
   Animações e responsivo
   ============================================================ */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1100px) {
  .reader { grid-template-columns: 1fr; }
  .reader-rail { position: static; max-height: none; }
  .rail-list { display: grid; grid-template-columns: 1fr 1fr; }
  .calc { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar { display: flex; }
  .sidebar {
    transform: translateX(-105%); transition: transform 0.25s ease;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 70;
    background: rgba(5, 8, 6, 0.6); backdrop-filter: blur(2px);
  }
  .main { margin-left: 0; padding-top: 1.6rem; }
  .hero-card { flex-direction: column-reverse; align-items: flex-start; gap: 1.4rem; }
  .stats-row { grid-template-columns: 1fr; }
  .auth-cover { display: none; }
  .auth-panel { border-left: none; }
  .paper-toolbar, .paper-head, .paper-body, .paper-nav { padding-left: 1.3rem; padding-right: 1.3rem; }
  .paper-nav { grid-template-columns: 1fr; }
  .paper-nav-link.next { text-align: left; align-items: flex-start; }
  .cert-foot { flex-direction: column; align-items: center; }
  .cs-grid { grid-template-columns: 1fr; }
  .rail-list { grid-template-columns: 1fr; }
}

/* ---------- Impressão ---------- */

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .sidebar-overlay, .no-print, .print-toolbar,
  .page-head, .cert-actions, .flash { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .certificate, .checklist-sheet { box-shadow: none; border-radius: 0; max-width: none; }
  .print-page { padding: 0; }
  .cs-grid { grid-template-columns: 1fr 1fr; }
}
