:root {
  --paper: #f3efe6;
  --ink: #15130f;
  --night: #0d0c0b;
  --accent: #b8360f;
  --accent-light: #ff8559;
  --muted: rgba(21,19,15,.68);
  --muted-2: rgba(21,19,15,.62);
  --line: rgba(21,19,15,.16);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --serif: Newsreader, Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--ink); font-family: Archivo, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; }
.view { display: none; flex-direction: column; flex: 1; }
.view.on { display: flex; }
.dark { background: var(--ink); color: var(--paper); }

/* barra */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 5; }
.brand { font-family: var(--display); font-size: 15px; letter-spacing: -.01em; }
.bar .pill { font-size: 12px; font-weight: 700; letter-spacing: .06em; background: var(--accent); color: #fff; padding: 10px 12px; border-radius: 3px; }
.bar .back { font-size: 13px; color: rgba(243,239,230,.75); padding: 8px 0; background: none; border: 0; }
.bar .meta { font-family: var(--mono); font-size: 11px; color: rgba(243,239,230,.65); }

/* tipografia */
.eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.eyebrow.soft { color: var(--muted-2); letter-spacing: .14em; }
.h2 { margin: 0 0 16px; font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: -.02em; }
.pad { padding: 30px 22px 0; }
.small { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.src { font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-top: 8px; line-height: 1.5; }

/* hero */
.hero { position: relative; background: var(--night); color: var(--paper); overflow: hidden; padding: 34px 22px 30px; }
.hero .pct { position: absolute; right: -40px; top: -70px; font-family: var(--display); font-size: 380px; line-height: 1; color: rgba(255,133,89,.07); pointer-events: none; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(46px, 13vw, 58px); line-height: .9; letter-spacing: -.035em; }
.hero h1 span { color: var(--accent-light); }
.hero p { margin: 16px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.45; color: rgba(243,239,230,.78); }
.receipt { position: relative; margin-top: 24px; background: #f7f4ec; color: var(--ink); border-radius: 3px; padding: 16px 16px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.5; animation: print 6s ease-out infinite; }
.receipt .row { display: flex; justify-content: space-between; gap: 10px; }
.receipt .dash { border-top: 1px dashed rgba(21,19,15,.4); margin: 8px 0; }
.stamp { position: absolute; right: 12px; top: 40px; border: 2px solid var(--accent); color: var(--accent); font-family: var(--display); font-size: 13px; letter-spacing: .04em; padding: 4px 8px; border-radius: 3px; background: rgba(247,244,236,.85); animation: stamp 6s ease-out infinite; }
@keyframes stamp { 0%,12% { opacity: 0; transform: rotate(-9deg) scale(1.7); } 18%,88% { opacity: 1; transform: rotate(-9deg) scale(1); } 100% { opacity: 0; transform: rotate(-9deg) scale(1); } }
@keyframes print { 0% { transform: translateY(-14px); opacity: 0; } 8%,100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .receipt, .stamp { animation: none; } }

/* contador */
.counter { margin: 22px; border: 1px solid rgba(21,19,15,.18); border-radius: 6px; padding: 16px 16px 14px; }
.counter .n { font-family: var(--display); font-size: 34px; letter-spacing: -.03em; }
.track { height: 7px; background: rgba(21,19,15,.12); border-radius: 99px; margin: 10px 0 8px; overflow: hidden; }
.track > div { height: 100%; background: var(--accent); border-radius: 99px; width: 0; transition: width .6s ease; }
.dark .track { background: rgba(243,239,230,.15); }
.dark .track > div { background: var(--accent-light); }

/* botões */
.btn { display: block; width: 100%; text-align: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .02em; padding: 17px; border-radius: 4px; border: 0; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; border: 1px solid rgba(21,19,15,.3); color: var(--ink); font-size: 15px; font-weight: 600; padding: 15px; }
.dark .btn.ghost { border-color: rgba(243,239,230,.4); color: var(--paper); }
.btn.sm { font-size: 13px; font-weight: 600; padding: 12px; }
.btn.dark-btn { background: var(--ink); color: var(--paper); }

/* números */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stats > div { background: var(--paper); padding: 14px 12px; }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: -.03em; }
.stats span { display: block; font-size: 11.5px; line-height: 1.35; color: var(--muted); margin-top: 6px; }

.timeline > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.timeline .w { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted-2); }
.timeline b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: -.02em; margin-top: 3px; }
.timeline span { font-size: 13.5px; line-height: 1.45; }
.quote { border-top: 3px solid var(--accent); padding-top: 14px; }
.quote p { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.4; }
.card { border: 1px solid var(--line); border-radius: 5px; padding: 13px 14px; }
.card .s { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted-2); }
.card .t { font-size: 14px; line-height: 1.45; font-weight: 500; margin-top: 5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.press a { display: block; border-top: 1px solid rgba(21,19,15,.18); padding: 12px 0; }
.press a:last-child { border-bottom: 1px solid rgba(21,19,15,.18); }
.press a:hover { text-decoration: none; }
.press a:hover .t { text-decoration: underline; }
.press .m { display: flex; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted-2); }
.press .m b { color: var(--accent); }
.press .t { font-family: var(--serif); font-size: 17px; line-height: 1.3; margin-top: 5px; }

