/* Pagamentos: estilos do app. Usa tokens do kit (base.css, tokens.css). Sem cor solta para texto. */
:where(img) { height: auto; max-width: 100%; display: block; }
.pula { position: absolute; left: 0; top: 0; z-index: var(--z-aviso); padding: var(--e-3) var(--e-4); background: var(--fundo); color: var(--texto); transform: translateY(-120%); }
.pula:focus { transform: none; }
.topo .marca { display: inline-flex; align-items: center; gap: var(--e-2); }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(160deg, var(--marca), var(--marca-2)); box-shadow: 0 6px 14px color-mix(in oklab, var(--marca) 40%, transparent); }
.logo svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topo .btn-ic { width: 40px; height: 40px; border-radius: 12px; }
.topo .btn-ic[hidden] { display: none; }
.faixa { padding: var(--e-2) max(16px, 4vw); text-align: center; font-size: var(--t-sm); font-weight: 600; background: color-mix(in srgb, var(--aviso) 22%, var(--fundo)); border-bottom: 1px solid color-mix(in srgb, var(--aviso) 55%, var(--aro)); }
.faixa[hidden] { display: none; }
.pagina { min-height: 60vh; padding-bottom: 110px; }
.pagina:focus { outline: none; }

/* cabecalho da tela */
.cab { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e-3) var(--e-4); margin-bottom: var(--e-4); }
.cab h1 { margin: 0; font-size: var(--t-3xl); }
.cab p.sub { margin: var(--e-1) 0 0; }
.cab .acoes-topo { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--e-2); align-items: center; }
.abas { margin: var(--e-2) 0 var(--e-4); }
.abas .pilula-seg { max-width: 100%; }

/* contadores */
.contadores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e-3); margin-bottom: var(--e-5); }
.cont { display: flex; flex-direction: column; gap: var(--e-1); min-width: 0; padding: var(--e-4); border-radius: var(--raio); border: 1px solid var(--aro); background: var(--card); box-shadow: var(--sombra); backdrop-filter: blur(12px); }
.cont .rot { display: flex; align-items: center; gap: var(--e-2); font-size: var(--t-sm); color: var(--suave); font-weight: 600; }
.cont .rot svg, .sec > h2 svg { width: var(--ic-md); height: var(--ic-md); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cont .n { font-size: var(--t-3xl); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cont.total .n { font-size: var(--t-xl); }
.cont.atrasada.tem { border-color: var(--erro); background: color-mix(in srgb, var(--erro) 14%, var(--card)); }
.cont.atrasada.tem .n, .cont.atrasada.tem .rot { color: var(--erro); }
.cont.hoje.tem .n, .cont.hoje.tem .rot { color: var(--aviso); }
.cont.hoje.tem { border-color: color-mix(in srgb, var(--aviso) 55%, var(--aro)); }
.cont.semana.tem .rot { color: var(--info); }

/* secoes */
.sec { margin-bottom: var(--e-6); }
.sec > h2, .sec > summary { display: flex; align-items: center; gap: var(--e-2); font-size: var(--t-xl); margin: 0 0 var(--e-3); font-weight: 750; }
.qtd { font-size: var(--t-sm); font-weight: 700; padding: 2px 10px; border-radius: var(--r-pilula); border: 1px solid var(--aro); background: var(--card); color: var(--suave); }
.sec.atrasada > h2 { color: var(--erro); }
.sec.hoje > h2 { color: var(--aviso); }
.sec.semana > h2 { color: var(--info); }
.sec > summary { cursor: pointer; list-style: none; min-height: var(--alvo); }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ""; width: 9px; height: 9px; margin-left: var(--e-1); border-right: 2px solid var(--suave); border-bottom: 2px solid var(--suave); transform: rotate(45deg); transition: transform var(--dur-2); }
.sec[open] > summary::after { transform: rotate(-135deg); }
.sec > summary:focus-visible { outline: 2px solid var(--marca-texto); outline-offset: 2px; border-radius: var(--r-sm); }
.lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--e-4); }

