/* Layout: app de bancada em uma coluna; identidade escura do Stencil Pro (ciano = ferramenta, laranja = dinheiro) */
:root {
  --bg: #061014;
  --surface: #0d2027;
  --surface-2: #112a33;
  --field: #08171c;
  --line: rgb(46 230 255 / .14);
  --line-strong: rgb(46 230 255 / .34);
  --cyan: #2ee6ff;
  --orange: #ff7a1a;
  --orange-hot: #ff9a3d;
  --on-orange: #1a0b00;
  --bone: #f1ebe0;
  --muted: #9fb4ba;
  --good: #3ddc84;
  --warn: #ffc845;
  --bad: #ff5a5a;
  --font-gothic: "New Rocker", "Old English Text MT", serif;
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--bone);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(96px + env(safe-area-inset-bottom, 0px));
  background-image: radial-gradient(80% 40% at 50% 0%, rgb(46 230 255 / .10), transparent 70%);
  background-repeat: no-repeat;
}
.app { max-width: 560px; margin-inline: auto; display: grid; gap: 14px; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* topo */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 6px; }
.brand { display: grid; line-height: 1; }
.brand h1 { font-family: var(--font-gothic); font-weight: 400; font-size: 1.9rem; color: var(--bone); text-shadow: 0 0 22px rgb(46 230 255 / .35); }
.brand small { margin-top: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.rate-chip { cursor: pointer; text-align: right; display: grid; justify-items: end; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rate-chip b { font-size: 1.05rem; color: var(--cyan); letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* blocos */
.block { display: grid; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.block h2 { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.hint { font-size: .82rem; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field > span { font-size: .85rem; font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > * { min-width: 0; }
input[type=text], input[type=tel], input[type=date], input[type=time] {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--line); font-size: 1rem;
}
input[type=text]:focus, input[type=tel]:focus, input[type=date]:focus, input[type=time]:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgb(46 230 255 / .18); }
.money { position: relative; }
.money input { padding-left: 38px; font-variant-numeric: tabular-nums; font-weight: 700; }
.money::before { content: attr(data-pre); position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); font-size: .85rem; font-weight: 700; pointer-events: none; }
.money.suf input { padding-left: 12px; padding-right: 44px; }
.money.suf::before { left: auto; right: 12px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--field); border: 1px solid var(--line); font-size: .9rem; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.chip[aria-pressed=true] { background: rgb(46 230 255 / .14); border-color: var(--cyan); color: var(--cyan); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.seg .chip { border: 0; border-radius: 10px; background: transparent; min-height: 40px; padding: 6px 4px; font-size: .86rem; }
.seg .chip[aria-pressed=true] { background: var(--cyan); color: #04161a; }

/* tamanho */
.size-head { display: flex; justify-content: space-between; align-items: baseline; }
.size-val { font-style: italic; font-weight: 900; font-stretch: 115%; font-size: 1.6rem; color: var(--bone); font-variant-numeric: tabular-nums; }
.size-val small { font-size: .8rem; color: var(--muted); font-style: normal; font-weight: 600; font-stretch: 100%; }
input[type=range] { width: 100%; accent-color: var(--cyan); height: 32px; }

/* interruptores */
.toggles { display: grid; gap: 8px; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); cursor: pointer; }
.tg span { display: grid; font-weight: 600; font-size: .92rem; }
.tg small { color: var(--muted); font-weight: 400; font-size: .78rem; }
.tg input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #22363d; position: relative; cursor: pointer; transition: background .15s; }
.tg input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--bone); transition: transform .15s; }
.tg input:checked { background: var(--cyan); }
.tg input:checked::after { transform: translateX(18px); background: #04161a; }

/* tempo */
.time { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.step { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--field); font-size: 1.6rem; font-weight: 700; color: var(--cyan); cursor: pointer; }
.time__val { text-align: center; }
.time__val b { display: block; font-style: italic; font-weight: 900; font-stretch: 120%; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.time__val span { font-size: .82rem; color: var(--muted); }
.reset { justify-self: center; background: none; border: 0; color: var(--cyan); font-size: .82rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }

/* resultado */
.result { border: 1px solid rgb(255 122 26 / .55); background: linear-gradient(180deg, #13262c, #0a1a20); box-shadow: 0 30px 70px -40px rgb(255 122 26 / .55); }
.result h2 { color: var(--orange); }
.hero-price { display: grid; gap: 2px; }
.hero-price small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.hero-price b { font-style: italic; font-weight: 900; font-stretch: 118%; font-size: clamp(2.6rem, 11vw, 3.4rem); line-height: 1; color: var(--orange); letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgb(255 122 26 / .3); }
.hero-price span { font-size: .9rem; font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgb(0 0 0 / .25); border: 1px solid var(--line); min-width: 0; }
.kv dt, .kv small { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kv b { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kv .lock b { color: var(--cyan); }
details.why { border-top: 1px solid var(--line); padding-top: 10px; }
details.why summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--muted); }
.why table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .86rem; font-variant-numeric: tabular-nums; }
.why td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.why td:last-child { text-align: right; font-weight: 700; }
.earn { padding: 10px 12px; border-radius: 12px; font-size: .88rem; background: rgb(61 220 132 / .08); border: 1px solid rgb(61 220 132 / .35); }
.earn b { color: var(--good); }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 18px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--orange-hot), var(--orange)); color: var(--on-orange);
  font-style: italic; font-weight: 900; font-stretch: 112%; text-transform: uppercase; font-size: 1rem;
  text-decoration: none; box-shadow: 0 10px 34px -10px rgb(255 122 26 / .6);
}
.btn--ghost { background: transparent; color: var(--cyan); border: 1px solid var(--line-strong); box-shadow: none; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.actions { display: grid; gap: 8px; }
.msg-preview { width: 100%; min-height: 200px; padding: 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font: .85rem/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; color: #cfe0e4; resize: vertical; }
.toast { min-height: 1.2em; font-size: .85rem; font-weight: 700; color: var(--good); text-align: center; }

/* contraproposta */
.verdict { padding: 12px; border-radius: 12px; font-size: .9rem; border: 1px solid var(--line); background: var(--field); }
.verdict strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.verdict[data-v=good] { border-color: rgb(61 220 132 / .5); } .verdict[data-v=good] strong { color: var(--good); }
.verdict[data-v=warn] { border-color: rgb(255 200 69 / .5); } .verdict[data-v=warn] strong { color: var(--warn); }
.verdict[data-v=bad] { border-color: rgb(255 90 90 / .55); } .verdict[data-v=bad] strong { color: var(--bad); }

/* estúdio */
.rate-big { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 12px; background: rgb(46 230 255 / .07); border: 1px solid var(--line-strong); }
.rate-big span { font-size: .85rem; font-weight: 700; }
.rate-big b { font-style: italic; font-weight: 900; font-stretch: 118%; font-size: 1.8rem; color: var(--cyan); font-variant-numeric: tabular-nums; }
.example-note { padding: 12px 14px; border-radius: 12px; border: 1px dashed rgb(255 200 69 / .5); color: var(--warn); font-size: .85rem; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 14px; cursor: pointer; font-size: .85rem; font-weight: 700; }
.link-btn.confirm { border-color: var(--bad); color: var(--bad); }

/* navegação inferior */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px), calc((100vw - 560px) / 2)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px), calc((100vw - 560px) / 2));
  background: rgb(6 16 20 / .94); border-top: 1px solid var(--line-strong); backdrop-filter: blur(10px);
}
.nav button { min-height: 52px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 800; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nav button svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-current=page] { background: var(--surface); border-color: var(--line-strong); color: var(--cyan); }
.nav .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-size: .72rem; display: inline-grid; place-items: center; }
.nav .badge[hidden] { display: none; }

