/* ============================================================
   Área de Membros — Autchronos · "Instagram que traz cliente"
   mobile-first, leitura confortável, botões grandes
   Identidade visual: design/IDENTIDADE-VISUAL.md + design/tokens.css
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* ----- Cores base ----- */
  --bg:      #f7f6fb;   /* fundo geral (off-white com leve toque roxo) */
  --card:    #ffffff;   /* cartões e superfícies */
  --ink:     #1c1633;   /* texto principal (quase preto roxo) */
  --muted:   #6c6585;   /* texto secundário / legendas */
  --line:    #e8e5f2;   /* bordas e divisórias */

  /* ----- Cores da marca (conceito 01) ----- */
  --brand:   #534AB7;   /* roxo vivo — foco de inputs, detalhes, acentos */
  --brand-2: #3C3489;   /* roxo profundo — títulos, wordmark, texto de marca */
  --accent:  #D85A30;   /* CORAL — conversão: CTAs "quero", selos "traz cliente" */
  --accent-soft: #fbeee8; /* fundo suave do coral (avisos/destaques) */

  /* gradiente roxo da marca (botões primários, barra de progresso, certificado) */
  --grad: linear-gradient(135deg, #7F77DD 0%, #534AB7 55%, #3C3489 100%);

  /* ----- Cores de apoio ----- */
  --ok:    #1f9d55;     /* sucesso / concluído */
  --whats: #25d366;     /* botão de WhatsApp */

  /* ----- Tipografia ----- */
  --font-head: 'Poppins', system-ui, "Segoe UI", sans-serif; /* títulos */
  --font-body: 'Inter', system-ui, "Segoe UI", sans-serif;   /* corpo */

  /* ----- Forma ----- */
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 3px rgba(60, 30, 90, 0.06);
  --shadow: 0 4px 20px rgba(60, 30, 90, 0.06);
  --shadow-lg: 0 16px 48px rgba(60, 30, 90, 0.10);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .module-num, .cert-name { font-family: var(--font-head); letter-spacing: -0.02em; }

/* Fade-in calmo ao carregar a tela */
main { animation: fade-up .45s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  * { scroll-behavior: auto !important; }
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .92rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; min-height: 54px; padding: 15px 24px; border: 0; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-size: 1.02rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(216, 90, 48, .28); }
.btn-accent:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(216, 90, 48, .32); }
.btn-secondary { background: #efeafb; color: var(--brand-2); }
.btn-secondary:hover { background: #e7e0f7; }
.btn-whats { background: var(--whats); color: #fff; }
.btn-whats:hover { filter: brightness(1.04); }
.btn-block { width: 100%; margin-top: 8px; }
.btn-link {
  background: none; border: 0; color: var(--brand-2);
  font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: rgba(255,255,255,.85);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: .98rem; color: var(--brand-2); }
.topbar-logo { height: 28px; width: auto; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.auth-logo { height: 60px; width: auto; margin: 0 auto 6px; display: block; }

/* ---------- Container ---------- */
.container { max-width: 660px; margin: 0 auto; padding: 36px 20px 72px; }
.container > h1 { font-size: 1.6rem; margin-bottom: 18px; }

/* ---------- Login / Cadastro ---------- */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(70% 55% at 50% -10%, rgba(127,119,221,.22), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 410px; background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 32px 28px;
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 1.35rem; }
.auth-head p { color: var(--muted); font-size: .92rem; }
.tabs { display: flex; background: #f1edfa; border-radius: 12px; padding: 5px; margin-bottom: 22px; }
.tab {
  flex: 1; padding: 11px; border: 0; background: none; border-radius: 9px;
  font-family: var(--font-head); font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tab.active { background: #fff; color: var(--brand-2); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url] {
  padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; color: var(--ink); background: #fff; font-family: var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(83,74,183,.14); }
.auth-form .btn { margin-top: 4px; }
.auth-msg { margin-top: 14px; font-size: .9rem; text-align: center; min-height: 1.2em; }
.auth-msg.is-error { color: #c0392b; }
.auth-msg.is-ok { color: var(--ok); }

/* ---------- Herói do dashboard: anel de progresso ---------- */
.dash-hero { text-align: center; margin-bottom: 40px; }
.ring { position: relative; width: 168px; height: 168px; margin: 0 auto 20px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #e9e4f5; stroke-width: 11; }
.ring-prog {
  fill: none; stroke: url(#ringGrad); stroke-width: 11; stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22,.61,.36,1);
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-pct { font-family: var(--font-head); font-weight: 700; font-size: 2.5rem; color: var(--brand-2); line-height: 1; }
.ring-cap { font-size: .78rem; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.dash-greeting { font-size: 1.7rem; margin-bottom: 4px; }
.dash-sub { color: var(--muted); }

/* ---------- A trilha de módulos ---------- */
.trail { display: flex; flex-direction: column; }
.trail-item {
  display: grid; grid-template-columns: 38px 1fr; gap: 16px;
  text-decoration: none; color: inherit;
}
.trail-rail { display: flex; flex-direction: column; align-items: center; }
.trail-dot {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600;
  font-size: .95rem; background: #ece8f5; color: var(--muted);
  border: 2px solid transparent; transition: transform .15s ease;
}
.trail-line { flex: 1; width: 2px; min-height: 26px; background: #e4dff2; margin: 4px 0; }
.trail-item.is-done .trail-dot { background: var(--brand-2); color: #fff; }
.trail-item.is-done .trail-line { background: var(--brand); }
.trail-item.is-current .trail-dot {
  background: #fff; color: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(216,90,48,.14);
}
.trail-card {
  flex: 1; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: transform .15s ease, box-shadow .25s ease, border-color .2s ease;
}
a.trail-item:hover .trail-card { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.trail-item:hover .trail-dot { transform: scale(1.06); }
.trail-item.is-current .trail-card { border-color: rgba(216,90,48,.35); }
.trail-item.is-locked { cursor: not-allowed; }
.trail-item.is-locked .trail-card { opacity: .6; box-shadow: none; background: #faf9fd; }
.trail-kicker { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.trail-title { font-size: 1.08rem; margin: 2px 0 1px; }
.trail-sub { color: var(--muted); font-size: .88rem; }
.trail-action { flex: 0 0 auto; font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--brand-2); white-space: nowrap; }
.trail-item.is-current .trail-action { color: var(--accent); }
.trail-item.is-locked .trail-action { color: var(--muted); font-weight: 500; }
.trail-item.is-done .trail-action { color: var(--ok); }

/* ---------- Conclusão / mentoria ---------- */
.completion { margin-top: 36px; display: flex; flex-direction: column; gap: 18px; }
.completion-card {
  border-radius: var(--radius); padding: 32px 26px; text-align: center; color: #fff;
  background: var(--grad); box-shadow: var(--shadow-lg);
}
.completion-card h2 { margin-bottom: 8px; font-size: 1.4rem; }
.completion-card p { color: rgba(255,255,255,.88); margin-bottom: 20px; }
.completion-card .btn-accent { box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.mentoria-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); text-align: center;
}
.mentoria-badge {
  display: inline-block; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 600; padding: 6px 14px; border-radius: 99px;
}
.mentoria-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.mentoria-card p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Leitura do módulo ---------- */
.reading { max-width: 640px; }
.module-header { margin-bottom: 14px; }
.module-kicker { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.module-header h1 { font-size: 1.75rem; margin-top: 6px; }
.module-subtitle { color: var(--muted); margin-top: 6px; font-size: 1.02rem; }
.read-meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: .85rem; margin-top: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.ebook { font-size: 1.08rem; line-height: 1.75; margin-top: 26px; }
.ebook h1, .ebook h2, .ebook h3 { margin: 1.6em 0 .5em; line-height: 1.25; font-family: var(--font-head); }
.ebook h2 { font-size: 1.35rem; color: var(--brand-2); }
.ebook h3 { font-size: 1.12rem; }
.ebook p { margin: 0 0 1.1em; }
.ebook ul, .ebook ol { margin: 0 0 1.1em 1.2em; }
.ebook li { margin-bottom: .5em; }
.ebook blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.4em 0; color: var(--ink);
}
.ebook strong { color: var(--brand-2); }
.ebook code { background: #efeafb; color: var(--brand-2); padding: .12em .4em; border-radius: 6px; font-size: .9em; }
.ebook img { max-width: 100%; border-radius: 10px; }

/* ---------- Leitura em páginas (stepper) ---------- */
.step-progress { height: 6px; background: #ece6f2; border-radius: 99px; overflow: hidden; margin-top: 18px; }
.step-progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .4s ease; }
#step-label { margin-left: auto; font-weight: 600; color: var(--brand-2); }
.reader { min-height: 42vh; }
.topic.ebook { margin-top: 22px; }
.fade-in-step { animation: fade-up .4s ease both; }
@media (prefers-reduced-motion: reduce) { .fade-in-step { animation: none; } }

.stepper {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 12px; padding: 16px 0 20px;
  margin-top: 16px;
  background: linear-gradient(to top, var(--bg) 72%, rgba(247,246,251,0));
}
.stepper .btn { flex: 1; }
.final-step { margin-top: 8px; }

/* ---------- Upload antes/depois ---------- */
.ba-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.ba-upload { gap: 0; }
.ba-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 24px 16px; border: 2px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--brand-2); font-weight: 600; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.ba-drop:hover { border-color: var(--brand); background: #faf8fd; }
.ba-preview { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-top: 4px; }
@media (min-width: 560px) { .ba-grid { flex-direction: row; } .ba-grid .ba-block { flex: 1; } }

/* ---------- Cards de seção ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin: 28px 0;
}
.card h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* ---------- Tarefas ---------- */
.tasks { display: flex; flex-direction: column; gap: 2px; }
.task-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 12px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500;
  transition: background .15s ease;
}
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-row:hover { background: #faf8fd; }
.task-row input {
  width: 24px; height: 24px; margin-top: 1px; accent-color: var(--accent);
  flex: 0 0 auto; cursor: pointer; transition: transform .12s ease;
}
.task-row input:checked { transform: scale(1.08); }
.task-row input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

/* ---------- Antes/Depois ---------- */
#ba-form { display: flex; flex-direction: column; gap: 16px; }
.ba-block {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ba-block strong { color: var(--brand-2); letter-spacing: .06em; font-size: .75rem; text-transform: uppercase; }
.ba-focus { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Certificado ----------
   Tudo escala com a largura do certificado (unidades de container query),
   então o conteúdo nunca é cortado, em nenhum tamanho de tela. */
.cert-page { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.certificate {
  position: relative; overflow: hidden; container-type: size;
  width: 100%; max-width: 660px; aspect-ratio: 1.414 / 1;
  background: #fff; border: 2px solid var(--brand);
  border-radius: 10px; padding: 1.2cqw;
}
.cert-watermark {
  position: absolute; top: 50%; left: 50%;
  width: 52%; transform: translate(-50%, -50%);
  opacity: 0.05; pointer-events: none; z-index: 0;
}
.cert-inner {
  position: relative; z-index: 1;
  height: 100%; border: 1.5px solid var(--brand-2); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 5cqw; gap: 1.3cqw;
}
.cert-logo { height: 7cqw; width: auto; margin-bottom: 1cqw; }
.cert-kicker { letter-spacing: .12em; font-size: 1.7cqw; color: var(--brand); font-weight: 600; }
.cert-text { color: var(--muted); font-size: 2.2cqw; }
.cert-name {
  font-size: 5.2cqw; line-height: 1.15; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; padding: .3cqw 0;
}
.cert-course { font-size: 3.3cqw; color: var(--brand-2); }
/* No PDF (html2canvas não renderiza gradiente em texto): nome em cor sólida */
.certificate.pdf-rendering .cert-name {
  background: none; -webkit-text-fill-color: var(--brand-2); color: var(--brand-2);
}
.cert-date { color: var(--muted); font-size: 1.9cqw; margin-top: 1.4cqw; }

/* Assinatura */
.cert-sign { margin-top: 3cqw; display: flex; flex-direction: column; align-items: center; }
.cert-sign-mark { width: 13cqw; height: auto; display: block; transform: rotate(-3deg); }
.cert-sign-line { width: 24cqw; height: 1px; background: var(--ink); opacity: .35; margin: .6cqw 0 1cqw; }
.cert-sign-who { font-size: 2.1cqw; color: var(--brand-2); font-weight: 600; }
.cert-sign-role { font-size: 1.6cqw; color: var(--muted); }
.cert-sign-note { font-size: 1.4cqw; color: var(--muted); font-style: italic; margin-top: .5cqw; }

@media (min-width: 600px) {
  .container > h1 { font-size: 1.8rem; }
  .dash-greeting { font-size: 2rem; }
  .ring { width: 190px; height: 190px; }
  .ring-pct { font-size: 2.8rem; }
  .module-header h1 { font-size: 2rem; }
}
