/* Instituto Gerson Costa — identidade visual do sistema (painel, Área de Membros e telas de acesso)
   Cores inspiradas na arte da Formação: azul-noite profundo + dourado + creme.
   Combinações de texto seguem contraste mínimo de 4,5:1 (WCAG AA). */
:root {
  --ink: #1d1440;          /* texto principal sobre claro */
  --ink-soft: #4b4466;     /* texto secundário (≈7:1 sobre creme) */
  --navy: #1b1240;         /* fundo escuro principal */
  --navy-2: #382870;       /* azul mais vivo */
  --gold: #cfa048;
  --gold-light: #e3c680;   /* dourado sobre fundo azul-noite (≈10:1) */
  --gold-deep: #6f5106;    /* dourado escuro para texto sobre claro (≈7,6:1) */
  --cream: #f4f1e9;
  --paper: #ffffff;
  --blush: #ebe7f6;        /* azul-gelo — fundos de destaque */
  --rose: #a79bd6;
  --rose-deep: #150d33;
  --line: #d9d5c6;
  --ok: #1f6038;
  --ok-bg: #e2f1e8;
  --err: #8f2626;
  --err-bg: #fbe6e4;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(27, 18, 64, .09);
  --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: 700; 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, #e3c680, #cfa048); color: #1b1240; box-shadow: 0 3px 12px rgba(207, 160, 72, .35); }
.btn-primary:hover { background: linear-gradient(135deg, #ecd391, #d8ac55); color: #1b1240; }
.btn-dark { background: var(--navy); color: var(--gold-light); }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.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-ok:hover { background: #164a2a; 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 #9d9a8c; border-radius: 10px; padding: .65rem .8rem; min-height: 44px; }
input::placeholder, textarea::placeholder { color: #666b82; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(207, 160, 72, .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(--navy-2); 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(250px, 1fr)); gap: 1rem; }
.cards .card + .card { margin-top: 0; }
.stat .n { font: 700 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(--navy-2); }
.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(--navy); 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(--navy); border: 1px solid var(--rose); }
.progress { height: 10px; background: #e3dfd0; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #e3c680, #cfa048); 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(--navy); 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 #ebe7d9; vertical-align: middle; }
tbody tr:hover { background: #faf8f1; }
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(8, 13, 36, .7); 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, .45); }
.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(--navy); 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: radial-gradient(ellipse at 20% 10%, #382870 0%, transparent 55%), radial-gradient(ellipse at 90% 90%, #4a2f86 0%, transparent 50%), var(--navy); }
.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(0, 0, 0, .5); }
.auth-card.wide { max-width: 560px; }
.auth-card .logo { display: block; width: 190px; height: auto; margin: 0 auto 1rem; }
.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, #1b1240, #2a1b66); color: var(--cream); 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(235, 201, 107, .25); margin-bottom: .6rem; }
.side .brand img { width: 76px; height: 76px; object-fit: contain; }
.side .brand .nm { font: 700 1.05rem var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); margin-top: .3rem; }
.side .brand .tag { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: #cdc4e6; margin-top: .2rem; }
.side nav a { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .9rem; border-radius: 10px; color: #eeeaf8; text-decoration: none; font: 500 .93rem var(--sans); min-height: 42px; }
.side nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.side nav a.active { background: rgba(235, 201, 107, .16); color: var(--gold-light); box-shadow: inset 3px 0 0 var(--gold-light); font-weight: 700; }
.side .group { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: #c4badf; font-weight: 700; padding: 1rem .9rem .3rem; }
.side .who { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(235, 201, 107, .25); font-size: .85rem; color: #eeeaf8; }
.side .who b { display: block; color: #fff; }
.side .who span { word-break: break-all; }
.side .who a { color: var(--gold-light); }
.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; max-width: 1280px; 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(--navy); color: var(--gold-light); }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 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(21, 13, 51, .6); }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: var(--gold-light); padding: .6rem 1rem; position: sticky; top: 0; z-index: 30; }
  .topbar .nm { font: 700 1rem var(--serif); letter-spacing: .12em; text-transform: uppercase; }
  .topbar img { height: 36px; vertical-align: middle; margin-right: .5rem; }
  .topbar button { background: none; border: 1.5px solid var(--gold-light); color: var(--gold-light); 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: radial-gradient(ellipse at 85% 20%, #4a3a94 0%, transparent 55%), linear-gradient(135deg, #1b1240, #382870); color: var(--cream); border-radius: 20px; padding: 2rem; position: relative; overflow: hidden; border-bottom: 4px solid var(--gold); }
.hero h1, .hero h2 { color: #fff; }
.hero p { color: #eeeaf8; }
.hero .eyebrow { color: var(--gold-light); }
.hero img.mark { width: auto; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); height: 140px; opacity: .95; }
@media (max-width: 700px) { .hero img.mark { display: none; } }
@media (min-width: 701px) { .hero { padding-right: 220px; } }
.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(27, 18, 64, .16); color: inherit; }
.prog-card .cover { height: 90px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 70% 30%, #4a3a94, #1b1240); }
.prog-card .cover img { height: 62px; opacity: .95; }
.player { background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; width: 100%; border: 3px solid var(--navy); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player.empty { display: grid; place-items: center; background: var(--navy); 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(--navy); color: var(--gold-light); font-family: var(--sans); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.lesson { display: flex; gap: .7rem; align-items: center; padding: .75rem 1rem; border-top: 1px solid #ebe7d9; 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: #faf8f1; }
.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.sonho { border-color: var(--navy-2); } .journal-sec.insight { 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: #fbf4df; border-radius: 0 12px 12px 0; }
.linkbox { display: flex; gap: .5rem; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 200px; background: #fbf4df; }
.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, #e3c680, #cfa048); border-radius: 8px 8px 0 0; min-height: 3px; }
.bars .bar b { font-weight: 700; color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pipeline (Kanban) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.kcol { background: #e9e6da; border-radius: 14px; padding: .6rem; min-height: 200px; border-top: 4px solid var(--navy-2); }
.kcol[data-etapa=ganho] { border-top-color: var(--ok); } .kcol[data-etapa=perdido] { border-top-color: #8a8a8a; } .kcol[data-etapa=proposta] { border-top-color: var(--gold); }
.kcol.over { outline: 3px dashed var(--gold); background: #f1ecd6; }
.kcol h4 { display: flex; justify-content: space-between; align-items: center; font: 700 .78rem var(--sans); letter-spacing: .06em; text-transform: uppercase; margin: .2rem .3rem .6rem; color: var(--ink); }
.kcol h4 .n { background: var(--navy); color: var(--gold-light); border-radius: 999px; padding: .05rem .6rem; font-size: .75rem; }
.kcol .soma { font-weight: 500; font-size: .72rem; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.kcard { background: #fff; border-radius: 10px; padding: .7rem .8rem; margin-bottom: .55rem; box-shadow: 0 1px 4px rgba(27, 18, 64, .12); cursor: grab; border-left: 4px solid #c6c2b3; font-size: .88rem; }
.kcard.quente { border-left-color: #d9622b; } .kcard.morna { border-left-color: var(--gold); } .kcard.fria { border-left-color: #5b7fd1; }
.kcard.dragging { opacity: .45; }
.kcard b a { color: var(--ink); text-decoration: none; }
.kcard b a:hover { text-decoration: underline; }
.kcard .meta { color: var(--ink-soft); font-size: .78rem; margin-top: .15rem; }
.kcard .acts { display: flex; gap: .4rem; margin-top: .5rem; align-items: center; }
.kcard select { min-height: 32px; font-size: .78rem; padding: .2rem .4rem; border-width: 1px; flex: 1; min-width: 0; }
.kcard .atrasado { color: var(--err); font-weight: 700; }
.funnel-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: #e3dfd0; }
.funnel-bar i { display: block; height: 100%; }

/* Linha do tempo do contato */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); margin-left: .5rem; }
.timeline li { position: relative; padding: 0 0 1rem 1.2rem; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--cream); }
.timeline li.funil::before { background: var(--navy-2); } .timeline li.sistema::before { background: #9a9a9a; }
.timeline .when { font-size: .75rem; color: var(--ink-soft); }
.timeline .tipo { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); }

@media print { .side, .topbar, .btn { display: none !important; } .shell { display: block; } }

/* datas e investimento (agenda, ficha e landing) */
.datas { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .2rem; }
.datas span { border: 1px solid rgba(207, 160, 72, .55); border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-weight: 600; }
.invest { border-left: 4px solid var(--gold); background: rgba(207, 160, 72, .12); padding: .7rem 1rem; border-radius: 10px; margin: .8rem 0; font-weight: 600; }
fieldset.pg { border: 0; padding: 0; margin: 0 0 1rem; } fieldset.pg legend { font-weight: 600; margin-bottom: .4rem; }

/* ───── Variações por área (cores do logo) ───── */
/* Área de Membros: dourado em destaque, com tinta índigo */
body.membros { --cream: #fbf5e6; background: #f8efd9; }
body.membros .side { background: linear-gradient(180deg, #f3e3b6, #d8b868 62%, #c89838); color: #1b1240; }
body.membros .side .brand { border-bottom-color: rgba(27, 18, 64, .25); }
body.membros .side .brand .nm { color: #1b1240; } body.membros .side .brand .tag { color: #3d2f80; }
body.membros .side nav a { color: #2a1b66; } body.membros .side nav a:hover { background: rgba(27, 18, 64, .1); color: #1b1240; }
body.membros .side nav a.active { background: #1b1240; color: #f0dca0; box-shadow: none; }
body.membros .side .group { color: #4a3a94; }
body.membros .side .who { border-top-color: rgba(27, 18, 64, .25); color: #2a1b66; } body.membros .side .who b { color: #1b1240; } body.membros .side .who a { color: #1b1240; font-weight: 700; }
body.membros .topbar { background: #d8b868; color: #1b1240; } body.membros .topbar .nm { color: #1b1240; } body.membros .topbar button { color: #1b1240; border-color: #1b1240; }
body.membros .hero { background: radial-gradient(ellipse at 85% 20%, rgba(255, 255, 255, .35) 0%, transparent 55%), linear-gradient(135deg, #1b1240, #4a3a94); }
/* Painel da equipe: índigo em destaque sobre fundo lilás frio */
body.painel { background: #eeebf7; --cream: #f6f4fb; --line: #d3cde8; }
body.painel .page-head h1 { color: #2a1b66; }
body.painel .kcol { background: #e2dcf1; } body.painel .kcol.over { background: #d6cdee; }
/* Ficha de inscrição: dourado → índigo */
.auth-bg.ouro { background: radial-gradient(ellipse at 15% 5%, rgba(255, 255, 255, .5) 0%, transparent 50%), linear-gradient(160deg, #f3e3b6 0%, #cfa048 45%, #382870 100%); }
.auth-bg.ouro .auth-card { border-top-color: #382870; }

.player.doc { aspect-ratio: auto; height: 75vh; min-height: 420px; background: #fff; }
.alert.warn { background: #fbf1d6; color: #6b4f0a; border: 1px solid #e6cf8f; }
