/* Lapidação Trina — identidade visual
   Cores extraídas do logo: dourado, grafite e creme; rosé do planner/Instagram como apoio.
   Todo texto usa combinações com contraste mínimo de 4,5:1 (WCAG AA). */
:root {
  --ink: #2b2725;          /* grafite do logo — texto principal (≈14:1 sobre creme) */
  --ink-soft: #4d4640;     /* texto secundário (≈8,5:1 sobre creme) */
  --gold: #b8902f;         /* dourado do logo — detalhes, bordas, fundos de botão */
  --gold-light: #e6c877;   /* dourado claro — texto sobre fundo grafite (≈9:1) */
  --gold-deep: #6f5209;    /* dourado escuro — texto dourado sobre claro (≈7,5:1) */
  --cream: #f9e6e4;        /* fundo geral */
  --paper: #ffffff;
  --blush: #f2cfcc;        /* rosé claro — fundos de destaque */
  --rose: #d4a09e;      /* rosa do logo — cor dominante */
  --wine: #d4a09e;         /* rosé vinho — superfícies escuras do sistema (texto creme ≈11:1) */
  --wine-2: #7d3d4a;
  --rose-deep: #7a3a3f;    /* texto rosé escuro sobre blush (≈7:1) */
  --line: #e0bdb9;
  --ok: #24603f;
  --ok-bg: #e3f1e8;
  --err: #8f2626;
  --err-bg: #fbe6e4;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(43, 39, 37, .08);
  --serif: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --sans: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0 0 .4em; line-height: 1.15; color: var(--ink); }
