/* Prumo Contabilidade · superfície viva
   Cena: dono de padaria em Goiânia, 21h, no sofá, abre o link no celular com medo de esquecer uma guia.
   Estratégia de cor: contida. Neutro frio de papel timbrado, azul de carimbo na tinta, verde de "pago" só quando algo se resolve. */

:root {
  --bg: oklch(0.975 0.004 262);
  --panel: oklch(1 0 0);
  --line: oklch(0.9 0.008 262);
  --line-2: oklch(0.83 0.012 262);
  --ink: oklch(0.25 0.07 264);
  --ink-soft: oklch(0.45 0.035 264);
  --muted: oklch(0.5 0.02 264);
  --pago: oklch(0.56 0.14 152);
  --pago-bg: oklch(0.95 0.04 152);
  --conf: oklch(0.52 0.12 250);
  --conf-bg: oklch(0.95 0.025 250);
  --afazer: oklch(0.66 0.13 72);
  --afazer-bg: oklch(0.96 0.045 85);

  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-ui: "Onest", system-ui, sans-serif;

  --side-w: 248px;
  --pad: clamp(1.25rem, 3.2vw, 3rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-side: 20;
  --z-modal: 50;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--f-ui); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0; text-wrap: balance; font-variation-settings: "opsz" 72; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--conf); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 1rem; z-index: var(--z-modal); background: var(--ink); color: var(--panel); padding: .6rem 1rem; border-radius: 6px; }
.skip:focus { left: 1rem; }

.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100dvh; }

/* ---------- barra lateral ---------- */
.side {
  position: sticky; top: 0; height: 100dvh; z-index: var(--z-side);
  display: grid; grid-template-rows: auto 1fr auto; gap: 2rem;
  padding: 1.5rem 1.1rem 1.5rem 1.4rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); position: relative; flex: none; }
