/* ---------- Temas ----------
   Escuro é o padrão; o claro vale quando o sistema prefere claro
   (sem escolha salva) ou quando o botão ☀️/🌙 escolhe "light". */
:root {
  color-scheme: dark;
  --bg: #0c1522;
  --card: rgba(19, 31, 48, .88);
  --card2: rgba(24, 40, 64, .92);
  --line: #2a4263;
  --text: #e8eef7;
  --muted: #a9bdd6;
  --green: #19c37d;
  --green-dark: #109a62;
  --on-green: #08261a;
  --gold: #ffc145;
  --red: #ff6b6b;
  --overlay: linear-gradient(180deg, rgba(8, 14, 24, .80) 0%, rgba(8, 14, 24, .90) 100%);
  --radius: 14px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5f9;
  --card: rgba(255, 255, 255, .90);
  --card2: rgba(240, 245, 250, .95);
  --line: #d2dce8;
  --text: #142233;
  --muted: #4d6079;
  --green: #0b8a55;
  --green-dark: #086b42;
  --on-green: #ffffff;
  --gold: #a86f00;
  --red: #c9302c;
  --overlay: linear-gradient(180deg, rgba(242, 245, 249, .84) 0%, rgba(242, 245, 249, .92) 100%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f5f9;
    --card: rgba(255, 255, 255, .90);
    --card2: rgba(240, 245, 250, .95);
    --line: #d2dce8;
    --text: #142233;
    --muted: #4d6079;
    --green: #0b8a55;
    --green-dark: #086b42;
    --on-green: #ffffff;
    --gold: #a86f00;
    --red: #c9302c;
    --overlay: linear-gradient(180deg, rgba(242, 245, 249, .84) 0%, rgba(242, 245, 249, .92) 100%);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  isolation: isolate;
}
/* Imagem de fundo fixa e levemente desfocada, com uma camada da cor do tema
   por cima para o texto continuar legível. Pseudo-elementos fixos funcionam
   também no iPhone (background-attachment: fixed não). */
body::before {
  content: '';
  position: fixed;
  inset: -20px;
  z-index: -2;
  background: url('img/fundo.webp') center / cover no-repeat;
  filter: blur(3px);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--overlay);
}
.theme-toggle { font-size: 1rem; line-height: 1; padding: 8px 11px; }

/* Escolha de cotas: seletor − 1 + */
.stepper { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 14px auto 0; }
.stepbtn {
  flex: 0 0 48px; height: 48px; border-radius: 50%; cursor: pointer; font: 700 1.5rem/1 inherit;
  background: var(--card2); color: var(--text); border: 1px solid var(--line);
}
.stepbtn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.stepbtn:disabled { opacity: .4; cursor: not-allowed; }
.stepval { flex: 1; text-align: center; line-height: 1.2; }
.stepval b { font-size: 1.6rem; }
.stepval span { font-weight: 600; }
.stepval small { display: block; color: var(--green); font-weight: 700; font-size: 1rem; }

