/* Arial; onde não existir (maioria dos Android), Liberation Sans — mesmas medidas da Arial (licença OFL em assets/fonts) */
@font-face { font-family: "Arial Reserva"; font-weight: 400; font-display: block;
  src: local("Arial"), local("ArialMT"), url("/assets/fonts/LiberationSans-Regular.woff") format("woff"); }
@font-face { font-family: "Arial Reserva"; font-weight: 700; font-display: block;
  src: local("Arial Bold"), local("Arial-BoldMT"), url("/assets/fonts/LiberationSans-Bold.woff") format("woff"); }
:root {
  --fundo: #14110F;
  --destaque: #FF5B2E;
  --destaque2: #F2C94C;
  --texto: #F5EFE6;
  --muted: color-mix(in srgb, var(--texto) 62%, transparent);
  --linha: color-mix(in srgb, var(--texto) 16%, transparent);
  --campo: color-mix(in srgb, var(--texto) 7%, transparent);
  --f-titulo: "Bricolage Grotesque", system-ui, sans-serif;
  --f-texto: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body { font: 16px/1.45 var(--f-texto); -webkit-font-smoothing: antialiased; min-height: 100dvh; overflow-x: hidden; }
.hidden { display: none !important; }

.bg-shape {
  position: fixed; inset: auto -30vw -30vw auto; width: 80vw; height: 80vw; max-width: 560px; max-height: 560px;
  border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--destaque), transparent 68%);
  opacity: .22; pointer-events: none; z-index: 0;
}
.wrap { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px 48px; }

.top { margin: 8px 0 20px; }
.kicker { margin: 0; font-weight: 700; letter-spacing: .22em; font-size: 12px; color: var(--muted); }
.event { margin: 2px 0 4px; font: 800 clamp(44px, 14vw, 68px)/.92 var(--f-titulo); color: var(--destaque); letter-spacing: -.02em; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }

.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; }
.steps li { flex: 1; font-size: 12px; font-weight: 500; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--linha); transition: .25s; }
.steps li.on { color: var(--texto); border-color: var(--destaque); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; letter-spacing: .02em; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
input, select {
  width: 100%; font: 500 17px var(--f-texto); color: var(--texto); background: var(--campo);
  border: 1.5px solid var(--linha); border-radius: 14px; padding: 14px 16px; outline: none; appearance: none;
  transition: border-color .15s, background .15s;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--texto) 50%), linear-gradient(135deg, var(--texto) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
select option { color: #111; }
input::placeholder { color: color-mix(in srgb, var(--texto) 38%, transparent); }
input:focus, select:focus { border-color: var(--destaque); background: color-mix(in srgb, var(--destaque) 8%, transparent); }
input[name="setor_outro"] { margin-top: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 6px 0 18px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; padding: 0; border-radius: 6px; margin-top: 1px; display: grid; place-content: center; }
.check input:checked { background: var(--destaque); border-color: var(--destaque); }
.check input:checked::after { content: "✓"; color: var(--fundo); font-weight: 800; font-size: 14px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px;
  border-radius: 999px; border: 0; font: 700 17px var(--f-texto); cursor: pointer; text-decoration: none;
  transition: transform .1s, opacity .15s, background .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--destaque); color: var(--fundo); }
.btn.ghost { background: transparent; color: var(--texto); border: 1.5px solid var(--linha); }
.btn.small { min-height: 44px; font-size: 14.5px; }
.link { background: none; border: 0; color: var(--muted); font: 500 14px var(--f-texto); margin: 18px auto 0; display: block; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.error { color: #ff8a73; font-size: 14px; min-height: 0; margin: 0 0 12px; }
.error:empty { display: none; }
.lead { color: var(--muted); margin: 0 0 18px; }

.pick { padding: 28px 20px; border: 1.5px dashed var(--linha); border-radius: 24px; text-align: center; }
.pick-btns { display: grid; gap: 10px; }

.canvas-box { position: relative; }
#preview { width: 100%; height: auto; max-height: 62vh; object-fit: contain; display: block; margin: 0 auto; border-radius: 18px; touch-action: none; cursor: grab; box-shadow: 0 20px 60px -20px #000; }
#preview:active { cursor: grabbing; }
.hint { text-align: center; font-size: 12.5px; color: var(--muted); margin: 10px 0 6px; }
.zoom { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.zoom input { padding: 0; height: 6px; border: 0; background: var(--linha); border-radius: 4px; }
.zoom input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--destaque); border: 3px solid var(--fundo); }
.zoom input::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--destaque); border: 3px solid var(--fundo); }
.icon { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--linha); background: none; color: var(--texto); font-size: 20px; cursor: pointer; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.done { text-align: center; margin-bottom: 18px; }
.ok-badge { display: inline-block; background: color-mix(in srgb, var(--destaque2) 18%, transparent); color: var(--destaque2); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; margin: 0 0 10px; }
.done h2 { font: 800 34px/1.05 var(--f-titulo); margin: 0 0 8px; }
.format { display: flex; background: var(--campo); border-radius: 999px; padding: 4px; margin: 0 auto 14px; max-width: 300px; }
.format button { flex: 1; border: 0; background: none; color: var(--muted); font: 700 13px var(--f-texto); padding: 9px; border-radius: 999px; cursor: pointer; }
.format button[aria-selected="true"] { background: var(--texto); color: var(--fundo); }
.art-box { display: grid; place-items: center; margin-bottom: 18px; }
.art-box img { width: 100%; max-height: 64vh; object-fit: contain; border-radius: 16px; box-shadow: 0 20px 60px -20px #000; }
.share { display: grid; gap: 10px; }
.share-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.chip { border: 1.5px solid var(--linha); background: none; color: var(--texto); font: 500 14px var(--f-texto); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.chip:active { background: var(--campo); }
.tip { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }
.tip b { color: var(--texto); }
.toast { text-align: center; font-size: 14px; color: var(--destaque2); min-height: 20px; margin: 0; }

.step { animation: in .35s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }



/* ================= Celular primeiro ================= */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100svh; }
.wrap { padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-left)) calc(28px + env(safe-area-inset-bottom)); }

