/* pelintra.pt: tinta de esferográfica, post-it e talão de café */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #1c2b6b;        /* azul de esferográfica */
  --ink-soft: #4a5687;
  --postit: #ffe14d;     /* post-it da dívida */
  --paper: #ffffff;
  --thermal: #f6f6f1;    /* papel de talão */
  --stamp: #d7263d;      /* carimbo */
  --stamp-ink: #b3122d;  /* vermelho para texto pequeno sobre amarelo (contraste AA) */
  --wa-me: #d9fdd3;      /* balão verde */
  --wa-bg: #efeae2;
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
}

a { color: inherit; text-underline-offset: 3px; }
a, button, summary, label, input { touch-action: manipulation; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 10; background: var(--ink); color: var(--postit); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; border-radius: 4px; }
/* Sobre o azul escuro, o vermelho do carimbo tem pouco contraste (2,6:1).
   Nas faixas escuras o anel passa a amarelo, que contrasta 10:1. */
.levels-band :focus-visible, .foot :focus-visible { outline-color: var(--postit); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 640px; }

h1, h2, h3 { font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 7vw, 4.2rem); font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); font-variation-settings: "opsz" 72; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: 62ch; }

.lead { font-size: 1.2rem; color: var(--ink); }
.hero-copy .lead:has(+ .lead) { margin-bottom: 0.5em; }
.small { font-size: 0.92rem; color: var(--ink-soft); }