h1 { font-size: 2.2rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--gold-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1.5px solid transparent; border-radius: 999px; padding: .65rem 1.3rem; font: 600 .9rem var(--sans); cursor: pointer; text-decoration: none; transition: transform .1s, box-shadow .15s, background .15s; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #e0bf6a, #b8902f); color: var(--ink); box-shadow: 0 3px 10px rgba(184, 144, 47, .35); }
.btn-primary:hover { background: linear-gradient(135deg, #ebcf80, #c59a33); color: var(--ink); }
.btn-dark { background: var(--rose-deep); color: var(--cream); }
.btn-dark:hover { background: #000; color: var(--cream); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; min-height: 36px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Formulários */
label { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 .3rem; color: var(--ink); }
input, select, textarea { width: 100%; font: 400 1rem var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid #b9a77f; border-radius: 10px; padding: .65rem .8rem; min-height: 44px; }
input::placeholder, textarea::placeholder { color: #6b635c; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(184, 144, 47, .45); border-color: var(--gold-deep); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold-deep); flex: none; }
.field { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Cartões e blocos */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-gold { border-top: 4px solid var(--gold); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.cards .card + .card { margin-top: 0; }
.stat { text-align: left; }
.stat .n { font: 600 2.2rem var(--serif); color: var(--ink); line-height: 1; }
.stat .l { font-size: .8rem; color: var(--ink-soft); margin-top: .35rem; }
.badge { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--blush); color: var(--rose-deep); }
.badge.gold { background: #f6ecd0; color: var(--gold-deep); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.dark { background: var(--rose-deep); color: var(--gold-light); }
.alert { padding: .8rem 1rem; border-radius: 10px; font-size: .92rem; margin-bottom: 1rem; }
.alert.err { background: var(--err-bg); color: var(--err); border: 1px solid #e3b4b0; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b4d6c1; }
.alert.info { background: var(--blush); color: var(--rose-deep); border: 1px solid var(--rose); }
.progress { height: 10px; background: #efe4cb; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #d4af55, #b8902f); border-radius: 99px; }
.divider { height: 1px; background: var(--line); margin: 1.2rem 0; border: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .8rem; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; background: var(--rose-deep); color: var(--gold-light); font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding: .75rem .9rem; white-space: nowrap; }
td { padding: .7rem .9rem; border-top: 1px solid #eee2c8; vertical-align: middle; }
tbody tr:hover { background: #fdf9f0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-soft); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(43, 39, 37, .65); display: flex; align-items: flex-start; justify-content: center; padding: 3vh 1rem; overflow-y: auto; z-index: 50; }
.modal { background: var(--cream); border-radius: 18px; width: 100%; max-width: 640px; padding: 1.6rem; border-top: 5px solid var(--gold); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.modal-head h3 { margin: 0; }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); padding: .2rem .5rem; border-radius: 8px; }
.x:hover { background: var(--blush); }

/* Toast */
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: calc(100% - 2rem); max-width: 420px; }
.toast { background: var(--rose-deep); color: var(--cream); padding: .75rem 1.2rem; border-radius: 12px; box-shadow: var(--shadow); border-left: 4px solid var(--gold-light); font-size: .92rem; }
.toast.err { border-left-color: #ff9d9d; }

/* ───────── Telas de entrada (login, ativar, formulários públicos) ───────── */
.auth-bg { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, #ecc3c1 0%, #d4a09e 55%, #c48d8b 100%); }
.auth-card { width: 100%; max-width: 440px; background: var(--cream); border-radius: 22px; padding: 2rem 1.8rem; border-top: 5px solid var(--gold); box-shadow: 0 24px 70px rgba(90, 42, 45, .35); }
.auth-card.wide { max-width: 560px; }
.auth-card .logo { display: block; width: 150px; margin: 0 auto .8rem; }
.auth-card h1 { text-align: center; font-size: 1.9rem; }
.auth-card .sub { text-align: center; color: var(--ink-soft); margin-bottom: 1.4rem; }
.auth-foot { text-align: center; font-size: .82rem; color: var(--ink-soft); margin-top: 1.2rem; }

/* ───────── Estrutura dos painéis ───────── */
.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, #e3b3b1, #cb9593); color: var(--ink); padding: 1.3rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { text-align: center; padding-bottom: 1rem; border-bottom: 1px solid rgba(43, 39, 37, .22); margin-bottom: 1rem; }
.side .brand img { width: 120px; }
.side .brand .tag { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: #5a2a2d; margin-top: .4rem; }
.side nav a, .side nav button.navbtn { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .9rem; border-radius: 10px; color: var(--ink); text-decoration: none; font: 500 .93rem var(--sans); background: none; border: 0; cursor: pointer; text-align: left; min-height: 44px; }
.side nav a:hover, .side nav button.navbtn:hover { background: rgba(255, 255, 255, .4); color: var(--ink); }
.side nav a.active { background: rgba(255, 255, 255, .6); color: #5a2a2d; box-shadow: inset 3px 0 0 #7a3a3f; font-weight: 700; }
.side .group { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: #5a2a2d; font-weight: 700; padding: 1rem .9rem .3rem; }
.side .who { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(43, 39, 37, .22); font-size: .85rem; }
.side .who b { display: block; color: var(--ink); }
.side .who span { color: var(--ink); word-break: break-all; }
.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; max-width: 1200px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 600 .85rem var(--sans); cursor: pointer; min-height: 38px; }
.tab.active { background: var(--rose-deep); color: var(--gold-light); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(90, 42, 45, .55); }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, #e3b3b1, #cb9593); color: var(--ink); padding: .6rem 1rem; position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 38px; }
  .topbar button { background: none; border: 1.5px solid var(--ink); color: var(--ink); border-radius: 10px; font-size: 1.2rem; padding: .3rem .8rem; cursor: pointer; min-height: 40px; }
  h1 { font-size: 1.8rem; }
}

/* ───────── Área de Membros ───────── */
.hero { background: linear-gradient(135deg, #ecc3c1 0%, #d4a09e 60%, #c48d8b 120%); color: var(--ink); border-radius: 20px; padding: 2rem; position: relative; overflow: hidden; border-bottom: 4px solid var(--gold); }
.hero h1, .hero h2 { color: var(--ink); }
.hero p { color: var(--ink); }
.hero .eyebrow { color: #5a2a2d; }
.hero img.mark { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); height: 150px; opacity: .9; }
@media (max-width: 700px) { .hero img.mark { display: none; } }
.pillar { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px; }
.pillar.geral { background: #f6ecd0; color: var(--gold-deep); }
.pillar.corpo { background: #f6ecd0; color: #5e4505; }
.pillar.alma { background: var(--blush); color: var(--rose-deep); }
.pillar.espirito { background: var(--rose-deep); color: var(--gold-light); }
.prog-card { display: flex; flex-direction: column; gap: .6rem; text-decoration: none; color: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.prog-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(43, 39, 37, .14); color: inherit; }
.prog-card .cover { height: 90px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #e3b3b1, #c48d8b); }
.prog-card .cover img { height: 62px; opacity: .95; }
.prog-card.corpo .cover { background: linear-gradient(135deg, #e6c877, #b8902f); }
.prog-card.alma .cover { background: linear-gradient(135deg, #f0cdca, #d4a09e); }
.prog-card.espirito .cover { background: linear-gradient(135deg, #8f4a52, #6b2f35); }
.prog-card.corpo .cover img, .prog-card.alma .cover img { filter: brightness(.3) contrast(1.2); }
.player { background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; width: 100%; border: 3px solid var(--rose-deep); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player.empty { display: grid; place-items: center; background: var(--rose-deep); color: var(--cream); text-align: center; padding: 1rem; }
.course-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 1000px) { .course-grid { grid-template-columns: 1fr; } }
.lesson-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lesson-list h4 { margin: 0; padding: .8rem 1rem; background: var(--rose-deep); color: var(--gold-light); font-family: var(--sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.lesson { display: flex; gap: .7rem; align-items: center; padding: .75rem 1rem; border-top: 1px solid #eee2c8; cursor: pointer; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: 500 .92rem var(--sans); color: var(--ink); min-height: 48px; }
.lesson:hover { background: #fdf9f0; }
.lesson.active { background: #f6ecd0; font-weight: 700; box-shadow: inset 4px 0 0 var(--gold); }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--gold-deep); flex: none; display: grid; place-items: center; font-size: .8rem; color: #fff; }
.lesson.done .dot { background: var(--ok); border-color: var(--ok); }
.journal-sec { border-left: 4px solid var(--gold); padding-left: 1rem; margin-bottom: 1.2rem; }
.journal-sec.alma { border-color: var(--rose); } .journal-sec.espirito { border-color: var(--ink); }
.quote { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink); border-left: 4px solid var(--gold); padding: .3rem 1rem; background: #fff8e4; border-radius: 0 12px 12px 0; }
.linkbox { display: flex; gap: .5rem; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 200px; background: #fff8e4; }
.bars { display: flex; align-items: flex-end; gap: .8rem; height: 160px; padding-top: 1rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .75rem; gap: .3rem; }
.bars .bar i { display: block; width: 100%; max-width: 56px; background: linear-gradient(180deg, #d4af55, #b8902f); border-radius: 8px 8px 0 0; min-height: 3px; }
.bars .bar b { font-weight: 700; color: var(--ink); }
@media print { .side, .topbar, .btn { display: none !important; } .shell { display: block; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 701px) { .hero { padding-right: 230px; } }