.sync-status { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.sync-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-status[data-kind=ok]::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.sync-status[data-kind=warn]::before { background: var(--warn); }
.ret-box { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); background: rgb(46 230 255 / .05); }

/* sinal editável */
.sinal-edit { display: flex; align-items: center; gap: 4px; color: var(--cyan); font-weight: 800; font-size: 1.15rem; }
.sinal-edit input { width: 100%; min-width: 0; min-height: 36px; padding: 2px 8px; border-radius: 8px; background: rgb(46 230 255 / .08); border: 1px dashed var(--line-strong); color: var(--cyan); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.sinal-edit input:focus { outline: none; border-style: solid; border-color: var(--cyan); }
.mini-link { background: none; border: 0; padding: 0; color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }

/* envio */
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn--sm { min-height: 50px; padding: 10px 10px; font-size: .8rem; gap: 6px; }
.btn[aria-disabled=true] { opacity: .45; }

/* agenda */
.alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 12px; background: rgb(255 122 26 / .1); border: 1px solid rgb(255 122 26 / .55); color: var(--bone); font-size: .9rem; font-weight: 700; text-align: left; cursor: pointer; }
.alert b { color: var(--orange); white-space: nowrap; }
.alert[hidden] { display: none; }
.list { display: grid; gap: 10px; }
.appt { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.appt.due { border-color: rgb(255 122 26 / .6); }
.appt__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.appt__when { font-style: italic; font-weight: 900; font-stretch: 115%; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.appt__who { font-weight: 700; }
.appt__meta { font-size: .82rem; color: var(--muted); }
.appt__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { flex: none; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: rgb(46 230 255 / .12); color: var(--cyan); }
.tag.hot { background: rgb(255 122 26 / .18); color: var(--orange-hot); }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--cyan); font-weight: 700; font-size: .85rem; text-decoration: none; cursor: pointer; }
.pill-btn.hot { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.pill-btn.done { color: var(--good); border-color: rgb(61 220 132 / .4); }
.pill-btn.quiet { color: var(--muted); border-color: var(--line); }
.pill-btn.confirm { color: var(--bad); border-color: var(--bad); }
.empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: .9rem; }

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

