/* ============================================================
   ICB Ourinhos — visual elegante
   Paleta: papel quente, tinta profunda, dourado discreto
   Tipografia: Fraunces (títulos) + Inter (texto)
   ============================================================ */

:root {
  --paper: #f6f2ea;
  --paper-deep: #efe8da;
  --card: #fffdf8;
  --ink: #211d18;
  --ink-soft: #6f6659;
  --ink-faint: #9a9082;
  --gold: #a87c2f;
  --gold-deep: #8a6524;
  --gold-soft: #f0e5cb;
  --line: #e7decb;
  --danger: #b3402e;
  --ok: #3f7a4e;
  --radius: 20px;
  --shadow-card: 0 1px 2px rgba(33, 29, 24, 0.05), 0 12px 32px -12px rgba(33, 29, 24, 0.14);
  --shadow-lift: 0 2px 4px rgba(33, 29, 24, 0.06), 0 18px 40px -14px rgba(33, 29, 24, 0.22);
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(168, 124, 47, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(168, 124, 47, 0.07), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 120px;
}

/* ---------- Telas ---------- */

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screenIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Utilitários ---------- */

[hidden] {
  display: none !important;
}

.center {
  text-align: center;
}

svg.lucide {
  flex-shrink: 0;
}

/* ---------- Tipografia ---------- */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-top: 8px;
}

h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
}

.lead {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 10px 0 22px;
}

.label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin: 20px 0 10px;
}

.label.center {
  text-align: center;
  margin-top: 0;
}

/* ---------- Hero (Início) ---------- */

.hero {
  text-align: center;
  padding: 28px 0 30px;
}

.hero img {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(168, 124, 47, 0.10), var(--shadow-card);
  object-fit: cover;
}

.hero h1 {
  font-size: 2rem;
  margin-top: 18px;
}

.hero p {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin: 8px 0 0;
}

/* ---------- Atalhos ---------- */

.shortcuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  min-height: 118px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.shortcut:hover,
.shortcut:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--gold);
}

.shortcut:active {
  transform: translateY(-1px);
}

.shortcut svg {
  width: 26px;
  height: 26px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 14px;
  color: var(--gold-deep);
  background: var(--gold-soft);
}

/* ---------- Cartões ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 20px;
  margin-bottom: 18px;
}

/* ---------- Opções (tipo de contribuição / valores) ---------- */

.grid {
  display: grid;
  gap: 10px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.opt svg {
  width: 22px;
  height: 22px;
  color: var(--gold-deep);
}

.opt:hover,
.opt:focus-visible {
  border-color: var(--gold);
  color: var(--ink);
}

.opt.sel {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -10px rgba(33, 29, 24, 0.45);
}

.opt.sel svg {
  color: var(--gold-soft);
}

/* ---------- Valor ---------- */

.amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  padding: 6px 4px 10px;
  border-bottom: 2px solid var(--line);
  transition: border-color 0.2s ease;
}

.amount-wrap:focus-within {
  border-bottom-color: var(--gold);
}

.amount-wrap b {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold-deep);
}

.amount-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.amount-wrap input::placeholder {
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 1.2em;
  margin: 10px 2px 0;
}

/* ---------- Botões ---------- */

.btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 15px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: linear-gradient(160deg, #2c2721, var(--ink));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 26px -10px rgba(33, 29, 24, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(33, 29, 24, 0.55);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.btn.secondary:hover,
.btn.secondary:focus-visible {
  border-color: var(--gold);
  box-shadow: none;
}

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px -8px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.back:hover,
.back:focus-visible {
  background: var(--paper-deep);
  color: var(--ink);
}

.back svg {
  width: 18px;
  height: 18px;
}

/* ---------- Resultado Pix ---------- */

#result {
  display: none;
  text-align: center;
}

#result.show {
  display: block;
  animation: screenIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.summary {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.summary-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 2px 0 0;
}

.receiver {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
  margin: 10px 0 18px;
}

#qr {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 16px;
  width: fit-content;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

#qr img,
#qr canvas {
  display: block;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

.hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

#exampleWarn {
  color: var(--danger);
  font-weight: 600;
}

/* ---------- Avisos e status ---------- */

.notice {
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border: 1px solid rgba(168, 124, 47, 0.35);
  border-radius: 14px;
}

.status {
  min-height: 1.3em;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: var(--danger);
}

/* ---------- Formulários ---------- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.opt-note {
  font-weight: 400;
  color: var(--ink-faint);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--gold);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(168, 124, 47, 0.14);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 14px 0;
  cursor: pointer;
}

.check input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--gold-deep);
  cursor: pointer;
}

.check.consent {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Campo anti-spam: sempre escondido */
.hp {
  display: none !important;
}

/* ---------- Listas de links ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.links.spaced {
  margin-bottom: 20px;
}

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift);
}

.link svg {
  width: 22px;
  height: 22px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 12px;
  color: var(--gold-deep);
  background: var(--gold-soft);
  flex-shrink: 0;
}

.link span {
  flex: 1;
}

.link svg:last-child {
  padding: 0;
  background: none;
  color: var(--ink-faint);
  width: 18px;
  height: 18px;
}

.event-sel {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 4px 0 16px;
}

/* ---------- Eventos (Inscrições) ---------- */

button.event {
  appearance: none;
  display: block;
  width: 100%;
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button.event:hover,
button.event:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift);
}

button.event[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--card), var(--gold-soft));
}

.event .ev-meta {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 3px;
}

.event .ev-vagas {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin-top: 10px;
}

.event .ev-vagas.off {
  color: var(--ink-faint);
  background: var(--paper-deep);
}

/* ---------- Privacidade (prosa) ---------- */

.prose h3 {
  font-size: 1.05rem;
  margin: 20px 0 6px;
}

.prose h3:first-child {
  margin-top: 0;
}

.prose p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.prose .btn {
  margin-top: 20px;
}

.cn {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Navegação inferior ---------- */

nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.tabs {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
  padding: 6px;
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 32px -8px rgba(33, 29, 24, 0.25);
  pointer-events: auto;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab.active,
.tab[aria-selected="true"] {
  color: var(--paper);
  background: var(--ink);
}

.tab.active svg,
.tab[aria-selected="true"] svg {
  color: var(--gold-soft);
}

/* ---------- Telas maiores ---------- */

@media (min-width: 640px) {
  main {
    padding-top: 44px;
  }

  h2 {
    font-size: 2rem;
  }

  .hero h1 {
    font-size: 2.3rem;
  }
}

/* ---------- Acessibilidade ---------- */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