.brand__mark::before { content: ""; position: absolute; left: 50%; top: 7px; bottom: 11px; width: 3px; margin-left: -1.5px; background: var(--panel); border-radius: 2px; }
.brand__mark::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 10px; height: 10px; margin-left: -5px; background: var(--pago); border-radius: 50%; }
.brand__name { font: 700 1.25rem/1 var(--f-display); letter-spacing: -0.01em; }
.brand__name small { display: block; font: 500 .72rem/1.4 var(--f-ui); color: var(--muted); letter-spacing: 0; }
.side__nav { display: grid; gap: .15rem; align-content: start; }
.side__nav a { text-decoration: none; padding: .6rem .75rem; border-radius: 8px; color: var(--ink-soft); font-weight: 500; transition: background-color .2s var(--ease), color .2s var(--ease); }
.side__nav a:hover { background: var(--line); color: var(--ink); }
.side__nav a[aria-current="true"] { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.side__office { display: grid; gap: .6rem; font-size: .85rem; color: var(--muted); }
.side__office strong { display: block; color: var(--ink-soft); font-weight: 600; }

.main { min-width: 0; }

/* ---------- 1. o mês ---------- */
.month { position: relative; }
.month__pin { min-height: 100dvh; padding: clamp(1.5rem, 4vh, 3rem) var(--pad); display: grid; align-content: center; gap: 1.6rem; position: relative; }
.month__head { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: .9rem; }
.month h1 { font-size: clamp(2.2rem, 4.4vw, 4.4rem); max-width: 18ch; }
.month__meter { min-width: 220px; display: grid; gap: .4rem; justify-items: end; }
.month__label { font: 600 1.6rem/1 var(--f-display); }
.month__count { color: var(--ink-soft); font-size: .92rem; font-variant-numeric: tabular-nums; }
.month__bar { width: 100%; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.month__fill { display: block; height: 100%; width: calc(var(--done, 0) * 100%); background: var(--pago); border-radius: 99px; transition: width .6s var(--ease); }

.ledger { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) 1fr 1fr 8.5rem; gap: 1rem; align-items: center;
  padding: 1rem 1.25rem; border-top: 1px solid var(--line);
  transition: background-color .5s var(--ease);
}
.row:first-child { border-top: 0; }
.row__what strong { display: block; font-weight: 600; font-size: 1.08rem; }
.row__what small { color: var(--muted); font-size: .85rem; }
.row__when { color: var(--ink-soft); font-size: .92rem; }
.row__value { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.row__state {
  justify-self: end; display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-weight: 600; padding: .35rem .7rem; border-radius: 99px;
  background: var(--afazer-bg); color: oklch(0.45 0.1 70);
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.row__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.row.is-conf .row__state { background: var(--conf-bg); color: var(--conf); }
.row.is-pago { background: oklch(0.985 0.012 152); }
.row.is-pago .row__state { background: var(--pago-bg); color: oklch(0.42 0.12 152); }
.month__foot { font-size: .85rem; color: var(--muted); max-width: 70ch; }

/* calendário do mês: os dias de vencimento acendem quando a guia é paga */
.cal { display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 4px; }
.cal span { position: relative; aspect-ratio: 1 / 1.35; border-radius: 7px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: end start; padding: 4px 5px; font: 600 clamp(.6rem, .9vw, .85rem)/1 var(--f-display); color: var(--muted); font-variant-numeric: tabular-nums; transition: background-color .45s var(--ease), color .45s var(--ease), transform .45s var(--ease); }
.cal span.is-weekend { background: transparent; }
.cal span.is-due { box-shadow: inset 0 0 0 1.5px var(--afazer); color: oklch(0.45 0.1 70); }
.cal span.is-due::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--afazer); }
.cal span.is-conf { box-shadow: inset 0 0 0 1.5px var(--conf); color: var(--conf); }
.cal span.is-conf::after { background: var(--conf); }
.cal span.is-pago { background: var(--pago); color: var(--panel); box-shadow: none; transform: translateY(-4px); }
.cal span.is-pago::after { background: var(--panel); }

/* o carimbo: o pico da página */
.stamp {
  position: absolute; left: 52%; bottom: 26%;
  display: grid; justify-items: center; padding: .9rem 1.6rem;
  border: 4px solid var(--pago); border-radius: 12px; color: var(--pago);
  transform: rotate(-9deg) scale(1.6); opacity: 0;
  font-family: var(--f-display); text-transform: uppercase; letter-spacing: .04em;
  pointer-events: none;
  mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgb(0 0 0 / .75) 61%, #000 75%);
}
.stamp span { font-size: .9rem; font-weight: 600; }
.stamp strong { font-size: 2.4rem; line-height: 1; font-weight: 800; }
.stamp.is-on { opacity: .92; transform: rotate(-9deg) scale(1); transition: transform .45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity .2s; }

/* ---------- 2. serviços ---------- */
.panel, .onboard, .compose { padding: clamp(4rem, 12vh, 7rem) var(--pad); border-top: 1px solid var(--line); }
.panel h2, .onboard h2, .compose h2 { font-size: clamp(1.7rem, 2.8vw, 2.6rem); margin-bottom: 1.8rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.tabs button { font: 500 .95rem/1 var(--f-ui); color: var(--ink-soft); background: none; border: 0; padding: .9rem 1rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; min-height: 44px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabpanel { max-width: 60ch; }
.tabpanel__lead { font: 500 clamp(1.25rem, 2vw, 1.6rem)/1.3 var(--f-display); margin-bottom: 1.2rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.checks li { display: grid; grid-template-columns: 1.6rem 1fr; color: var(--ink-soft); }
.checks li::before { content: ""; width: 1rem; height: 1rem; margin-top: .28rem; border-radius: 5px; background: var(--pago-bg); box-shadow: inset 0 0 0 1.5px var(--pago); }

/* ---------- 3. entrada ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 46rem; }
.steps li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .6rem; padding: 1.2rem 0; border-top: 1px solid var(--line); }
.steps strong { display: block; font-weight: 600; margin-bottom: .2rem; }
.steps p { color: var(--ink-soft); }
.steps__box { width: 1.4rem; height: 1.4rem; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-2); margin-top: .1rem; position: relative; transition: background-color .3s var(--ease), box-shadow .3s var(--ease); }
.steps__box::after { content: ""; position: absolute; left: .44rem; top: .18rem; width: .38rem; height: .72rem; border: solid var(--panel); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform .3s var(--ease) .1s; }
[data-step].is-done .steps__box { background: var(--pago); box-shadow: none; }
[data-step].is-done .steps__box::after { transform: rotate(45deg) scale(1); }

/* ---------- 4. contato ---------- */
.composer { max-width: 40rem; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 1rem; display: grid; gap: .6rem; }
.composer label { font-size: .85rem; color: var(--muted); }
.composer textarea { font: inherit; color: var(--ink); border: 0; resize: vertical; min-height: 5.5rem; background: transparent; padding: 0; }
.composer textarea:focus { outline: none; }
.composer:focus-within { box-shadow: 0 0 0 3px var(--conf-bg); border-color: var(--conf); }
.composer__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.btn { font: 600 .95rem/1 var(--f-ui); color: var(--panel); background: var(--ink); border: 0; border-radius: 10px; padding: .9rem 1.2rem; min-height: 46px; cursor: pointer; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: var(--pago); transform: translateY(-1px); }

.foot { padding: 2rem var(--pad) 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; display: grid; gap: .35rem; }
.demo { border: 1px solid var(--line-2); border-radius: 14px; padding: 1.8rem; max-width: 26rem; color: var(--ink); }
.demo::backdrop { background: oklch(0.25 0.07 264 / .35); }
.demo p { margin-bottom: 1.2rem; }

/* ---------- celular: a barra lateral vira faixa de abas no topo ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; grid-template-rows: auto; grid-template-columns: 1fr; gap: .6rem; padding: .8rem var(--pad) 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side__office { display: none; }
  .side__nav { display: flex; overflow-x: auto; gap: .2rem; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) .5rem; }
  .side__nav a { white-space: nowrap; font-size: .9rem; padding: .5rem .7rem; }
  .month__head { grid-template-columns: 1fr; gap: 1.2rem; }
  .cal { grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; }
  .cal span { aspect-ratio: 1; padding: 2px 3px; border-radius: 5px; }
  .month__meter { justify-items: start; min-width: 0; }
  .row { grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .85rem 1rem; }
  .row__what { grid-column: 1; }
  .row__state { grid-column: 2; grid-row: 1; }
  .row__when, .row__value { grid-column: 1; font-size: .85rem; text-align: left; }
  .row__value { color: var(--ink-soft); }
  .row__when { grid-row: 2; }
  .row__value { grid-row: 3; }
  .stamp { right: 1rem; bottom: 9%; }
  .stamp strong { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