/* ---------- telas de entrada (login, código, aparelhos) ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); margin-bottom: -96px; }
.gate__card { width: 100%; max-width: 420px; display: grid; gap: 14px; padding: 24px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 80px -50px rgb(46 230 255 / .35); }
.gate__card--center { justify-items: center; text-align: center; background: transparent; border: 0; box-shadow: none; }
.gate__brand { font-family: var(--font-gothic); font-size: 2rem; line-height: 1; color: var(--bone); text-shadow: 0 0 22px rgb(46 230 255 / .35); }
.gate__title { font-style: italic; font-weight: 900; font-stretch: 115%; font-size: 1.5rem; line-height: 1.15; text-wrap: balance; }
.gate__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.gate a, .overlay a, .hint a { color: var(--cyan); }
input[type=email] { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-size: 1rem; color: inherit; font-family: inherit; }
input[type=email]:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgb(46 230 255 / .18); }
.codigo-input { text-align: center; font-size: 1.8rem !important; font-weight: 800; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.btn:disabled, .link-btn:disabled, .pill-btn:disabled { opacity: .55; cursor: default; }
.verdict[data-v=good] { border-color: rgb(61 220 132 / .5); }

.aparelhos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aparelho { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.aparelho__info { display: grid; gap: 2px; min-width: 0; }
.aparelho__info small { color: var(--muted); font-size: .8rem; }

/* ---------- boas-vindas ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgb(3 9 12 / .82); backdrop-filter: blur(6px); }
.overlay__card { width: 100%; max-width: 460px; display: grid; gap: 14px; padding: 22px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-strong); }
.passos { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: .92rem; }
.passos b { color: var(--cyan); }
[data-passos] { display: grid; gap: 12px; }

/* ---------- rodapé de licença ---------- */
.licenca { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 10px 4px 4px; font-size: .74rem; color: var(--muted); }
.licenca b { color: var(--bone); font-weight: 700; }
.licenca__links a, .licenca__links .mini-link { color: var(--muted); }
.demo-banner { margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgb(255 200 69 / .5); color: var(--warn); font-size: .82rem; }