/* card de conta */
.conta { position: relative; display: flex; flex-direction: column; gap: var(--e-3); min-width: 0; padding: var(--e-4); border-radius: var(--raio); border: 1px solid var(--aro); background: var(--card); box-shadow: var(--sombra); backdrop-filter: blur(12px); transition: opacity var(--dur-3), transform var(--dur-3); }
.conta.saindo { opacity: 0; transform: scale(.97); }
.conta .linha1 { display: flex; align-items: flex-start; gap: var(--e-3); }
.conta h3 { margin: 0; font-size: var(--t-lg); line-height: 1.25; overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; }
.conta .menu-bt { width: 40px; height: 40px; flex: none; }
.conta .valor { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.conta .valor.sem { font-size: var(--t-sm); font-weight: 500; color: var(--suave); }
.conta .venc { margin: 0; font-size: var(--t-md); font-weight: 650; }
.conta .venc small { display: block; font-size: var(--t-sm); font-weight: 400; color: var(--suave); }
.conta .chips { margin: 0; }
.conta .obs { margin: 0; color: var(--suave); font-size: var(--t-sm); overflow-wrap: anywhere; }
.conta .link { font-size: var(--t-sm); font-weight: 650; color: var(--marca-texto); overflow-wrap: anywhere; display: inline-flex; align-items: center; min-height: 44px; }
.conta .btn-paguei, .conta .btn-desfaz { margin-top: auto; }
.conta.atrasada { border: 2px solid var(--erro); background: color-mix(in srgb, var(--erro) 13%, var(--card)); animation: pulsa 2.6s ease-in-out infinite; }
.conta.atrasada .venc { color: var(--erro); }
.conta.hoje { border-color: var(--aviso); background: color-mix(in srgb, var(--aviso) 10%, var(--card)); }
.conta.hoje .venc { color: var(--aviso); }
.conta.semana { border-color: color-mix(in srgb, var(--info) 55%, var(--aro)); }
.conta.paga .venc { color: var(--ok); }
@keyframes pulsa { 0%, 100% { box-shadow: var(--sombra), 0 0 0 0 transparent; } 50% { box-shadow: var(--sombra), 0 0 0 5px color-mix(in srgb, var(--erro) 28%, transparent); } }
.chip.sit { font-weight: 700; }
.chip.sit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-right: 4px; vertical-align: -2px; }
.chip.sit.atrasada { color: var(--erro); border-color: var(--erro); }
.chip.sit.hoje { color: var(--aviso); border-color: var(--aviso); }

/* menu do card */
.menu { position: absolute; right: var(--e-3); top: 60px; z-index: var(--z-menu); min-width: 180px; display: flex; flex-direction: column; gap: var(--e-2); padding: var(--e-3); border-radius: var(--r-lg); background: var(--fundo-2); border: 1px solid var(--aro); box-shadow: var(--elev-4); }
.menu[hidden] { display: none; }
.menu .btn-vidro { width: 100%; justify-content: center; }

/* botao flutuante + */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: var(--z-menu); width: 60px; height: 60px; border-radius: 20px; }
.fab .ic3 { width: 28px; height: 28px; }

