:root {
  --mint: #b6ded6; /* igual ao fundo do logo */
  --mint-bg: #e8f4f1;
  --mint-dk: #7fbfb3;
  --pink: #c0408f;
  --pink-dk: #9d2f73;
  --pink-lt: #fff0f8;
  --star: #f7c948;
  --ink: #33262f;
  --muted: #6f6168;
  --line: #d9e6e2;
  --card: #ffffff;
  --err: #c62839;
  --ok: #1f8a5b;
  --r: 16px;
  --shadow: 0 2px 10px rgba(80, 40, 70, 0.08);
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--mint-bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
[hidden] { display: none !important; }
a { color: var(--pink-dk); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.4rem; margin-top: .25rem; }

/* ---------- topo ---------- */
.top {
  background: var(--mint);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.brand { text-decoration: none; display: inline-flex; align-items: center; }
.brand-logo { height: 52px; width: 52px; display: block; border-radius: 12px; }
.hero-logo { display: block; width: 180px; height: 180px; margin: 4px auto 0; border-radius: 28px; box-shadow: var(--shadow); }
body[data-step='home'] .brand { visibility: hidden; }
.top-nav a { font-size: .85rem; font-weight: 700; text-decoration: none; color: var(--pink-dk); padding: 8px 4px; }

/* ---------- progresso ---------- */
.progress {
  list-style: none; margin: 0; padding: 10px 12px 6px;
  display: flex; gap: 4px; max-width: 560px; width: 100%; align-self: center;
}
.progress li {
  flex: 1; font-size: .62rem; text-align: center; color: var(--muted);
  border-top: 4px solid var(--line); padding-top: 4px; font-weight: 700;
}
.progress li.done { border-color: var(--mint-dk); color: var(--ink); }
.progress li.now { border-color: var(--pink); color: var(--pink-dk); }

/* ---------- layout ---------- */
main { width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 16px 28px; flex: 1; }
.step { animation: in .22s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } html { scroll-behavior: auto; } }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.hero { text-align: left; margin-top: 8px; }
.eyebrow { margin: 0 0 4px; font-size: .8rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--pink); }
.chips { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--pink-lt); border-radius: 999px; padding: 6px 12px; font-size: .88rem; }
.note { color: var(--muted); margin: 0 0 12px; font-size: .95rem; }
.help { color: var(--muted); font-size: .9rem; margin: 16px 4px 0; }
.center { text-align: center; }
.chosen { background: var(--pink-lt); border-radius: 12px; padding: 8px 12px; font-size: .9rem; margin: 0 0 12px; }
.chosen:empty { display: none; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.lgpd { font-size: .8rem; color: var(--muted); margin: 14px 2px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; min-height: 52px; padding: 12px 18px; margin-top: 10px;
  border: 2px solid transparent; border-radius: 14px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.02rem; text-decoration: none;
  transition: transform .06s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--pink); color: #fff; box-shadow: 0 3px 0 var(--pink-dk); }
.btn.primary:hover { background: var(--pink-dk); }
.btn.ghost { background: #fff; color: var(--pink-dk); border-color: var(--pink); }
.btn.link { background: none; color: var(--pink-dk); text-decoration: underline; min-height: 44px; width: auto; display: inline-flex; padding: 6px 4px; margin: 0; font-weight: 700; }
.btn.small { min-height: 44px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after { border-color: rgba(192,64,143,.3); border-top-color: var(--pink); }
@keyframes spin { to { transform: rotate(360deg); } }
.back { background: none; border: 0; color: var(--pink-dk); font: inherit; font-weight: 700; padding: 8px 0; min-height: 44px; cursor: pointer; }
.actions { margin-top: 18px; }

:focus-visible { outline: 3px solid var(--star); outline-offset: 2px; border-radius: 6px; }
h1:focus, h2:focus { outline: none; }

/* ---------- modalidades ---------- */
.mods { display: grid; gap: 12px; }
.mod {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 16px;
  min-height: 72px; font: inherit; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); width: 100%;
}
.mod:active { transform: scale(.99); }
.mod[aria-checked='true'] { border-color: var(--pink); background: var(--pink-lt); }
.mod-ico { font-size: 1.9rem; width: 44px; text-align: center; flex: none; }
.mod b { display: block; font-size: 1.15rem; }
.mod span.sub { color: var(--muted); font-size: .85rem; }

/* ---------- turmas ---------- */
.grp { margin: 18px 0 6px; font-size: 1rem; color: var(--pink-dk); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grp small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
  min-height: 56px; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.opt[aria-checked='true'] { border-color: var(--pink); background: var(--pink-lt); box-shadow: inset 0 0 0 1px var(--pink); }
.opt[disabled] { background: #f2f2f2; color: #999; cursor: not-allowed; }
.opt .when { font-weight: 800; }
.opt .meta { font-size: .8rem; color: var(--muted); text-align: right; }
.tag { background: #6f6168; color: #fff; border-radius: 6px; font-size: .7rem; font-weight: 800; padding: 2px 6px; margin-left: 6px; letter-spacing: .5px; }

/* ---------- formulários ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 18px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
legend { font-weight: 900; color: var(--pink-dk); padding: 0 8px; margin-left: -8px; font-size: 1.05rem; float: left; width: 100%; margin-bottom: 8px; }
legend + * { clear: both; }
.field { margin-bottom: 14px; }
.field label, .q { display: block; font-weight: 700; margin-bottom: 4px; font-size: .95rem; }
.q { margin-top: 0; }
input[type='text'], input[type='tel'], input[type='email'], input[type='date'], textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px evita zoom no iOS */
  padding: 12px 12px; min-height: 50px; color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; background: #fff; appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 3px rgba(192,64,143,.18); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.err { color: var(--err); font-size: .85rem; font-weight: 700; margin: 4px 0 0; display: block; min-height: 0; }
.err:empty { display: none; }
.seg { display: flex; gap: 10px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px;
  border: 2px solid var(--line); font-weight: 800; cursor: pointer; background: #fff;
}
.seg input:checked + span { border-color: var(--pink); background: var(--pink-lt); color: var(--pink-dk); }
.seg input:focus-visible + span { outline: 3px solid var(--star); outline-offset: 2px; }
.rules { background: #fff; border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow); font-size: .92rem; }
.rules summary { font-weight: 800; cursor: pointer; min-height: 32px; }
.rules ul { padding-left: 20px; margin: 8px 0; }

/* ---------- contrato ---------- */
.contract {
  background: #fff; border-radius: var(--r); box-shadow: var(--shadow);
  height: 52vh; height: 52dvh; min-height: 260px; max-height: 520px;
  overflow-y: auto; padding: 16px; font-size: .9rem; line-height: 1.55; border: 2px solid var(--line);
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.contract h3 { text-align: center; font-size: 1.05rem; margin: 0 0 12px; }
.contract h4 { font-size: .95rem; margin: 16px 0 4px; color: var(--pink-dk); }
.contract p { margin: 0 0 8px; text-align: left; hyphens: auto; }
.scroll-hint { text-align: center; color: var(--pink-dk); font-weight: 800; font-size: .85rem; margin: 8px 0; }
.scroll-hint.done { color: var(--ok); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: #fff; border-radius: 12px; border: 2px solid var(--line); margin-top: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 26px; height: 26px; flex: none; accent-color: var(--pink); margin: 0; }
.check.off { opacity: .55; }
.sign { margin-top: 16px; }
.sign.off { opacity: .45; pointer-events: none; }
.pad { position: relative; background: #fff; border: 2px dashed var(--mint-dk); border-radius: 14px; overflow: hidden; }
.pad { background: #fff; }
.pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 640 / 220; touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; left: 12px; bottom: 30px; color: #bbb; pointer-events: none; font-size: 1.1rem; }
.pad::after { content: ''; position: absolute; left: 36px; right: 16px; bottom: 36px; border-bottom: 1px solid #ccc; pointer-events: none; }

/* ---------- pix ---------- */
.pix { text-align: center; }
.pix-valor { display: flex; justify-content: space-between; align-items: baseline; background: var(--pink-lt); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
.pix-valor strong { font-size: 1.5rem; color: var(--pink-dk); }
#qr { display: block; margin: 0 auto 8px; width: min(72vw, 260px); height: auto; image-rendering: pixelated; border: 6px solid #fff; box-shadow: 0 0 0 2px var(--line); border-radius: 8px; background: #fff; }
#pix-code { width: 100%; font: .78rem/1.3 ui-monospace, Consolas, monospace; border: 2px solid var(--line); border-radius: 12px; padding: 10px; resize: none; color: var(--muted); background: #fafafa; word-break: break-all; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .9rem; margin: 14px 0 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- ok ---------- */
.ok { text-align: center; }
.ok-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2.4rem; line-height: 72px; margin: 0 auto 8px; font-weight: 900; }
.code {
  font-size: 2.1rem; font-weight: 900; letter-spacing: 3px; color: var(--pink);
  background: var(--pink-lt); border: 2px dashed var(--pink); border-radius: 14px; padding: 12px 6px; margin: 8px 0; word-break: break-all;
}
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; margin: 18px 0 8px; font-size: .95rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 800; text-align: right; }

/* ---------- consulta ---------- */
.res { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin-top: 12px; border-left: 6px solid var(--line); }
.res.pago { border-left-color: var(--ok); }
.res.pend { border-left-color: var(--star); }
.res h3 { margin: 0 0 2px; font-size: 1.05rem; }
.res p { margin: 2px 0; font-size: .92rem; color: var(--muted); }
.res .badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #eee; margin-bottom: 6px; }
.res.pago .badge { background: #d9f3e6; color: var(--ok); }
.res.pend .badge { background: #fff1c4; color: #8a6400; }
.res .cod { font-size: 1.3rem; font-weight: 900; letter-spacing: 2px; color: var(--pink); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.foot p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; z-index: 50; max-width: 90vw; text-align: center;
}

@media (min-width: 600px) {
  main { padding-top: 24px; }
  .mods { grid-template-columns: 1fr 1fr; }
}

.closed { background: var(--pink-lt); border-radius: 12px; padding: 12px 14px; font-weight: 700; color: var(--pink-dk); margin: 0 0 8px; }

.test-banner { background: #fff1c4; color: #8a6400; font-weight: 800; font-size: .85rem; text-align: center; padding: 8px 12px; margin: 0; }

.photo-row { display: flex; align-items: center; gap: 16px; }
.avatar { width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 2rem; background: var(--pink-lt); border: 3px dashed var(--pink); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has { border-style: solid; }
.photo-actions { flex: 1; min-width: 0; }
.photo-actions .btn { margin-top: 0; }
#err-foto { margin: 6px 0 0; }
fieldset .hint { margin: 10px 0 0; }

.legal h1 { margin-top: 0; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal li { margin: 4px 0; }
.check a { color: inherit; text-decoration: underline; }
.foot a { color: inherit; }