.demands { margin-top: 30px; padding: 30px 22px; }
.demands .eyebrow { color: var(--accent-light); }
.demands .row { display: flex; gap: 14px; padding: 15px 0; border-top: 1px solid rgba(243,239,230,.18); font-size: 15px; line-height: 1.45; }
.demands .row b { font-family: var(--display); font-weight: 400; color: var(--accent-light); flex: 0 0 auto; }

.supporter { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 99px; flex: 0 0 auto; background-image: repeating-linear-gradient(135deg, rgba(21,19,15,.14) 0 5px, rgba(21,19,15,.04) 5px 10px); }

/* formulário */
form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.field input, .field select { width: 100%; min-width: 0; border: 1px solid rgba(21,19,15,.3); background: transparent; border-radius: 4px; padding: 14px; font: 400 16px Archivo, system-ui, sans-serif; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(21,19,15,.12); }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.line .field { font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); gap: 5px; }
.line .field input { border: 0; border-bottom: 2px solid rgba(21,19,15,.3); border-radius: 0; padding: 8px 0; font-size: 17px; }
.line .field input:focus { border-bottom-color: var(--ink); box-shadow: none; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.check input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.check a { text-decoration: underline; }
.hint { font-size: 12px; color: var(--muted); min-height: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; font-family: Archivo, system-ui, sans-serif; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts-box:empty { display: none; }
.err { color: var(--accent); font-size: 12.5px; font-weight: 600; min-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

footer { margin-top: auto; background: var(--ink); color: rgba(243,239,230,.68); padding: 22px; font-size: 11.5px; line-height: 1.6; }
footer .links { display: flex; gap: 14px; margin-bottom: 10px; }

/* confirmação */
.ok { width: 46px; height: 46px; border-radius: 99px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; }

/* senadores */
.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.list label { background: var(--paper); display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 48px; cursor: pointer; }
.list input, .allbox input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.list .nm { font-size: 15px; font-weight: 600; }
.list .nm i { font-style: normal; font-weight: 400; color: var(--muted-2); }
.list .em { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.allbox { display: flex; align-items: center; gap: 10px; border: 1px solid rgba(21,19,15,.22); border-radius: 5px; padding: 12px; min-height: 48px; margin-bottom: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.chips button { height: 44px; border-radius: 4px; border: 1px solid rgba(21,19,15,.28); background: transparent; color: var(--ink); font: 700 12px var(--mono); letter-spacing: .04em; padding: 0; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mail { background: #fff; border: 1px solid rgba(21,19,15,.2); border-radius: 6px; overflow: hidden; }
.mail .subj { padding: 11px 14px; border-bottom: 1px solid rgba(21,19,15,.12); font-size: 13px; }
.mail .body { padding: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-line; }
.total { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid rgba(21,19,15,.18); padding-top: 14px; }
.total b { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: -.02em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 6px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.envio-erro { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 520px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent); color: #fff; padding: 12px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.envio-erro[hidden] { display: none; }
.envio-erro button { flex: 0 0 auto; background: #fff; color: var(--accent); border: 0; border-radius: 4px; padding: 10px 12px; font-weight: 700; font-size: 13px; min-height: 44px; }
.envio-erro button[hidden] { display: none; }

/* Wrappers de layout: no mobile se comportam como antes (coluna única). */
.home-grid, .home-main, .send-col { display: flex; flex-direction: column; }
.send-col { flex: 1; }
.home-side { display: none; }

/* =========================================================
   DESKTOP (≥ 1024px). Tudo acima vale para o mobile e não muda.
   Os !important abaixo só sobrepõem estilos inline do HTML.
   ========================================================= */
@media (min-width: 1024px) {
  :root { --gx: max(40px, calc((100vw - 1160px) / 2)); }

  .app { max-width: none; }
  .bar { padding: 14px var(--gx); }
  .bar .brand { font-size: 17px; }
  footer { padding: 36px var(--gx); }

  /* hero: título à esquerda, cupom à direita */
  .hero { padding: 80px var(--gx) 88px; }
  .hero .pct { font-size: 760px; right: 6%; top: -200px; }
  .hero-in { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 420px); column-gap: clamp(48px, 5.5vw, 80px); align-items: center; }
  .hero-in > * { grid-column: 1; }
  .hero-in > .receipt { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; margin-bottom: 24px; font-size: 14px; padding: 24px 24px 20px; }
  /* carimbo pendurado na borda de baixo, sem cobrir os valores */
  .hero-in .stamp { top: auto !important; bottom: -20px; right: 20px; font-size: 15px; padding: 6px 10px; }
  .hero h1 { font-size: clamp(64px, 6.6vw, 104px); }
  .hero p { margin-top: 26px; max-width: 580px; font-size: 20px; }

  /* conteúdo + coluna de assinatura fixa */
  .m-only { display: none !important; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 29vw, 400px); column-gap: clamp(48px, 5vw, 72px); align-items: start; width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px 40px 96px; }
  .home-main > :not(.demands) { padding-left: 0 !important; padding-right: 0 !important; }
  .home-main > .pad { padding-top: 56px; }
  .home-main > .m-only + .pad { border-top: 0 !important; padding-top: 40px; }
  .home-main .btn, .home-main .supporter { max-width: 440px; }
  .h2 { font-size: 36px; }
  .timeline > div { grid-template-columns: 140px minmax(0, 1fr); padding: 16px 0; }
  .timeline span { font-size: 15px; }
  .home-main .stats:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats > div { padding: 18px 16px; }
  .stats span { font-size: 12.5px; }
  .quote p { font-size: 24px; }
  .press .t { font-size: 19px; }
  .demands { margin-top: 56px; padding: 44px 48px; border-radius: 8px; }
  .demands .row { font-size: 16px; }

  .home-side { display: block; position: sticky; top: 80px; margin-top: 40px; max-height: calc(100vh - 100px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: 0 16px 40px rgba(21,19,15,.08); }
  @media (prefers-reduced-motion: no-preference) { .home-side.pulse { animation: side-pulse 1.2s ease-out; } }
  @keyframes side-pulse { 0% { box-shadow: 0 0 0 0 rgba(184,54,15,.45), 0 16px 40px rgba(21,19,15,.08); } 100% { box-shadow: 0 0 0 16px rgba(184,54,15,0), 0 16px 40px rgba(21,19,15,.08); } }
  .home-side .counter { margin: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 18px; }
  /* compacto: o cartão inteiro (até o botão) precisa caber numa tela de notebook */
  .home-side { padding: 20px 22px; top: 72px; max-height: calc(100vh - 84px); }
  .home-side .counter { margin-bottom: 14px; padding-bottom: 12px; }
  .home-side .counter .n { font-size: 28px; }
  .home-side .track { margin: 8px 0 6px; }
  .home-side .h2 { font-size: 26px !important; }
  .home-side > p { margin-bottom: 12px !important; font-size: 13px !important; }
  .home-side form { gap: 7px; }
  .home-side .field { gap: 3px; }
  .home-side .field input { padding: 10px 12px; }
  .home-side .hint { min-height: 0; }
  .home-side .hint:empty { display: none; }
  @media (max-height: 760px) { .home-side > p { display: none; } .home-side .counter { margin-bottom: 10px; padding-bottom: 10px; } }

  /* assinatura: texto à esquerda, formulário à direita */
  .sign-wrap { display: grid !important; grid-template-columns: minmax(0, 1fr) 440px; grid-template-rows: auto 1fr; column-gap: 96px; align-items: start; align-content: start; width: 100%; max-width: 1240px; margin: 0 auto; padding: 96px 40px !important; }
  .sign-wrap > h1 { grid-column: 1; font-size: 64px !important; }
  .sign-wrap > p { grid-column: 1; max-width: 540px; font-size: 20px !important; }
  .sign-wrap > form { grid-column: 2; grid-row: 1 / span 2; flex: none !important; }

  /* confirmação: coluna central mais larga */
  #v-confirmado { padding: 96px max(40px, calc((100vw - 640px) / 2)) 80px !important; }
  #v-confirmado h1 { font-size: 64px !important; }
  #v-confirmado > div:last-child { margin-top: 0 !important; padding-top: 48px !important; }

  /* senadores: listas à esquerda, e-mail e botões fixos à direita */
  #v-senadores.on { display: grid; grid-template-columns: [full-start] minmax(40px, 1fr) [a-start] minmax(0, 656px) [a-end] 72px [b-start] 432px [b-end] minmax(40px, 1fr) [full-end]; grid-template-rows: auto auto auto 1fr; align-content: start; }
  #v-senadores > .bar { grid-column: full; grid-row: 1; }
  #v-senadores > div:not(.bar):not(.send-col) { grid-column: a; padding-left: 0 !important; padding-right: 0 !important; }
  #v-senadores > div:nth-child(2) { grid-row: 2; padding-top: 72px !important; }
  #v-senadores > div:nth-child(3) { grid-row: 3; }
  #v-senadores > div:nth-child(4) { grid-row: 4; padding-bottom: 80px !important; }
  #v-senadores h1 { font-size: 48px !important; }
  #v-senadores .chips { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .send-col { grid-column: b; grid-row: 2 / span 3; align-self: start; position: sticky; top: 64px; padding-top: 46px; }
  .send-col > div { padding-left: 0 !important; padding-right: 0 !important; }
  .send-col > div:last-child { margin-top: 0 !important; }
}