/* esqueleto, vazio, erro */
.esq { min-height: 190px; border-radius: var(--raio); border: 1px solid var(--aro); background: var(--card); position: relative; overflow: hidden; }
.esq::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--texto) 9%, transparent) 50%, transparent 80%); transform: translateX(-100%); animation: varre 1.4s linear infinite; }
@keyframes varre { to { transform: translateX(100%); } }
.estado { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--e-3); padding: var(--e-6) var(--e-4); border-radius: var(--raio); border: 1px solid var(--aro); background: var(--card); box-shadow: var(--sombra); backdrop-filter: blur(12px); }
.estado img { width: min(260px, 70%); aspect-ratio: 4 / 3; border-radius: var(--r-lg); object-fit: contain; }
.estado h2 { margin: 0; font-size: var(--t-2xl); }
.estado p { margin: 0; color: var(--suave); max-width: 46ch; }
.estado .acoes { justify-content: center; margin: var(--e-2) 0 0; }
.estado .sel { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(160deg, var(--erro), color-mix(in srgb, var(--erro) 55%, #000)); }
.estado .sel svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* login */
.login { max-width: 880px; margin: var(--e-5) auto 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--aro); background: var(--card); box-shadow: var(--elev-4); backdrop-filter: blur(14px); }
.login .arte { display: grid; place-items: center; padding: var(--e-5); background: linear-gradient(160deg, color-mix(in srgb, var(--marca) 30%, transparent), color-mix(in srgb, var(--marca-2) 22%, transparent)); }
.login .arte img { width: min(300px, 100%); aspect-ratio: 3 / 4; object-fit: contain; border-radius: var(--r-lg); }
.login form { padding: var(--e-6) var(--e-5); display: flex; flex-direction: column; gap: var(--e-4); justify-content: center; }
.login .selo { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(160deg, var(--marca), var(--marca-2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--marca) 45%, transparent); }
.login .selo svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login h1 { margin: 0 0 var(--e-2); font-size: var(--t-2xl); }
.login p.sub { margin: 0; }

/* formularios */
.campo { display: flex; flex-direction: column; gap: var(--e-1); min-width: 0; }
.campo > label, .campo > .rotulo { font-size: var(--t-sm); font-weight: 650; }
.campo .dica { font-size: var(--t-sm); color: var(--suave); }
input, select, textarea { font-size: 16px; min-height: 48px; }
textarea { min-height: 88px; resize: vertical; }
.senha { position: relative; }
.senha input { padding-right: 60px; }
.senha .olho { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--suave); display: grid; place-items: center; cursor: pointer; }
.senha .olho:focus-visible { outline: 2px solid var(--marca-texto); }
.senha .olho svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.erro-form { display: flex; gap: var(--e-2); align-items: flex-start; padding: var(--e-3); border-radius: var(--r-md); border: 1px solid var(--erro); background: color-mix(in srgb, var(--erro) 12%, var(--card)); color: var(--erro); font-size: var(--t-sm); font-weight: 600; }
.erro-form[hidden] { display: none; }
.sug { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.sug button { min-height: 44px; padding: 0 var(--e-4); border-radius: var(--r-pilula); border: 1.5px solid var(--aro); background: var(--card); color: var(--texto); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.sug button[aria-pressed="true"] { border-color: var(--marca-texto); color: var(--marca-texto); background: color-mix(in srgb, var(--marca) 16%, var(--card)); }
.sug button:focus-visible { outline: 2px solid var(--marca-texto); outline-offset: 2px; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-3); }
.pilula-seg button { min-height: 44px; }

/* janela */
.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--aro); border-radius: var(--r-xl); background: var(--fundo-2); color: var(--texto); box-shadow: var(--elev-4); overflow: auto; }
.dlg::backdrop { background: rgba(5, 10, 20, .6); backdrop-filter: blur(4px); }
.dlg .corpo { padding: var(--e-5); display: flex; flex-direction: column; gap: var(--e-4); }
.dlg h2 { margin: 0; font-size: var(--t-2xl); }
.dlg .rodape { display: flex; flex-wrap: wrap; gap: var(--e-3); justify-content: flex-end; }
.dlg p { margin: 0; color: var(--suave); }

/* avisos (barra "marcada como paga") */
.avisos { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: var(--z-aviso); width: min(520px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: var(--e-2); pointer-events: none; }
.aviso { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) var(--e-4); border-radius: var(--r-lg); background: var(--fundo-2); border: 1px solid var(--aro); box-shadow: var(--elev-4); font-weight: 600; font-size: var(--t-sm); }
.aviso.ok { border-color: var(--ok); }
.aviso.erro { border-color: var(--erro); }
.aviso .t { flex: 1 1 auto; min-width: 0; }
.aviso .barra { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ok); width: 100%; transform-origin: left; animation: encolhe 10s linear forwards; }
@keyframes encolhe { to { transform: scaleX(0); } }

@media (max-width: 760px) {
  .contadores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; }
  .login .arte { padding: var(--e-4); }
  .login .arte img { width: 140px; }
  .login form { padding: var(--e-5) var(--e-4); }
  .cab .acoes-topo { margin-left: 0; width: 100%; }
  .dupla { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .conta.atrasada, .esq::after, .aviso .barra { animation: none; }
  .aviso .barra { transform: none; }
}

/* botoes coloridos mantem preenchimento forte tambem no tema claro (o botoes-padrao.css os deixava claros e com letra escura) */
html[data-theme] .btn-vidro.btn-vidro--verde, html[data-theme] .btn-vidro.btn-vidro--azul, html[data-theme] .btn-vidro.btn-vidro--vermelho {
  color: #fff; border-color: rgba(255, 255, 255, .4); text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
  background: linear-gradient(180deg, oklch(.54 .16 var(--btn-matiz)), oklch(.42 .15 var(--btn-matiz))); }