/* cabeçalho compacto e centralizado */
.top { margin: 4px 0 18px; text-align: center; }
.event { margin: 0; line-height: 0; }
.event-logo { display: block; width: clamp(150px, 46vw, 220px); height: auto; margin: 0 auto 6px; }
.meta { font-size: 13px; }

/* etapas */
.steps { margin-bottom: 20px; }
.steps li { text-align: center; font-size: 12px; }

/* campos: alvo de toque confortável; sem setinhas no campo de número */
input:not([type=range]):not([type=checkbox]), select { min-height: 52px; }
.zoom input[type=range] { min-height: 0; height: 6px; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.check { padding: 4px 0; }

/* prévia da arte cabe na tela junto com os controles */
#preview { max-height: 54svh; width: auto; max-width: 100%; }
.art-box img { max-height: 54svh; width: auto; max-width: 100%; }
.hint { margin: 8px 0 2px; }
.icon { width: 44px; height: 44px; }

/* botão principal sempre à mão: gruda no pé da tela enquanto houver conteúdo abaixo */
.cta-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 -18px; padding: 14px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--fundo) 34%);
}

/* tela final */
.done { margin-bottom: 14px; }
.done h2 { font-size: clamp(26px, 8vw, 34px); }
.done .lead { margin-bottom: 0; }
.share { gap: 8px; margin-top: 4px; }
.art-box { margin-bottom: 4px; }
.share .tip { margin: 0 0 4px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 6px; }
.chip { min-height: 48px; padding: 10px; font-weight: 700; }

/* aviso flutuante (sempre visível) */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); z-index: 20;
  background: var(--texto); color: var(--fundo); font-weight: 700; font-size: 14px;
  padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
  min-height: 0; transition: opacity .2s, transform .2s;
}
.toast:empty { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; padding: 0; }

/* telas bem pequenas (iPhone SE 1ª geração, Androids compactos) */
@media (max-width: 350px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .cta-bar { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .event-logo { width: 140px; }
  .steps li { font-size: 11px; }
  .btn { font-size: 16px; min-height: 52px; }
}
/* telas baixas (celular deitado, teclado aberto) */
@media (max-height: 600px) { #preview, .art-box img { max-height: 70svh; } }
