/* QR Eterno: printed paper, blue rubber-stamp ink, condensed lettering like a shop poster. */

@font-face {
  font-family: 'Archivo';
  src: url('/static/fonts/archivo.woff2') format('woff2-variations'), url('/static/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f7fb;
  --surface: #ffffff;
  --ink: #1b1f3b;
  --muted: #5b6080;
  --line: #d8dbe6;
  --stamp: #2d40c2;
  --stamp-strong: #1f2f9c;
  --on-stamp: #ffffff;
  --ok: #18733f;
  --ok-bg: #e3f3ea;
  --warn: #b0381c;
  --warn-bg: #fbe9e4;
  --wait: #7a5100;
  --wait-bg: #fff1cf;
  --radius: 4px;
  --display: 75%; /* condensed width for headlines */
  --measure: 62ch;
  --font: 'Archivo', 'Helvetica Neue', Arial, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #13162b;
    --surface: #1b1f3b;
    --ink: #eceef7;
    --muted: #a4a9c6;
    --line: #2e3358;
    --stamp: #93a0ff;
    --stamp-strong: #b4bdff;
    --on-stamp: #13162b;
    --ok: #6bd39a;
    --ok-bg: #173527;
    --warn: #ff9c80;
    --warn-bg: #3a1e17;
    --wait: #f2c46b;
    --wait-bg: #3a2e12;
  }
}

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

html {
  -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-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

a {
  color: var(--stamp);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--stamp-strong);
}

:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 {
  font-size: 2.75rem;
  font-weight: 800;
  font-stretch: var(--display);
  line-height: 1;
  letter-spacing: -0.005em;
}
h2 {
  font-size: 1.875rem;
  font-weight: 780;
  font-stretch: var(--display);
  line-height: 1.05;
  margin-top: 1.4em;
}
h3 {
  font-size: 1.125rem;
  font-weight: 700;
}
p {
  margin: 0 0 1em;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.45;
  max-width: var(--measure);
}
.muted {
  color: var(--muted);
}
.measure {
  max-width: var(--measure);
}
.hint {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: -0.25em;
}
.url {
  font-weight: 560;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus {
  left: 8px;
}

/* ---------- Header and footer ---------- */

.site-header,
.site-footer {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-header nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-header nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 560;
}
.site-header nav a:hover {
  color: var(--stamp);
}
.site-header nav a.button {
  color: var(--on-stamp);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-stretch: var(--display);
  font-size: 1.375rem;
  letter-spacing: 0.005em;
}
.logo-mark {
  width: 28px;
  height: 28px;
  fill: var(--stamp);
  flex: none;
}
.brand-small {
  font-size: 1rem;
  gap: 6px;
  vertical-align: -3px;
  margin-right: 6px;
}
.brand-small .logo-mark {
  width: 18px;
  height: 18px;
}
.site-footer {
  width: calc(100% - 48px);
  max-width: 1072px;
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  padding-top: 28px;
  padding-bottom: 40px;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 2px solid var(--stamp);
  border-radius: var(--radius);
  background: var(--stamp);
  color: var(--on-stamp);
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.button:hover {
  background: var(--stamp-strong);
  border-color: var(--stamp-strong);
  color: var(--on-stamp);
}
.button-quiet,
button.button-quiet {
  background: transparent;
  color: var(--stamp);
}
.button-quiet:hover {
  background: var(--surface);
  color: var(--stamp-strong);
}
.button-small,
button.button-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.9375rem;
}
.button-danger,
button.button-danger {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
}
.button-danger:hover {
  background: var(--warn);
  filter: brightness(0.9);
}
.button:disabled {
  opacity: 0.7;
  cursor: default;
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 560;
  color: var(--ink);
  cursor: pointer;
}
.link-button:hover {
  color: var(--stamp);
}
.text-link {
  font-size: 0.9375rem;
}
.inline {
  display: inline;
  margin: 0;
}
.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
  padding: 48px 0 72px;
}
.hero h1 {
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  font-weight: 820;
  line-height: 0.94;
  letter-spacing: -0.01em;
  margin-bottom: 0.35em;
  max-width: 11ch;
}
.hero .lead {
  margin-bottom: 1.6em;
}

