/* Base escura da página inicial (/) e da chave da API (/chave), estilo
   painel. Sem fonte remota, para caber na CSP. Sem sombra pesada. */

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.12);
  --ink: #ffffff;
  --muted: #9aa0a6;
  --btn: #ffffff;
  --btn-text: #000000;
  --danger: #ff8b8b;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.011em;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
p {
  margin: 0;
}

h1,
.title,
h1:focus,
h1:focus-visible,
.title:focus,
.title:focus-visible {
  outline: none;
}

:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.shell {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 24px calc(48px + env(safe-area-inset-bottom, 0px));
}

.brand {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.amount {
  margin: 40px 0 0;
  color: var(--ink);
  font-size: clamp(44px, 12vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.count {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.count:empty {
  display: none;
}

.muted {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.011em;
}

.pay,
.payer,
.state {
  margin-top: 36px;
  padding: 28px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pay {
  display: flex;
  flex-direction: column;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.cta:hover {
  background: #f2f2f2;
}

.cta:active {
  background: #e6e6e6;
}

.cta[disabled] {
  opacity: 0.4;
  cursor: default;
}

.steps {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
}

.steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.011em;
  border-top: 1px solid var(--line);
}

.steps li:first-child {
  border-top: 0;
}

.steps li::before {
  content: counter(step);
  width: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  padding: 12px;
  background: #ffffff;
  border: 0;
  border-radius: 12px;
}

.qr-box svg {
  width: 216px;
  height: 216px;
  display: block;
  background: #ffffff;
}

.hint {
  margin: 16px 0 22px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

details.scan {
  margin-top: 16px;
}

details.scan summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  list-style: none;
}

details.scan summary::-webkit-details-marker {
  display: none;
}

details.scan[open] .qr-box {
  margin-top: 8px;
  margin-bottom: 8px;
}

.desktop-only {
  display: none;
}

.mobile-only {
  display: block;
}

@media (min-width: 801px) {
  .desktop-only {
    display: block;
  }

  .mobile-only {
    display: none;
  }

  .shell {
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
  }
}

.state {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.state .check,
.state .amount,
.state .title,
.state .muted {
  text-align: center;
}

.state .cta,
.state .back {
  margin-top: 24px;
}

.check {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  margin: 8px auto 20px;
  align-self: center;
}

.payer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payer .title {
  text-align: left;
  margin-bottom: 8px;
}

.payer label {
  display: block;
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.payer input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.011em;
}

.payer .cta {
  margin-top: 16px;
}

.payer .error {
  min-height: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.011em;
  text-align: left;
  text-transform: none;
}

.payer .error:not(:empty) {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 139, 139, 0.35);
  background: var(--bg-2);
  color: var(--danger);
}

.back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back:hover {
  background: rgba(255, 255, 255, 0.04);
}

.title {
  margin: 0 0 8px;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
}

.wait {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 36px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: left;
}

.wait::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-top-color: #ffffff;
  flex: 0 0 auto;
  animation: pay-spin 0.9s linear infinite;
}

.hidden {
  display: none !important;
}

@keyframes pay-spin {
  to {
    transform: rotate(360deg);
  }
}

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