/* Pagamento Pix */
.payhead { margin-bottom: 12px; }
.payamount { font-size: 1.8rem; font-weight: 800; color: var(--green); line-height: 1.15; }
.paygrid { display: grid; grid-template-columns: 1fr 210px; gap: 16px; align-items: start; }
.paystep { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.paystep span {
  flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--green); color: var(--on-green);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.qrwrap { text-align: center; }
.qrwrap p { margin-top: 6px; font-size: .75rem; }
.qr { background: #fff; border-radius: 12px; padding: 6px; width: 100%; max-width: 210px; margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.pixdetails { margin-top: 12px; }
.pixdetails summary { cursor: pointer; color: var(--muted); }
.pixdetails textarea {
  width: 100%; margin: 8px 0 6px; padding: 8px; border-radius: 8px; resize: none;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font: .78rem/1.35 monospace; word-break: break-all;
}
.scroll-x { overflow-x: auto; }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.brand { font-size: 1.15rem; font-weight: 700; }
.brand .ano { color: var(--gold); }
h1 { font-size: 1.7rem; line-height: 1.25; margin-bottom: 10px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
p.muted, .muted { color: var(--muted); }
.small { font-size: .85rem; }
.card { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat .num { font-size: 1.55rem; font-weight: 700; color: var(--green); }
.stat .lbl { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--green); color: var(--on-green); font-weight: 700; font-size: 1rem;
  padding: 12px 20px; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn.sec { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.sec:hover { border-color: var(--muted); background: var(--card2); }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 12px 0 4px; }
input, select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--green); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.check input { width: auto; margin-top: 3px; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: .92rem; display: none; }
.msg.err { display: block; background: rgba(255,107,107,.12); color: var(--red); }
.msg.ok { display: block; background: rgba(25,195,125,.12); color: var(--green); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .92rem;
}
.tabs button.on { background: var(--green); border-color: var(--green); color: var(--on-green); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.pendente { background: rgba(255,193,69,.15); color: var(--gold); }
.badge.confirmado { background: rgba(25,195,125,.15); color: var(--green); }
.badge.rejeitado { background: rgba(255,107,107,.15); color: var(--red); }
.pixbox { background: var(--card2); border: 1px dashed var(--green); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.pixkey { display: flex; gap: 8px; margin: 10px 0; }
.pixkey input { font-family: monospace; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.steps { counter-reset: p; list-style: none; }
.steps li { counter-increment: p; display: flex; gap: 12px; margin-bottom: 14px; }
.steps li::before {
  content: counter(p); flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: var(--on-green); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
footer { margin-top: 32px; color: var(--muted); font-size: .8rem; text-align: center; }
.you { color: var(--gold); font-weight: 700; }
/* Celular: tudo mais compacto. Os campos mantêm a fonte em 16px porque,
   abaixo disso, o iPhone dá zoom na página ao tocar no campo. */
@media (max-width: 620px) {
  body { font-size: 15px; line-height: 1.45; }
  .wrap { padding: 14px 12px 40px; }
  header.site { margin-bottom: 14px; gap: 8px; }
  .brand { font-size: 1rem; }
  h1 { font-size: 1.2rem; margin-bottom: 6px; }
  h2 { font-size: 1rem; margin-bottom: 8px; }
  .card { padding: 14px; margin-bottom: 12px; }

  /* Arrecadado em cima, participantes e cotas lado a lado */
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .stat { padding: 10px 8px; }
  .stat .num { font-size: 1.2rem; }
  .stat .lbl { font-size: .74rem; margin-top: 0; }

  label { font-size: .8rem; margin: 9px 0 3px; }
  input, select { padding: 8px 10px; border-radius: 8px; font-size: 16px; }
  .check { font-size: .82rem; margin-top: 9px; gap: 8px; }
  .btn { padding: 10px 16px; font-size: .95rem; }
  .btn.small { padding: 6px 11px; font-size: .82rem; }
  .theme-toggle { padding: 6px 9px; font-size: .9rem; }
  .tabs { gap: 6px; margin-bottom: 12px; }
  .tabs button { padding: 6px 12px; font-size: .82rem; }
  .msg { font-size: .85rem; padding: 8px 10px; margin-top: 10px; }

  .steps li { gap: 10px; margin-bottom: 10px; }
  .steps li::before { flex-basis: 24px; height: 24px; font-size: .82rem; }
  table { font-size: .82rem; }
  th, td { padding: 7px 6px; }
  th { font-size: .74rem; }
  .badge { font-size: .72rem; padding: 1px 8px; }
  .pixbox { padding: 12px; margin-top: 10px; }
  .stepbtn { flex-basis: 42px; height: 42px; font-size: 1.3rem; }
  .stepval b { font-size: 1.4rem; }
  .payamount { font-size: 1.5rem; }
  /* No celular: botão de copiar primeiro, QR Code embaixo e menor */
  .paygrid { grid-template-columns: 1fr; gap: 12px; }
  .qr { max-width: 170px; }
  footer { margin-top: 22px; font-size: .74rem; }
}

/* Simulador "E se a gente ganhar?" */
.sim .simgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; align-items: stretch; }
.simform label { margin-top: 0; }
.simform .simrow2 label, .simform > label { margin-bottom: 5px; }
.money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card2); }
.money span { padding: 0 12px; color: var(--muted); border-right: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
.money input { border: 0; border-radius: 0; background: transparent; font-weight: 700; }
.money:focus-within { outline: 2px solid var(--green); }
.money input:focus { outline: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.chips button {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  padding: 4px 11px; border-radius: 999px; cursor: pointer; font-size: .8rem;
}
.chips button:hover { border-color: var(--green); }
.chips button.on { background: var(--green); border-color: var(--green); color: var(--on-green); font-weight: 700; }
.simrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.simhint { margin-top: 6px; font-size: .75rem; color: var(--muted); }
.simresult {
  background: var(--card2); border: 1px solid var(--line); border-top: 4px solid var(--gold);
  border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column;
}
.simresult .lbl { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.simresult .big { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 2px 0 12px; overflow-wrap: anywhere; color: var(--text); }
.simlist { margin-top: auto; border-top: 1px solid var(--line); }
.simlist div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.simlist div:last-child { border-bottom: 0; padding-bottom: 0; }
.simlist dt { color: var(--muted); }
.simlist dd { font-weight: 700; text-align: right; white-space: nowrap; }
.simnote { margin-top: 14px; font-size: .75rem; color: var(--muted); }
.youwin { background: var(--card2); border: 1px solid var(--green); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.youwin strong { color: var(--green); font-size: 1.15rem; }
td.num, th.num { text-align: right; white-space: nowrap; }
@media (max-width: 620px) {
  .sim .simgrid { grid-template-columns: 1fr; gap: 14px; }
  .money span { padding: 0 10px; }
  .simresult { padding: 12px 14px; }
  .simresult .big { font-size: 1.5rem; margin-bottom: 8px; }
  .simlist div { font-size: .82rem; padding: 6px 0; }
}
.locked { background: var(--card2); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); }
