:root {
  --yellow: #FCB900;
  --ink: #0B0B0B;
  --paper: #FFFFFF;
  --mist: #F4F4F1;
  --turq: #00A99D;
  --turq-deep: #006E65; /* texto/ícone sobre branco: contraste 6:1 */
  --danger: #A4160A;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--yellow); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: var(--yellow);
  -webkit-text-size-adjust: 100%;
}

.top {
  padding: calc(28px + env(safe-area-inset-top)) 24px 44px;
}
.logo { display: block; width: 168px; height: auto; background: #fff; padding: 10px 14px; border-radius: 16px; }

.sheet {
  flex: 1;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  margin-top: -20px;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  max-width: 560px;
  width: 100%;
  align-self: center;
}

h1 { margin: 0 0 8px; font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.lead { margin: 0 0 28px; font-size: 1.0625rem; line-height: 1.45; color: #3a3a3a; max-width: 34ch; }

.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 1rem; font-weight: 700; }

input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  font: inherit;
  font-size: 1.125rem; /* >=16px evita zoom no iOS */
  color: var(--ink);
  background: var(--mist);
  border: 2px solid transparent;
  border-bottom-color: var(--ink);
  border-radius: 12px 12px 0 0;
}
input::placeholder { color: #6b6b6b; }

/* o código imita a tela da TV: preto com letras amarelas bem espaçadas */
.ticket {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  min-height: 72px;
  color: var(--yellow);
  background: var(--ink);
  border: 0;
  border-radius: 16px;
  padding: 0 12px 0 calc(12px + 0.22em);
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--turq);
  outline-offset: 3px;
}
input:focus-visible { border-bottom-color: var(--turq-deep); }

.pw { position: relative; }
.pw input { padding-right: 104px; }
.pw button {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 88px; height: 44px;
  font: inherit; font-size: 0.9375rem; font-weight: 700;
  color: var(--turq-deep);
  background: transparent;
  border: 0; border-radius: 10px;
  cursor: pointer;
}
.pw button[aria-pressed="true"] { background: #DDF3F1; }

.error {
  margin: 4px 0 20px;
  padding: 12px 14px;
  font-size: 1rem; font-weight: 600; line-height: 1.35;
  color: var(--danger);
  background: #FDECEA;
  border-left: 4px solid var(--danger);
  border-radius: 4px 12px 12px 4px;
}
/* vazio: continua no DOM (região viva), sem ocupar espaço */
.error:empty { margin: 0; padding: 0; border: 0; height: 0; overflow: hidden; }

.cta {
  width: 100%;
  min-height: 60px;
  font: inherit; font-size: 1.25rem; font-weight: 800;
  color: var(--yellow);
  background: var(--ink);
  border: 0; border-radius: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.cta:active { transform: scale(0.98); }
.cta:disabled { background: #4a4a4a; cursor: progress; }
.cta[aria-busy="true"] span::after { content: "…"; }

.success { text-align: center; padding: 24px 0; outline: none; }
.success[hidden] { display: none; }
.success svg circle { fill: var(--turq); }
.success svg path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 0.5s 0.15s ease-out forwards; }
.success h2 { margin: 20px 0 8px; font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.success p { margin: 0; font-size: 1.0625rem; color: #3a3a3a; }

@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .success svg path { animation: none; stroke-dashoffset: 0; }
  .cta { transition: none; }
}

@media (min-width: 600px) {
  .sheet { border-radius: 28px; margin-bottom: 40px; }
}
