/* Camada de produto sobre o Glassy Finance.
   Só layout e peças que o design system não traz (campos, modal, grade, barras de progresso).
   Toda cor, raio, espaço e sombra vem dos tokens de ../glassy-finance/tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fundo: se existir telas/fundo.jpg (foto escura de ambiente), ela cobre os brilhos simulados. */
body {
  background:
    linear-gradient(var(--overlay), var(--overlay)),
    url("fundo.jpg") center / cover no-repeat,
    radial-gradient(55% 90% at 12% 15%, var(--backdrop-glow-1) 0%, transparent 70%),
    radial-gradient(45% 80% at 88% 25%, var(--backdrop-glow-2) 0%, transparent 70%),
    radial-gradient(60% 70% at 55% 110%, var(--backdrop-glow-1) 0%, transparent 70%),
    var(--backdrop);
  background-attachment: fixed;
}

.muted { color: var(--text-secondary); }
.tert { color: var(--text-tertiary); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.warn { color: var(--warning); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }

.row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* Página do app */
.page { max-width: 1440px; margin: 0 auto; padding: var(--space-6) max(16px, 3vw) 96px; display: flex; flex-direction: column; gap: var(--space-6); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.brand { font: 700 18px/24px var(--font-sans); letter-spacing: -0.01em; color: var(--text-primary); }
.brand:hover { text-decoration: none; }
.layout { display: flex; gap: var(--space-4); align-items: flex-start; }
.layout > .gf-sidebar { position: sticky; top: var(--space-6); flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }

.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-4); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.gf-card { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.gf-kpi { width: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

/* Blocos internos (sem desfoque, como os itens de lista) */
.stat { background: var(--glass-default); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .v { font: 700 18px/24px var(--font-sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.panel { border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); border: 1px solid var(--glass-border); background: var(--glass-default); }
.panel--warning { background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.35); }
.panel--positive { background: var(--positive-soft); border-color: rgba(52, 211, 153, 0.35); }
.panel--negative { background: var(--negative-soft); border-color: rgba(248, 113, 113, 0.35); }
.big { font: 700 22px/28px var(--font-sans); letter-spacing: -0.02em; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* Barras de progresso em pílula */
/* Sozinha (dentro de um card ou de uma coluna) ocupa a largura toda e mantém a altura; ao lado de texto, numa linha, divide o espaço. */
.track { height: 8px; width: 100%; border-radius: var(--radius-pill); background: var(--ring-track); overflow: hidden; flex: none; min-width: 0; }
.row > .track, .prow > .track, .subrow > .track { flex: 1; width: auto; }
.fill { height: 100%; border-radius: var(--radius-pill); background: var(--accent); transition: width var(--duration-base) var(--ease-glass); }

/* Planilha intuitiva */
.pent { width: 28px; height: 28px; flex: none; clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); display: inline-block; }
.prow { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.prow .name { width: 132px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .amt { width: 92px; flex: none; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.minibars { display: flex; align-items: flex-end; gap: 4px; height: 40px; flex: 1; min-width: 0; }
.minibars span { flex: 1; min-width: 0; border-radius: var(--radius-pill); background: var(--bar-fill); border: 1px solid var(--glass-border); }
.minibars span.cur { background: var(--accent); border-color: transparent; }

/* Cards de leitura */
.insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.insight { background: var(--glass-default); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.insight .n { font: 700 20px/26px var(--font-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.insight .linkbtn { align-self: flex-start; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { color: var(--text-secondary); }
.input { height: 44px; width: 100%; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--glass-border); background: var(--glass-default); color: var(--text-primary); font: 400 14px/20px var(--font-sans); }
.input::placeholder { color: var(--text-tertiary); }
.input:hover { background: var(--glass-hover); }
.input--big { height: 56px; font: 700 24px/30px var(--font-sans); letter-spacing: -0.02em; }
.input--sm { height: 36px; padding: 0 var(--space-3); font-size: 13px; }
.check { display: flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.gf-btn[disabled] { opacity: .45; cursor: not-allowed; }
.gf-btn--block { width: 100%; }
.gf-btn--lg { height: 48px; padding: 0 var(--space-6); font-size: 15px; }
.gf-btn--ok { background: var(--positive); color: var(--on-accent); border-color: transparent; }
.gf-btn--ok:hover { background: var(--positive); filter: brightness(1.08); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: 500 13px/18px var(--font-sans); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.option { text-align: left; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); border: 1px solid var(--glass-border); background: var(--glass-default); color: var(--text-primary); cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: 500 13px/18px var(--font-sans); transition: background-color var(--duration-fast) var(--ease-glass); }
.option:hover { background: var(--glass-hover); }
.option.is-active { background: var(--glass-strong); border-color: var(--glass-border-strong); }
.option small { font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }

/* Modal, foco do onboarding e avisos */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 10, 15, 0.6); display: flex; align-items: flex-start; justify-content: center; padding: 72px 16px 24px; overflow-y: auto; }
.modal { width: 100%; background: var(--glass-fallback); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-glass), var(--highlight-top); -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(var(--saturate-glass)); backdrop-filter: blur(var(--blur-glass)) saturate(var(--saturate-glass)); display: flex; flex-direction: column; gap: var(--space-4); }
.dim { position: fixed; inset: 0; z-index: 20; background: rgba(10, 10, 15, 0.66); }
.spot { position: relative; z-index: 30; outline: 2px solid var(--accent); outline-offset: 4px; background: var(--glass-fallback); }
.stepper { position: sticky; top: var(--space-4); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-radius: var(--radius-pill); background: var(--glass-fallback); border: 1px solid var(--glass-border); }
.step { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); font: 500 13px/18px var(--font-sans); }
.step b { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--glass-strong); font: 600 12px/16px var(--font-sans); }
.step.on { color: var(--text-primary); } .step.on b { background: var(--accent); color: var(--on-accent); }
.step.done b { background: var(--positive); color: var(--on-accent); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; padding: var(--space-3) var(--space-4); border-radius: var(--radius-pill); background: var(--surface-solid); color: var(--text-inverse); font: 500 13px/18px var(--font-sans); box-shadow: var(--shadow-glass); max-width: calc(100vw - 32px); }
.empty { border: 1px dashed var(--glass-border-strong); border-radius: var(--radius-md); padding: var(--space-6); text-align: center; color: var(--text-secondary); display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.todo { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--grid-line); }
.todo:last-child { border-bottom: 0; }
.todo .box { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--glass-border-strong); display: inline-grid; place-items: center; flex: none; font-size: 12px; }
.todo.done .box { background: var(--positive); border-color: transparent; color: var(--on-accent); }
.todo.done .t { color: var(--text-tertiary); text-decoration: line-through; }

/* Navegação inferior no celular */
.bottomnav { display: none; }

@media (max-width: 1180px) {
  .s3, .s4, .s5 { grid-column: span 6; }
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .s3, .s4, .s5, .s6, .s7, .s8 { grid-column: span 12; }
  .insights { grid-template-columns: 1fr; }
  .layout > .gf-sidebar, .topbar .gf-nav, .topbar .hide-sm { display: none; }
  .gf-card { padding: var(--space-4); }
  .prow .name { width: 104px; } .prow .amt { width: 80px; }
  .bottomnav { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; justify-content: space-around; align-items: center; padding: var(--space-2); border-radius: var(--radius-pill); background: var(--glass-fallback); border: 1px solid var(--glass-border); box-shadow: var(--shadow-glass); }
  .bottomnav .gf-btn--primary { width: 52px; height: 52px; padding: 0; border-radius: 50%; margin-top: -22px; box-shadow: var(--glow-accent); }
}
@media (prefers-reduced-motion: reduce) { .fill, .option { transition: none; } }

/* Listas clicáveis, grupos e peças das telas internas */
.clickable { cursor: pointer; border-radius: var(--radius-md); }
.clickable:hover .gf-item { background: var(--glass-hover); }
.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gf-item.stripe-neutral { --gf-stripe: var(--text-secondary); }
.gf-item.stripe-in { --gf-stripe: var(--positive); }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) var(--space-1) 0; }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.toast .linkbtn { color: var(--text-inverse); text-decoration: underline; margin-left: var(--space-3); font-weight: 600; }
.gf-btn--danger { color: var(--negative); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.legend span { display: inline-flex; align-items: center; gap: var(--space-2); font: 400 12px/16px var(--font-sans); color: var(--text-secondary); }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* Link com cara de botão (navegação entre telas) */
a.gf-btn:hover { text-decoration: none; }

/* Plano e assinatura: selo ao lado do avatar, faixa de aviso (teste acabando, pagamento pendente) e cards de plano */
.selo-plano { text-decoration: none; white-space: nowrap; }
.selo-plano:hover { text-decoration: none; }
.aviso-plano { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--warning-soft); border: 1px solid rgba(251, 191, 36, 0.35); }
.aviso-plano--neg { background: var(--negative-soft); border-color: rgba(248, 113, 113, 0.35); }
.plan { gap: var(--space-4); }
.plan.is-pick { border-color: var(--accent); box-shadow: var(--shadow-glass), var(--highlight-top), 0 0 0 1px var(--accent); }
.price { font: 700 36px/42px var(--font-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.li { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--text-secondary); }
.li::before { content: '✓'; color: var(--positive); font-weight: 700; flex: none; }
.li--no::before { content: '–'; color: var(--text-tertiary); }

/* Campo com erro e seletor nativo */
.input.is-erro { border-color: var(--negative); }
select.input { appearance: auto; color-scheme: dark; }

/* Sino com o ponto de não lidas */
.sino { position: relative; }
.sino i { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
a.gf-btn--icon { color: var(--text-secondary); }
