/* =============================================================================
   SHEILA BELLAVER — CAMPANHA DE DOAÇÃO
   Folha única, mobile-first. Em telas grandes o conteúdo continua em uma
   coluna estreita, centralizada, como no celular.

   SUMÁRIO
     1. Variáveis e reset
     2. Layout base
     3. Topo
     4. Vídeo
     5. Botões de valor
     6. Botões genéricos
     7. Rodapé
     8. Folha de pagamento (bottom sheet)
     9. Toasts
    10. Acessibilidade e movimento reduzido
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. VARIÁVEIS E RESET
   ------------------------------------------------------------------------- */
:root {
  --pink: #E91E63;
  --pink-bright: #FF4081;
  --pink-deep: #B0134A;
  --pink-light: #FCE4EC;

  --bg: #0E0A0E;
  --bg-soft: #161016;
  --card: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .12);

  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, .66);
  --dim: rgba(255, 255, 255, .42);

  --radius: 18px;
  --radius-lg: 26px;

  --pad: 20px;                       /* respiro lateral padrão */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-pink: 0 10px 26px rgba(233, 30, 99, .34);

  --ease: cubic-bezier(.22, .8, .28, 1);
}

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

/* Regras como `display: flex` em .sheet ou `display: block` em img venceriam o
   [hidden] padrão do navegador; esta linha garante que hidden sempre esconda. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* brilho rosa discreto no topo, sem custo de animação */
  background-image:
    radial-gradient(120% 55% at 50% -10%, rgba(233, 30, 99, .22), transparent 62%),
    linear-gradient(180deg, #140D14 0%, #0E0A0E 46%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* ----------------------------------------------------------------------------
   2. LAYOUT BASE
   ------------------------------------------------------------------------- */
.app {
  width: 100%;
  max-width: 460px;                  /* coluna de celular, mesmo no desktop */
  margin-inline: auto;
  padding: calc(var(--safe-top) + 18px) var(--pad) calc(var(--safe-bottom) + 28px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 12px 16px;
  background: var(--pink);
  color: #fff;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ----------------------------------------------------------------------------
   3. TOPO
   ------------------------------------------------------------------------- */
.top { text-align: center; }

.top__mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-bright), var(--pink-deep));
  box-shadow: var(--shadow-pink);
}

.top__name {
  font-size: clamp(1.25rem, 5.4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.top__tag {
  margin-top: 4px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pink-bright);
}

/* ----------------------------------------------------------------------------
   4. VÍDEO
   ------------------------------------------------------------------------- */
.video__frame {
  position: relative;
  aspect-ratio: 9 / 16;              /* sobrescrito em linha por config.video.ratio */
  /* Teto de altura para o título e os botões espiarem no fim da tela — o que
     passar disso é aparado pelo `object-fit: cover` do vídeo. */
  max-height: 70dvh;
  margin-inline: auto;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow);
}

.video__frame video,
.video__frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}

/* Botão de som para o autoplay mudo. Fica no topo para não cobrir os
   controles nativos do vídeo, que o celular desenha na base. */
.video__sound {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.video__sound:active { transform: scale(.92); }

/* estado de vídeo ausente / não configurado */
.video__missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(160deg, #241726, #120C12);
  color: var(--muted);
  font-size: .9rem;
}
.video__missing strong { color: var(--text); font-size: 1rem; }
.video__missing code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  color: var(--pink-light);
}

.video__caption {
  margin-top: 10px;
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------------------
   5. BOTÕES DE VALOR
   ------------------------------------------------------------------------- */
.donate { text-align: center; }

.donate__title {
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -.01em;
}

.donate__subtitle {
  margin-top: 6px;
  font-size: .92rem;
  color: var(--muted);
}

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

.amount {
  position: relative;
  min-height: 68px;                  /* alvo de toque confortável */
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--ease), border-color .16s var(--ease),
              background .16s var(--ease), box-shadow .16s var(--ease);
}

.amount__prefix {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--dim);
}

.amount:hover { border-color: rgba(255, 64, 129, .5); }
.amount:active { transform: scale(.96); }