.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 2.2rem; }
.logo a { text-decoration: none; }
.logo span { color: var(--stamp); }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--postit);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.85em 1.3em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--stamp);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--stamp); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--stamp); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: none; }
.btn.ghost:hover { transform: none; box-shadow: none; background: #fff7c2; }
.btn.ghost:active { transform: none; box-shadow: none; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Topo */
.hero { background: var(--postit); padding: 28px 0 56px; overflow: hidden; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (max-width: 599px) {
  .hero .logo { margin-bottom: 1.4rem; }
  .receipt { width: min(100%, 290px); }
  .receipt-paper { font-size: 0.8rem; padding: 18px 18px 26px; }
}
@media (min-width: 900px) {
  .hero { padding: 40px 0 80px; }
  .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 56px; }
}

/* Talão */
.receipt { margin: 0; justify-self: center; width: min(100%, 340px); position: relative; transform: rotate(2deg); }
.receipt-paper {
  position: relative;
  background: var(--thermal);
  color: #2a2a2a;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 22px 22px 30px;
  box-shadow: 0 18px 30px -18px rgba(28, 43, 107, 0.55);
  /* rasgo em serrilha no fundo */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
}
.receipt-paper p { max-width: none; }
.r-head { text-align: center; margin-bottom: 14px; }
.r-head strong { font-size: 1.05rem; }
.r-lines { margin: 0; padding: 10px 0; border-top: 1px dashed #9a9a9a; border-bottom: 1px dashed #9a9a9a; }
.r-lines div { display: flex; justify-content: space-between; gap: 12px; }
.r-lines dt, .r-lines dd { margin: 0; }
.r-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1rem; margin: 10px 0; }
.r-foot { font-size: 0.8rem; margin: 0; color: #555; }
.stamp {
  position: absolute;
  right: 18px;
  top: 48%;
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: var(--stamp);
  border: 3px solid var(--stamp);
  border-radius: 8px;
  padding: 2px 12px;
  transform: rotate(-14deg);
  opacity: 0.88;
  mix-blend-mode: multiply;
  animation: stamp 0.45s cubic-bezier(.2,.9,.3,1.3) 0.7s both;
}
@keyframes stamp {
  from { transform: rotate(-14deg) scale(2.2); opacity: 0; }
  to   { transform: rotate(-14deg) scale(1); opacity: 0.88; }
}
.note {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--ink);
  transform: rotate(-4deg);
  margin: 10px 0 0 6px;
}

/* Secções */
.band { padding: 64px 0; }
.band + .band { border-top: 2px solid var(--ink); }
.two { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .band { padding: 88px 0; } .two { grid-template-columns: 1fr 1fr; gap: 64px; } }

/* Mensagens */
.msg {
  position: relative;
  max-width: 85%;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  color: #111b21;
}
.msg b { display: block; font-size: 0.82rem; color: #a24600; }
.chat { background: var(--wa-bg); border-radius: 18px; padding: 18px 14px; display: flex; flex-direction: column; }
.chat .me { align-self: flex-end; background: var(--wa-me); border-top-right-radius: 4px; }
.chat .them { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.gap { align-self: center; font-size: 0.8rem; background: #fff7c2; color: #5b5126; padding: 3px 10px; border-radius: 8px; margin: 8px 0 12px; }

.msg.pel { background: var(--paper); border: 2px solid var(--ink); border-top-left-radius: 4px; box-shadow: none; color: var(--ink); max-width: 100%; }

/* Passos (é uma sequência a sério) */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 28px; counter-reset: passo; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps li { counter-increment: passo; }
.steps li::before {
  content: counter(passo);
  display: inline-grid;
  place-items: center;
  width: 2.2em; height: 2.2em;
  margin-bottom: 12px;
  font-weight: 800;
  background: var(--postit);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

/* Níveis de lembrete */
.levels-band { background: var(--ink); color: var(--paper); }
.levels-band + .band { border-top: 0; }
.levels { list-style: none; margin: 32px 0 24px; padding: 0; display: grid; gap: 24px; }
@media (min-width: 800px) { .levels { grid-template-columns: repeat(3, 1fr); align-items: end; } }
.when { font-weight: 700; margin-bottom: 8px; color: var(--postit); }
.levels .msg.pel { border-color: var(--paper); }
.levels li:nth-child(2) .msg.pel { font-size: 1.08rem; }
.levels .max .msg.pel { font-size: 1.18rem; font-weight: 700; background: var(--postit); box-shadow: 5px 5px 0 var(--stamp); }
.levels-band .small { color: #c9cfe8; }

/* Manhã seguinte */
.morning { background: var(--wa-bg); border-radius: 18px; padding: 18px 14px; }
.clock { font-size: 0.85rem; text-align: center; color: #54656f; margin: 0 auto 12px; }

/* Frases riscadas */
.struck { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.struck li {
  font-size: clamp(1.25rem, 3.6vw, 1.75rem);
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-color: var(--stamp);
  text-decoration-thickness: 3px;
}

/* Perguntas */
details { border-bottom: 2px solid var(--ink); padding: 14px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--stamp-ink); }
summary::after { content: "+"; font-weight: 800; }
details[open] summary::after { content: "\2212"; }
details p { margin: 10px 0 4px; }

/* Inscrição */
.signup { background: var(--postit); padding: 72px 0; border-top: 2px solid var(--ink); }
.field { display: block; font-weight: 700; margin: 18px 0 6px; }
input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.8em 0.9em;
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 0.95rem; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.cf-turnstile { margin: 8px 0 18px; min-height: 65px; }
.err { color: var(--stamp-ink); font-weight: 700; margin-top: 14px; min-height: 1.2em; }
/* O app.js marca aria-invalid no campo que falhou; aqui é que isso se vê. */
input[type="email"][aria-invalid="true"] { border-color: var(--stamp-ink); box-shadow: 0 0 0 3px rgba(215, 38, 61, 0.25); }
.check input[aria-invalid="true"] { outline: 3px solid var(--stamp-ink); outline-offset: 2px; }

#done h2 { outline: none; }
#pos { color: var(--stamp); }
.share { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0 36px; }
.share .btn { max-width: 100%; overflow-wrap: anywhere; }
.ask { border-top: 2px solid var(--ink); padding-top: 24px; }
.q { font-weight: 700; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chips button {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.4em 0.95em;
  cursor: pointer;
}
.chips button:hover { background: #fff7c2; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--postit); }

/* Rodapé */
.foot { background: var(--ink); color: #d7dbef; padding: 28px 0 36px; font-size: 0.95rem; }
.foot p { margin: 0 0 6px; }
.foot a { margin-right: 18px; }

/* Páginas simples (privacidade, 404, sair) */
.simple { background: var(--postit); min-height: 100vh; }
.simple main { padding: 32px 16px 64px; }
.doc { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 24px 20px; }
.doc h2 { font-size: 1.3rem; margin-top: 1.6em; }
.doc ul { padding-left: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stamp { animation: none; }
  .btn { transition: none; }
}
