/* Fontes hospedadas aqui (licença SIL OFL 1.1, textos em fonts/): nenhuma requisição ao Google ao abrir o site. */
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/HankenGrotesk-latin.woff2) format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/PlayfairDisplay-latin.woff2) format('woff2'); }
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 6rem; }
body { font-variant-numeric: tabular-nums; min-height: 100dvh; padding-bottom: calc(env(safe-area-inset-bottom) + var(--aviso-h, 0px)); -webkit-font-smoothing: antialiased; }
::selection { background: #C8141D; color: #fff; }

/* Foco por teclado: anel vermelho da marca, branco sobre fundos escuros */
:focus-visible { outline: 3px solid #E02830; outline-offset: 2px; border-radius: 8px; }
.hero-ios :focus-visible, .on-dark :focus-visible { outline-color: #fff; }
input, select, button { font: inherit; }
input, textarea { caret-color: #C8141D; }
input[type=checkbox], input[type=radio], progress { accent-color: #C8141D; }
input::placeholder { color: #6A6A70; }
input:focus-visible { outline-offset: 0; }
button:disabled { cursor: not-allowed; }
[data-act], button, summary { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.022em; }
h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; letter-spacing: -0.015em; }
a { text-underline-offset: 3px; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Link "pular para o conteúdo": só aparece no foco do teclado */
.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100; padding: .75rem 1rem; min-height: 44px;
  background: #0B0B0C; color: #fff; font-weight: 600; border-radius: 12px; transition: top .15s;
}
.skip-link:focus { top: .75rem; outline-color: #fff; }

* { scrollbar-width: thin; scrollbar-color: #C7C7CC transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #C7C7CC; border-radius: 8px; }

/* Barra do topo: preta como a logo, com o fio vermelho do sublinhado */
.glass {
  background: #08080A; /* sólido: sem backdrop-filter, que faz o topo "voar" e deixar áreas em branco em alguns navegadores/placas de vídeo */
  border-bottom: 2px solid #E02830; color: #fff;
}
.glass .text-muted { color: #B9B9C0; }
.glass .btn-ghost { color: #fff; }
.glass .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.glass :focus-visible { outline-color: #fff; }

/* Folha (modal) com a alça do iOS */
dialog.sheet {
  margin: auto auto 0; width: 100%; max-width: 42rem; max-height: 94dvh;
  border: 0; padding: 0; background: #F4F4F5; color: #0B0B0C;
  border-radius: 26px 26px 0 0; overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: rise .38s cubic-bezier(.16, 1, .3, 1); }
dialog.sheet::before { content: ''; flex: none; width: 38px; height: 5px; margin: 8px auto 0; border-radius: 9999px; background: #C7C7CC; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .5); }
dialog.dlg { margin: auto; border: 0; padding: 0; border-radius: 20px; max-width: min(21rem, calc(100% - 2rem)); background: rgba(255, 255, 255, .96); color: #0B0B0C; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .35); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .35); }
/* teclado aberto no celular: a folha ocupa só a área visível, de cima até o teclado */
dialog.sheet.teclado[open] {
  position: fixed; inset: auto auto auto 0; top: var(--vv-top, 0); left: 0; margin: 0; width: 100%;
  height: var(--vv-h, 100dvh); max-height: var(--vv-h, 100dvh); border-radius: 0; animation: none;
}
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 26px; max-height: 90dvh; }
}
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Faixa do carnê: um segmento por parcela. Ao entrar, enchem em sequência. */
.intro .seg { animation: seg .55s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i) * 28ms); transform-origin: left; }
@keyframes seg { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }

.toast { animation: rise .28s cubic-bezier(.16, 1, .3, 1); }

/* Painel principal com papel de parede do iPhone: azul, violeta e brasa */
.hero-ios {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(85% 75% at 105% -10%, rgba(224, 40, 48, .6) 0%, rgba(224, 40, 48, 0) 55%),
    radial-gradient(70% 80% at -10% 115%, rgba(224, 40, 48, .25) 0%, rgba(224, 40, 48, 0) 60%),
    linear-gradient(165deg, #1C1C1F 0%, #060607 100%);
  box-shadow: inset 0 0 0 1px rgba(224, 40, 48, .5), 0 24px 40px -24px rgba(0, 0, 0, .7);
}
.hero-late { background: radial-gradient(85% 75% at 105% -10%, rgba(255, 159, 10, .55) 0%, rgba(255, 159, 10, 0) 52%), linear-gradient(165deg, #6B0F18 0%, #1A0508 100%); }
.hero-ok { background: radial-gradient(85% 75% at 105% -10%, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 50%), linear-gradient(165deg, #0F4D33 0%, #06241A 100%); }
.hero-ios .brilho { position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 38%); pointer-events: none; }

/* Ícone de status da parcela */
.st-ico { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9999px; }
.st-ico svg { width: 17px; height: 17px; }
.st-paga { background: #34C759; color: #fff; }
.st-a_vencer { background: #E5E5EA; color: #636366; }
.st-atrasada { background: #FF3B30; color: #fff; }

/* Controle segmentado do iOS (filtros do painel) */
.segmentos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 2px; border-radius: 11px; background: rgba(118, 118, 128, .14); }
.segmentos button { min-height: 44px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #3A3A3C; transition: background-color .18s, box-shadow .18s; padding: 0 4px; }
.segmentos button[aria-pressed=true] { background: #fff; color: #0B0B0C; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .08); }
.segmentos button.alerta:not([aria-pressed=true]) { color: #C8102E; }

/* Ponto estático de "aguardando o Pix": o texto ao lado diz o estado */
.pulse-dot { width: 8px; height: 8px; flex: none; border-radius: 9999px; background: #FF9F0A; }

/* Esqueleto de carregamento */
.skeleton { background: linear-gradient(90deg, #E5E5EA 25%, #F4F4F5 50%, #E5E5EA 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .no-print { display: none !important; } }

/* Cartões: fio bem fino e sombra suave */
main .bg-white.rounded-2xl, main .bg-white.rounded-\[22px\], main form.bg-white { box-shadow: 0 0 0 1px rgba(11, 11, 12, .07), 0 14px 30px -22px rgba(11, 11, 12, .35); }

/* Páginas de texto (privacidade, termos, cookies, como funciona) */
.legal h2 { margin-top: 2rem; font-size: 1.4rem; font-weight: 600; }
.legal h3 { margin-top: 1.25rem; font-size: 1.05rem; font-weight: 700; }
.legal p, .legal li { margin-top: .6rem; line-height: 1.65; color: rgba(11, 11, 12, .86); }
.legal ul, .legal ol { margin-top: .4rem; padding-left: 1.25rem; }
.legal ul { list-style: disc; } .legal ol { list-style: decimal; }
.legal a { color: #C8141D; font-weight: 600; text-decoration: underline; }
.legal table { width: 100%; margin-top: .75rem; border-collapse: collapse; font-size: .95rem; }
.legal th, .legal td { padding: .55rem .6rem; text-align: left; vertical-align: top; border-bottom: 1px solid #E2E2E5; }
.legal th { font-weight: 700; background: #EDEDEF; }
.legal .pend { color: #8F4A00; font-weight: 600; }

/* com a folha aberta, a página de trás não rola (no iPhone ela rolava junto e embaralhava a tela) */
html:has(dialog[open]) { overflow: hidden; }
dialog.sheet { overscroll-behavior: contain; }

/* filtros da lista: uma linha só, rolando para o lado no celular (5 opções não cabem em 4 colunas) */
#tabs.segmentos { display: flex; overflow-x: auto; scrollbar-width: none; }
#tabs.segmentos::-webkit-scrollbar { display: none; }
#tabs.segmentos button { flex: none; white-space: nowrap; padding: 0 14px; }

/* iPhone/Safari e Chrome do iPhone: com a altura da folha "automática", o flex-1 (base 0%) encolhia o conteúdo
   a quase nada e só aparecia o título. Base pelo conteúdo ("auto") e encolhe só quando passa da tela. */
dialog.sheet [class~="flex-1"] { flex: 1 1 auto; min-height: 0; }

/* recibo: janela no centro; ao imprimir, só o recibo sai no papel */
dialog.recibo { margin: auto; border: 0; padding: 0; border-radius: 20px; width: min(30rem, calc(100% - 1.5rem)); max-height: 92dvh; overflow-y: auto; background: #fff; color: #0B0B0C; }
dialog.recibo::backdrop { background: rgba(0, 0, 0, .5); }
@media print {
  body > *:not(dialog.recibo) { display: none !important; }
  dialog.recibo { position: static; width: 100%; max-height: none; border-radius: 0; box-shadow: none; }
  dialog.recibo::backdrop { display: none; }
}

/* recibo estilo comprovante de banco: sempre claro (também no tema escuro e no papel) */
.rc-papel { background: #fff; color: #0B0B0C; }
.rc-topo { background: #000; border-bottom: 3px solid #E02830; padding: 14px 20px; text-align: center; }
.rc-topo img { height: 34px; width: auto; display: inline-block; }
.rc-corpo { padding: 22px 24px 8px; text-align: center; }
.rc-ok { width: 56px; height: 56px; border-radius: 999px; background: #1F9D4A; display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 0 0 7px #E3F6E8; }
.rc-titulo { font-weight: 700; font-size: 17px; color: #187A34; }
.rc-valor { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.rc-data { color: #5B5B63; font-size: 15px; }
.rc-corte { border-top: 2px dashed #D4D4D8; margin: 18px -6px; }
.rc-corpo dl { text-align: left; font-size: 15px; }
.rc-linha { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.rc-linha dt { color: #5B5B63; }
.rc-linha dd { font-weight: 600; text-align: right; }
.rc-rotulo { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #5B5B63; }
.rc-codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .12em; margin-top: 2px; }
.rc-aviso { color: #8A8A93; font-size: 12.5px; margin: 14px 0 6px; }
.rc-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 20px 20px; }
.escuro dialog.recibo { background: #fff; color: #0B0B0C; }
@media print { .rc-topo, .rc-ok { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.escuro .rc-acoes .btn-quiet, .rc-acoes .btn-quiet { background: #F0F0F2; color: #0B0B0C; }
