:root {
  --primary: #2563eb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bad: #dc2626;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #0b1220;
  -webkit-font-smoothing: antialiased;
}

/* Fundo: imagem do local (se houver) sobre um degradê da cor primária */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 85%, #000) 0%, #0b1220 85%);
  background-size: cover; background-position: center;
}
.bg.has-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(8 12 24 / .35), rgb(8 12 24 / .75));
}

.shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.logo { max-height: 64px; max-width: 220px; object-fit: contain; }
.site-name { font-weight: 600; letter-spacing: .02em; opacity: .9; }

.card {
  width: 100%; max-width: 440px; background: #fff; border-radius: var(--radius);
  padding: 26px 22px; box-shadow: 0 20px 50px rgb(0 0 0 / .35);
}
h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 6px; }
h2 { margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.center { text-align: center; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: #334155; }
input[type=text], input[type=email] {
  width: 100%; font: inherit; font-size: 16px; /* 16px evita zoom no iOS */
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #f8fafc;
  transition: border-color .15s, background .15s;
}
input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.code { text-align: center; letter-spacing: .5em; font-size: 1.6rem !important; font-weight: 700; margin-bottom: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: #475569; margin: 4px 0 16px; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check a { color: var(--primary); }

.btn {
  display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 1rem; color: #fff; background: var(--primary);
  border: 0; border-radius: 12px; padding: 14px 16px; transition: filter .15s, opacity .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--primary); margin-top: 6px; }

.error { color: var(--bad); font-size: .88rem; margin: 0 0 12px; }

.media { margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: #0f172a; }
.media img, .media video { display: block; width: 100%; max-height: 52vh; object-fit: contain; }
.media a { display: block; }
.question { font-weight: 600; margin: 0 0 12px; }
.options { display: grid; gap: 8px; margin-bottom: 16px; }
.option {
  font: inherit; text-align: left; padding: 13px 14px; border-radius: 12px; cursor: pointer;
  background: #f8fafc; border: 1.5px solid var(--line); color: var(--ink);
}
.option.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); font-weight: 600; }

.tick {
  width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; color: #fff; background: #16a34a;
}
.tick.bad { background: var(--bad); }
.spinner {
  width: 44px; height: 44px; margin: 10px auto 16px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { color: rgb(255 255 255 / .6); font-size: .78rem; text-align: center; }

.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .6); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 22px; width: 100%; max-width: 480px; max-height: 85vh; display: flex; flex-direction: column; gap: 12px; }
.terms-body { overflow: auto; white-space: pre-wrap; color: #334155; font-size: .92rem; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
