:root {
  --bg-dark: #0a1224;
  --bg-dark-2: #101c38;
  --primary: #22c1a8;
  --primary-dark: #1aa290;
  --text-light: #f4f7fb;
  --text-muted: #a9b4c9;
  --text-dark: #0f1729;
  --border-light: #e4e8f0;
  --card-bg: #ffffff;
  --danger: #d63451;
  --radius: 14px;
  --shadow-card: 0 8px 24px -12px rgba(10, 18, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
}

a {
  color: var(--primary-dark);
}

/* ---------- Auth (login/cadastro) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 15% 0%, #14264a 0%, var(--bg-dark) 55%);
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}

.auth-card .logo {
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.auth-card .logo .dot {
  color: var(--primary);
}

.auth-card h1 {
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 28px;
  color: #5b657c;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 193, 168, 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-error {
  background: rgba(214, 52, 81, 0.08);
  border: 1px solid rgba(214, 52, 81, 0.25);
  color: var(--danger);
  font-size: 13.5px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.form-success {
  background: rgba(34, 193, 168, 0.1);
  border: 1px solid rgba(34, 193, 168, 0.3);
  color: var(--primary-dark);
  font-size: 13.5px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.btn-block {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #05221d;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-block:hover {
  background: var(--primary-dark);
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: #6b7690;
  margin-top: 22px;
}

.auth-switch a {
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ---------- Painel (placeholder pós-login) ---------- */
.painel-shell {
  min-height: 100vh;
  background: #f4f6fb;
}

.painel-topbar {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.painel-topbar .logo {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}

.painel-topbar .logo .dot {
  color: var(--primary);
}

.painel-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.painel-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.painel-nav a .icone {
  font-size: 14px;
  line-height: 1;
}

.painel-nav a:hover,
.painel-nav a.ativo {
  color: var(--text-light);
}

.painel-nav a.ativo {
  color: var(--primary);
}

.painel-topbar .sair {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.painel-topbar .sair:hover {
  color: var(--text-light);
}

.painel-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.app-topbar-mobile,
.app-bottom-nav {
  display: none;
}

.painel-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

.painel-section {
  margin-top: 40px;
}

.painel-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 16px;
}

.bloqueios-lista {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.bloqueio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.bloqueio-item:last-child {
  border-bottom: none;
}

.bloqueio-item .valor {
  font-weight: 700;
  color: var(--text-dark);
}

.badge-libera {
  display: inline-flex;
  align-items: center;
  background: rgba(34, 193, 168, 0.12);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.painel-empty {
  color: #8890a0;
  font-size: 14px;
  padding: 18px 20px;
  background: #fff;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
}

.perfil-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 24px;
  margin-bottom: 20px;
}

.perfil-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text-dark);
}

.perfil-card .readonly-field {
  margin-bottom: 16px;
}

.perfil-card .readonly-field .label {
  font-size: 12px;
  color: #8890a0;
  margin-bottom: 3px;
}

.perfil-card .readonly-field .value {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 600;
}

.taxas-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.taxas-lista li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.taxas-lista li:last-child {
  border-bottom: none;
}

.taxas-lista .taxa-valor {
  font-weight: 700;
  color: var(--text-dark);
}

.btn-inline {
  display: inline-flex;
  width: auto;
  padding: 11px 22px;
}

.subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.subnav a {
  display: inline-flex;
  padding: 9px 16px;
  border-radius: 999px;
  background: #eef1f6;
  color: #5b657c;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.subnav a.ativo {
  background: var(--bg-dark);
  color: var(--text-light);
}

.acessos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.acesso-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acesso-card .nome {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 15px;
}

.acesso-card .meta {
  font-size: 13px;
  color: #8890a0;
}

.acesso-card .btn-inline {
  margin-top: 10px;
  text-decoration: none;
  text-align: center;
}

.badge-revogado {
  display: inline-flex;
  align-items: center;
  background: rgba(214, 52, 81, 0.1);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  width: fit-content;
}

.extrato-lista {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.extrato-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  gap: 12px;
}

.extrato-item:last-child {
  border-bottom: none;
}

.extrato-item .descricao {
  font-weight: 600;
  color: var(--text-dark);
}

.extrato-item .data {
  font-size: 12px;
  color: #8890a0;
}

.extrato-item .valor {
  font-weight: 700;
  white-space: nowrap;
}

.extrato-item .valor.credito {
  color: var(--primary-dark);
}

.extrato-item .valor.debito {
  color: var(--danger);
}

.painel-welcome h1 {
  font-size: 24px;
  margin: 0 0 6px;
}

.painel-welcome p {
  color: #5b657c;
  margin: 0 0 32px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.quick-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 8px;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.quick-grid a:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.quick-grid a span {
  font-size: 24px;
  line-height: 1;
}

.painel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.painel-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

.painel-card .label {
  font-size: 13px;
  color: #8890a0;
  margin-bottom: 6px;
}

.painel-card .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 22px;
  }
}

/* ---------- Editor de texto rico (Página de Vendas) ---------- */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rte-toolbar button {
  background: #eef1f6;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #3d4658;
  cursor: pointer;
}

.rte-toolbar button:hover {
  background: #e2e6ee;
}

.rte-editor {
  min-height: 160px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
}

.rte-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 193, 168, 0.15);
}