.amount--highlight {
  background: linear-gradient(135deg, var(--pink-bright), var(--pink-deep));
  border-color: transparent;
  box-shadow: var(--shadow-pink);
}
.amount--highlight .amount__prefix { color: rgba(255, 255, 255, .8); }

/* "Outro valor" ocupa a linha inteira */
.amount--custom {
  grid-column: 1 / -1;
  min-height: 54px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pink-light);
  background: transparent;
  border-style: dashed;
}

.donate__error {
  margin-top: 12px;
  font-size: .88rem;
  color: #FF8A9B;
}

/* ----------------------------------------------------------------------------
   6. BOTÕES GENÉRICOS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--ease), opacity .16s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--block { width: 100%; }

.btn--primary {
  background: linear-gradient(135deg, var(--pink-bright), var(--pink-deep));
  color: #fff;
  box-shadow: var(--shadow-pink);
}

.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn[disabled]:active { transform: none; }

/* ----------------------------------------------------------------------------
   7. RODAPÉ
   ------------------------------------------------------------------------- */
.foot {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot__links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.foot__links:empty { display: none; }

.foot__links a {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.foot__links a:hover { color: var(--pink-bright); border-color: rgba(255, 64, 129, .5); }

.foot__note { font-size: .8rem; color: var(--dim); }
.foot__copy { margin-top: 6px; font-size: .78rem; color: var(--dim); }

/* ----------------------------------------------------------------------------
   8. FOLHA DE PAGAMENTO (BOTTOM SHEET)
   ------------------------------------------------------------------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 14px var(--pad) calc(var(--safe-bottom) + 24px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .5);
  transform: translateY(100%);
  transition: transform .3s var(--ease);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }

.sheet__grip {
  display: block;
  width: 42px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: var(--line);
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.sheet__title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}
.sheet__title strong {
  display: block;
  margin-top: 2px;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

/* Cada passo da folha: dados do doador, PIX gerado e confirmação. */
.sheet__step {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet__step--ok {
  align-items: center;
  text-align: center;
  padding-top: 6px;
}

/* --- Passo 1: campos do formulário --- */
.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo__label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
}

.campo__input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;   /* 16px ou mais: abaixo disso o iPhone dá zoom no foco */
  font-weight: 600;
  outline: none;
}
.campo__input:focus { border-color: var(--pink-bright); }
.campo__input:focus-visible { outline: none; }

.campo__erro {
  font-size: .88rem;
  color: #FF8A9B;
  text-align: center;
}

/* --- Passo 2: QR Code --- */
.qr {
  display: block;
  margin-inline: auto;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--shadow);
}

.aguardando {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted);
}

.aguardando__ponto {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink-bright);
  animation: pulsar 1.4s ease-in-out infinite;
}

.aguardando--parado .aguardando__ponto {
  background: var(--dim);
  animation: none;
}

@keyframes pulsar {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}

/* --- Passo 3: confirmação --- */
.sucesso__marca {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2ED47A, #12925A);
  box-shadow: 0 10px 26px rgba(18, 146, 90, .35);
}

.sucesso__titulo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.sucesso__texto {
  font-size: .95rem;
  color: var(--muted);
}

.sheet__hint {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--dim);
  text-align: center;
}

/* campo de "outro valor" dentro da folha */
.custom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.custom__label {
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
}
.custom__field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.custom__field:focus-within { border-color: var(--pink-bright); }
.custom__prefix { font-weight: 700; color: var(--dim); }
.custom__input {
  /* O destaque de foco fica na moldura do campo (.custom__field). */
  outline: none;
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  outline: none;
}

/* ----------------------------------------------------------------------------
   9. TOASTS
   ------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 20px);
  z-index: 70;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(24, 18, 24, .96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: .9rem;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--error { border-color: rgba(255, 138, 155, .5); color: #FF8A9B; }

/* ----------------------------------------------------------------------------
   10. ACESSIBILIDADE E MOVIMENTO REDUZIDO
   ------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--pink-bright);
  outline-offset: 3px;
  border-radius: 8px;
}
/* Exceção: no campo de valor quem acende é a moldura, não o input. */
.custom__input:focus-visible { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* telas baixas: reduz o vídeo para os botões continuarem visíveis */
@media (max-height: 700px) {
  .video__frame { max-height: 60dvh; }
  .app { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