.placard {
  position: relative;
  margin: 0;
  padding: 0 0 64px;
  justify-self: center;
  width: min(100%, 340px);
}
.placard-card {
  transform: rotate(-1.5deg);
  background: #ffffff;
  color: #1b1f3b;
  border: 1px solid #d8dbe6;
  border-radius: 3px;
  padding: 28px 28px 52px;
  text-align: center;
  box-shadow: 0 1px 0 #d8dbe6, 0 18px 40px -24px rgba(27, 31, 59, 0.45);
}
.placard-title {
  font-weight: 800;
  font-stretch: var(--display);
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 18px;
}
.placard-hint {
  margin: 16px 0 0;
  font-size: 0.9375rem;
  color: #5b6080;
}
.placard .qr-frame {
  padding: 0;
  border: 0;
}

.stamp {
  position: absolute;
  width: 74%;
  right: -12%;
  bottom: 6px;
  transform: rotate(-8deg);
  mix-blend-mode: multiply;
  animation: stamp-down 460ms cubic-bezier(0.2, 0.9, 0.3, 1.2) 380ms both;
}
.stamp-line {
  stroke: #2d40c2;
}
.stamp-text {
  fill: #2d40c2;
  font-family: var(--font);
  font-size: 30px;
  font-weight: 860;
  font-stretch: 100%;
  letter-spacing: 1px;
}
@media (prefers-color-scheme: dark) {
  .stamp {
    mix-blend-mode: normal;
  }
  .stamp-line {
    stroke: #8190ff;
  }
  .stamp-text {
    fill: #8190ff;
  }
}
@keyframes stamp-down {
  0% {
    opacity: 0;
    transform: rotate(-8deg) scale(1.4);
  }
  70% {
    opacity: 1;
    transform: rotate(-8deg) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: rotate(-8deg) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .stamp {
    animation: none;
  }
}

/* ---------- Home: sections ---------- */

.band {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
}
.band h2 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.year {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: start;
}
.year-intro p {
  color: var(--muted);
  max-width: 44ch;
}
.year-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--stamp);
}
.year-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 20px;
  padding: 14px 0 14px 22px;
  position: relative;
}
.year-list li + li {
  border-top: 1px solid var(--line);
}
.year-list li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 21px;
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 2px solid var(--stamp);
  border-radius: 50%;
}
.year-month {
  grid-row: span 2;
  font-weight: 780;
  font-stretch: var(--display);
  font-size: 1.375rem;
  line-height: 1.2;
}
.year-what {
  font-weight: 620;
}
.year-link {
  color: var(--muted);
  font-size: 0.9375rem;
  word-break: break-all;
}

.prices-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: start;
}
.prices-band p {
  max-width: 40ch;
}
.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 560px;
}
.price-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
}
.price-item {
  font-size: 1.25rem;
  font-weight: 650;
}
.price-item small {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}
.price-leader {
  flex: 1;
  min-width: 24px;
  border-bottom: 3px dotted var(--muted);
  transform: translateY(-0.3em);
  opacity: 0.55;
}
.price-value {
  font-size: 2rem;
  font-weight: 800;
  font-stretch: var(--display);
  white-space: nowrap;
}

.qa {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
  margin: 12px 0 0;
  max-width: 1000px;
}
.qa dt {
  font-weight: 700;
  margin-bottom: 4px;
}
.qa dd {
  margin: 0;
  color: var(--muted);
  max-width: 50ch;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
th,
td {
  text-align: left;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9375rem;
}
tbody th {
  font-weight: 650;
}
.num {
  text-align: right;
}
.row-action {
  text-align: right;
  white-space: nowrap;
}
.row-action form + form {
  margin-left: 8px;
}

.prices {
  max-width: 560px;
}
.prices th {
  font-size: 1.125rem;
}
.prices td.num {
  font-size: 1.5rem;
  font-weight: 800;
  font-stretch: var(--display);
}

.codes .thumb {
  width: 64px;
}
.codes .thumb img {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px;
}
.code-name {
  font-weight: 680;
  text-decoration: none;
  color: var(--ink);
}
.code-name:hover {
  color: var(--stamp);
}
.code-target {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Tags and alerts ---------- */

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 620;
  background: var(--line);
  color: var(--ink);
}
.tag-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tag-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag-wait {
  background: var(--wait-bg);
  color: var(--wait);
}

.alert {
  border-left: 4px solid;
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 720px;
}
.alert-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.alert-error {
  border-color: var(--warn);
  background: var(--warn-bg);
}

/* ---------- Forms ---------- */

.google-auth { margin: 1.25rem 0; text-align: center; }
.google-button { display: flex; justify-content: center; background: #fff; color: #263349; border: 1px solid #c9d3db; font-weight: 700; }
.google-button:hover { background: #f6f8fb; }
.auth-divider { text-align: center; color: #64748b; font-size: .9rem; margin: 1rem 0; }
.form {
  display: grid;
  gap: 18px;
  max-width: 520px;
  margin: 8px 0 24px;
}
.form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.form .muted {
  font-weight: 400;
}
input,
textarea,
select {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 46px;
}
input:focus,
textarea:focus {
  border-color: var(--stamp);
  outline: 2px solid var(--stamp);
  outline-offset: 0;
}
.form .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}
.check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--stamp);
  flex: none;
}
.form button {
  justify-self: start;
}
.form-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 20px;
}
.form-inline input {
  width: auto;
  flex: 1 1 200px;
  min-height: 36px;
  padding: 6px 10px;
}
.form-inline input[type='number'] {
  flex: 0 0 96px;
}