.rte-editor p {
  margin: 0 0 10px;
}

.rte-editor ul,
.rte-editor ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

/* ---------- Listas dinâmicas (benefícios/depoimentos) ---------- */
.linha-repetivel {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.linha-repetivel .input-icone,
.linha-repetivel .input-texto {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.btn-remover-linha {
  background: #eef1f6;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
}

.btn-remover-linha:hover {
  background: rgba(214, 52, 81, 0.1);
}

@media (max-width: 560px) {
  .linha-repetivel {
    grid-template-columns: 1fr;
  }
}

/* ---------- Progresso de saque grátis ---------- */
.saque-gratis-progresso {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.saque-gratis-topo {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #5b657c;
  margin-bottom: 10px;
}

.saque-gratis-barra {
  height: 10px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
}

.saque-gratis-barra-preenchida {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- Em breve (função temporariamente indisponível) ---------- */
.em-breve-card {
  background: #fff;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
}

.em-breve-icone {
  display: block;
  font-size: 34px;
  margin-bottom: 12px;
}

.em-breve-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 8px;
}

.em-breve-card p {
  color: #5b657c;
  font-size: 14px;
  max-width: 420px;
  margin: 0 auto;
}

/* ---------- Busca + tabela (Clientes e outras listas do painel) ---------- */
.busca-form {
  margin-bottom: 20px;
}

.busca-form input {
  width: 100%;
  max-width: 360px;
  padding: 11px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.tabela-wrap {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

table.tabela-lista {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.tabela-lista th,
.tabela-lista td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.tabela-lista thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8890a0;
  font-weight: 700;
  background: #f8fafc;
}

.tabela-lista tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Balance card (Carteira/Home, estilo PWA) ---------- */
.balance-card {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 130%);
  color: var(--text-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.balance-card .label {
  font-size: 13px;
  opacity: 0.8;
}

.balance-card .valor {
  font-family: inherit;
  font-size: 34px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.balance-card .bloqueado {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 10px;
}

.balance-card .bloqueado strong {
  font-variant-numeric: tabular-nums;
}

/* ---------- Pix box (Receber Pix — QR/copia-e-cola) ---------- */
.pix-box {
  background: #fff;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.pix-box .pix-qr {
  max-width: 220px;
  margin: 0 auto 20px;
  border-radius: 10px;
  overflow: hidden;
}

.pix-code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  background: #f4f6fb;
  padding: 12px 14px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

/* ---------- PWA mobile (Carteira) — abaixo de 768px vira app-shell:
   topbar comum vira só o toggle do menu, aparece uma barra de título fixa
   e uma bottom-nav com os atalhos principais. Acima de 768px nada muda.
   Fica no final do arquivo de propósito: precisa vencer no cascade as
   regras base (.quick-grid, .painel-content etc.) que têm a mesma
   especificidade mas aparecem antes no arquivo. */
@media (max-width: 767px) {
  .painel-menu-toggle {
    display: block;
  }

  .painel-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--bg-dark);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 84px 24px 24px;
    overflow-y: auto;
  }

  .painel-nav.aberta {
    display: flex;
  }

  .painel-nav a {
    width: 100%;
    padding: 14px 4px;
    font-size: 17px;
    border-bottom: 1px solid rgba(244, 247, 251, 0.08);
  }

  .painel-nav a .icone {
    font-size: 17px;
    width: 26px;
  }

  .app-topbar-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .app-topbar-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
  }

  .app-bottom-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid var(--border-light);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }

  .app-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #8890a0;
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 8px;
  }

  .app-bottom-nav a span {
    font-size: 19px;
    line-height: 1;
  }

  .app-bottom-nav a.ativo {
    color: var(--primary-dark);
  }

  .painel-content {
    padding: 16px 16px calc(84px + env(safe-area-inset-bottom)) !important;
    max-width: 100% !important;
  }

  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .quick-grid a span {
    font-size: 20px;
  }
}

/* ---------- Splash/login da Carteira (subdomínio app.elosbr.com.br) ---------- */
.carteira-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(160deg, var(--bg-dark) 0%, var(--primary-dark) 150%);
  padding: 40px 16px;
}

.carteira-splash-topo {
  text-align: center;
  color: var(--text-light);
}

.carteira-splash-icone {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.5);
}

.carteira-splash-topo h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px;
}

.carteira-splash-topo p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.carteira-splash-card {
  margin: 0;
}

/* ---------- Área de Membros (hub de cursos do vendedor) ---------- */
.membros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.membros-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.membros-capa {
  height: 90px;
  background: linear-gradient(135deg, var(--bg-dark), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
}

.membros-capa span {
  color: var(--text-light);
  font-size: 34px;
  font-weight: 800;
  opacity: 0.9;
}

.membros-corpo {
  padding: 18px 20px;
}

.membros-titulo {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.membros-preco {
  font-size: 13px;
  color: #8890a0;
  margin-bottom: 16px;
}

.membros-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.membros-stats > div {
  text-align: center;
}

.membros-stat-valor {
  display: block;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dark);
}

.membros-stat-label {
  display: block;
  font-size: 10.5px;
  color: #8890a0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.membros-acoes {
  display: flex;
  gap: 8px;
}

.membros-acoes .btn-inline {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .membros-stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
  }

  .membros-acoes {
    flex-direction: column;
  }
}