/* ---------- App pages ---------- */

.narrow {
  max-width: 680px;
  padding-top: 24px;
}
.wide {
  padding-top: 24px;
}
.back {
  margin-bottom: 8px;
  font-size: 0.9375rem;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 {
  margin-bottom: 0.2em;
}
.page-head p {
  margin: 0;
}

.empty {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin-top: 16px;
}
.empty h2 {
  margin-top: 0;
}

.qr-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
}
.qr-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 8px;
}
.detail-qr {
  position: sticky;
  top: 16px;
}
.downloads {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.downloads .text-link {
  justify-self: start;
}
.detail-info h2 {
  margin-top: 1.4em;
}

.field-row {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}
.field-label {
  color: var(--muted);
  font-size: 0.9375rem;
}
.copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 0 0 20px;
}
.figures div {
  display: flex;
  flex-direction: column-reverse;
}
.figures dt {
  color: var(--muted);
  font-size: 0.9375rem;
}
.figures dd {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  font-stretch: var(--display);
  line-height: 1.1;
}

.chart {
  margin: 0 0 8px;
  max-width: 640px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 120px;
}
.chart .bar {
  fill: var(--stamp);
}
.chart .bar-zero {
  fill: var(--line);
}
.chart figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 6px;
}

.danger {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.danger summary {
  color: var(--warn);
  font-weight: 650;
  cursor: pointer;
}
.danger .form {
  margin-top: 16px;
}

/* Order / Pix payment */
.pay-steps {
  padding-left: 1.3em;
  max-width: var(--measure);
}
.pay-steps li {
  margin-bottom: 6px;
}
.pix-qr {
  width: min(100%, 280px);
  padding: 16px;
  margin: 20px 0;
}
.copy-block {
  display: grid;
  gap: 8px;
  max-width: 520px;
  margin-bottom: 16px;
}
.copy-block label {
  font-weight: 600;
}
.copy-block textarea {
  font-size: 0.875rem;
  word-break: break-all;
  resize: none;
}
.copy-block .button {
  justify-self: start;
}

.prose h2 {
  font-size: 1.5rem;
}
.prose p {
  max-width: var(--measure);
}

.found {
  border-left: 4px solid var(--stamp);
  padding: 8px 16px;
  margin-bottom: 24px;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 24px;
  }
  .placard {
    width: min(72%, 290px);
    justify-self: start;
    margin-left: 6%;
  }
  .stamp {
    right: -10%;
    width: 70%;
  }
  .hero {
    overflow-x: clip;
  }
  .year,
  .prices-band,
  .qa {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .detail {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .detail-qr {
    position: static;
    max-width: 320px;
  }
}
@media (max-width: 560px) {
  main {
    padding: 0 18px 48px;
  }
  .site-header {
    padding-left: 18px;
    padding-right: 18px;
  }
  .site-footer {
    width: calc(100% - 36px);
  }
  .site-header nav {
    gap: 6px 16px;
    font-size: 0.9375rem;
  }
  .code-target {
    max-width: 48vw;
  }
  h1 {
    font-size: 2.25rem;
  }
  .year-list li {
    grid-template-columns: 1fr;
  }
  .year-month {
    grid-row: auto;
  }
  .price-value {
    font-size: 1.625rem;
  }
  .codes thead th:nth-child(3),
  .codes tbody td:nth-child(3),
  .codes thead th:nth-child(5),
  .codes tbody td:nth-child(5) {
    display: none;
  }
}
