:root {
  --bg: #efe7d6; --bg2: #e2d6bb; --ink: #2a3225; --muted: #69725d;
  --glass: rgba(255, 251, 242, .56); --glass-strong: rgba(255, 251, 242, .78); --edge: rgba(255, 255, 255, .75); --edge2: rgba(80, 95, 55, .12);
  --accent: #78905a; --accent-d: #55693b; --accent-ink: #fffdf6; --soft: rgba(120, 144, 90, .14);
  --warn: #b5532f; --ok: #4f7a45; --shadow: 0 18px 50px -18px rgba(60, 70, 35, .35);
  --blob1: #b7c68f; --blob2: #e9d9b0; --blob3: #9fb27a;
  --r: 22px; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141a11; --bg2: #1c2417; --ink: #efe8d5; --muted: #a2ac8d;
  --glass: rgba(38, 48, 31, .5); --glass-strong: rgba(34, 43, 28, .78); --edge: rgba(255, 255, 255, .14); --edge2: rgba(0, 0, 0, .35);
  --accent: #a9bf7c; --accent-d: #c9dba1; --accent-ink: #172010; --soft: rgba(169, 191, 124, .14);
  --warn: #e3946d; --ok: #9ccb88; --shadow: 0 18px 50px -18px rgba(0, 0, 0, .7);
  --blob1: #3b4b2b; --blob2: #4a4630; --blob3: #2f3f26; color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.4; -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom); overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hide { display: none !important; }

/* fundo vivo */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(160deg, var(--bg), var(--bg2)); }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .85; animation: drift 22s ease-in-out infinite alternate; }
.bg i:nth-child(1) { width: 55vmax; height: 55vmax; background: var(--blob1); left: -15vmax; top: -18vmax; }
.bg i:nth-child(2) { width: 45vmax; height: 45vmax; background: var(--blob2); right: -14vmax; top: 18vh; animation-duration: 28s; animation-delay: -6s; }
.bg i:nth-child(3) { width: 40vmax; height: 40vmax; background: var(--blob3); left: 10vw; bottom: -20vmax; animation-duration: 25s; animation-delay: -12s; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }

/* vidro */
.glass {
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r);
  -webkit-backdrop-filter: blur(26px) saturate(185%); backdrop-filter: blur(26px) saturate(185%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--shadow);
}

/* topo */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--glass); border-bottom: 1px solid var(--edge2);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; }
.brand svg { height: 30px; width: auto; color: var(--accent-d); flex: none; }
.brand b { font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; font-size: 10px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; margin-top: -1px; }
.icon-btn, .pill-btn {
  border: 1px solid var(--edge); background: var(--glass); border-radius: 999px; height: 38px; min-width: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .15s, background .2s;
}
.icon-btn { padding: 0; width: 38px; }
.icon-btn:active, .pill-btn:active { transform: scale(.94); }
.icon-btn svg, .pill-btn svg { width: 19px; height: 19px; }
.pill-btn { font-size: 13px; font-weight: 600; }
.install { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

#themeBtn .sun, #themeBtn .moon { transition: transform .6s cubic-bezier(.3, 1.4, .5, 1), opacity .4s; transform-origin: center; }
#themeBtn svg { position: absolute; }
#themeBtn { position: relative; overflow: hidden; }
:root[data-theme="light"] #themeBtn .moon { transform: rotate(-90deg) scale(.3); opacity: 0; }
:root[data-theme="dark"] #themeBtn .sun { transform: rotate(90deg) scale(.3); opacity: 0; }

.usage { font-size: 13px; font-weight: 700; padding: 0 12px 0 8px; font-variant-numeric: tabular-nums; }
.usage .ring { width: 22px; height: 22px; }
.usage.warn { color: var(--warn); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .bgc { stroke: var(--soft); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1), stroke .3s; }
.usage.warn .fg { stroke: var(--warn); }

#out { scroll-margin-top: 66px; }
main { max-width: 780px; margin: 0 auto; padding: 14px 14px 80px; }
.center { min-height: calc(100dvh - 70px); display: grid; place-items: center; padding: 16px 14px 40px; }
.panel { width: min(440px, 100%); padding: 26px 22px 22px; }
.panel h2 { font-size: 22px; letter-spacing: -.01em; }
.panel .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.logo-big { display: flex; justify-content: center; margin-bottom: 18px; color: var(--accent-d); }
.logo-big svg { height: 62px; width: auto; }

label.f { display: block; margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.input {
  width: 100%; height: 48px; margin-top: 6px; border-radius: 14px; border: 1px solid var(--edge2);
  background: var(--glass-strong); padding: 0 14px; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.pw { position: relative; }
.pw .icon-btn { position: absolute; right: 5px; top: 11px; width: 34px; height: 34px; border: 0; background: transparent; backdrop-filter: none; }
.btn {
  width: 100%; height: 50px; margin-top: 18px; border: 0; border-radius: 15px; font-weight: 700; font-size: 16px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s, opacity .2s, filter .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--edge2); box-shadow: none; margin-top: 10px; height: 44px; font-weight: 600; }
.err { color: var(--warn); font-size: 13.5px; min-height: 20px; margin-top: 12px; }

/* carregamento */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .6s, visibility .6s; }
#loader.out { opacity: 0; visibility: hidden; }
#loader .bg { z-index: 0; }
.ld { position: relative; z-index: 1; text-align: center; width: min(360px, 90vw); }
.ld .stage { position: relative; height: min(46vh, 330px); }
.ld canvas { width: 100%; height: 100%; display: block; }
.ld .floor { position: absolute; left: 50%; bottom: 6%; width: 62%; height: 28px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(40, 55, 25, .35), transparent); filter: blur(6px); animation: floor 3.2s ease-in-out infinite; }
:root[data-theme="dark"] .ld .floor { background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent); }
@keyframes floor { 50% { transform: translateX(-50%) scale(.82); opacity: .6; } }
.ld .flat { position: absolute; inset: 0; display: grid; place-items: center; }
.ld .flat svg { height: 55%; color: var(--accent-d); animation: spin3d 3.2s linear infinite; }
@keyframes spin3d { to { transform: rotateY(360deg); } }
.ld h1 { font-size: 13px; letter-spacing: .5em; text-transform: uppercase; font-weight: 600; margin-top: 8px; padding-left: .5em; }
.ld .msg { color: var(--muted); font-size: 14px; height: 22px; margin-top: 8px; transition: opacity .3s; }
.bar { height: 5px; border-radius: 9px; background: var(--soft); margin: 18px auto 0; width: 70%; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--accent), var(--accent-d)); transition: width .4s ease-out; }

/* seletores */
.filters { padding: 16px; display: grid; gap: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 15px; background: var(--soft); position: relative; border: 1px solid var(--edge2); }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; height: 42px; border-radius: 12px; font-weight: 650; font-size: 15px; transition: color .25s; color: var(--muted); }
.seg button[aria-checked="true"] { color: var(--ink); }
.seg .knob { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--edge); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.seg[data-v="barbearia"] .knob { transform: translateX(100%); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--edge2); background: var(--glass-strong); padding: 0 34px 0 13px; font-size: 15px; outline: none; }
.sel select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
.sel::after { content: ""; position: absolute; right: 15px; top: 20px; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.sel small, .tg-row small.cap { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 5px 4px; }
.toggles { display: grid; gap: 4px; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; font-size: 14.5px; }
.tg input { display: none; }
.sw { width: 51px; height: 31px; border-radius: 99px; background: rgba(120, 128, 110, .35); position: relative; flex: none; transition: background .25s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.tg input:checked + .sw { background: var(--accent); }
.tg input:checked + .sw::after { transform: translateX(20px); }

/* resultados */
.sumline { display: flex; justify-content: space-between; align-items: center; padding: 18px 4px 10px; font-size: 13.5px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.card { padding: 13px 12px 12px; display: flex; flex-direction: column; gap: 7px; border-radius: 20px; position: relative; transition: transform .3s, box-shadow .3s, border-color .3s, background .3s; animation: rise .5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.card h3 { font-size: 14.5px; line-height: 1.22; font-weight: 700; letter-spacing: -.005em; overflow-wrap: anywhere; }
.chip { align-self: flex-start; font-size: 10.5px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--accent-d); font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.rate svg { width: 13px; height: 13px; color: #d19a2a; }
.addr { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.phone { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 3px; }
.act { height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--edge2); transition: transform .15s, background .2s; }
.act:active { transform: scale(.92); }
.act svg { width: 19px; height: 19px; }
.act.wa { color: #2f8f55; } :root[data-theme="dark"] .act.wa { color: #7fd6a0; }
.act.ig { color: #b3447a; } :root[data-theme="dark"] .act.ig { color: #e58fb9; }
.act.mp { color: var(--accent-d); }
.act.off { opacity: .32; pointer-events: none; }
.called { height: 36px; border-radius: 12px; border: 1px dashed var(--edge2); background: transparent; font-size: 13px; font-weight: 650; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .25s; }
.called svg { width: 16px; height: 16px; }
.card.done { border-color: var(--accent); background: linear-gradient(160deg, var(--soft), var(--glass)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 1px var(--accent), 0 16px 36px -14px var(--accent); transform: translateY(-2px); }
.card.done .called { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-style: solid; }
.card.done h3::after { content: "Chamou"; margin-left: 7px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 2px 7px; border-radius: 99px; vertical-align: 2px; }
.card.gone { animation: gone .35s forwards; }
@keyframes gone { to { opacity: 0; transform: scale(.9); } }
.more { margin-top: 18px; text-align: center; }
.more .btn { width: auto; padding: 0 28px; margin-top: 0; display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.15; height: 56px; }
.more .btn small { font-weight: 500; font-size: 11px; opacity: .85; }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }

/* radar 3D */
#radar { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(12, 18, 9, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
#radar.on { opacity: 1; visibility: visible; }
.rd { text-align: center; color: #eef0e0; }
.rd .scene { width: min(86vw, 440px); aspect-ratio: 1 / .72; perspective: 760px; margin: 0 auto; position: relative; }
.rd .plane { position: absolute; left: 50%; top: 50%; width: 84%; aspect-ratio: 1; margin: -42% 0 0 -42%; transform-style: preserve-3d; transform: rotateX(63deg) rotateZ(-18deg); animation: tilt 7s ease-in-out infinite alternate; }
@keyframes tilt { to { transform: rotateX(56deg) rotateZ(14deg); } }
.rd .disc { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(169, 191, 124, .22), rgba(169, 191, 124, .04) 70%); border: 2px solid rgba(190, 210, 150, .75); box-shadow: 0 0 40px rgba(169, 191, 124, .45), inset 0 0 40px rgba(169, 191, 124, .25); }
.rd .rg { position: absolute; border-radius: 50%; border: 1px solid rgba(190, 210, 150, .45); }
.rd .rg:nth-child(2) { inset: 17%; } .rd .rg:nth-child(3) { inset: 34%; } .rd .rg:nth-child(4) { inset: 50.5%; }
.rd .ax { position: absolute; background: rgba(190, 210, 150, .35); }
.rd .ax.h { left: 0; right: 0; top: 50%; height: 1px; } .rd .ax.v { top: 0; bottom: 0; left: 50%; width: 1px; }
.rd .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(200, 225, 150, .85), rgba(200, 225, 150, 0) 62deg, transparent 62deg); animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rd .blip { position: absolute; width: 0; height: 0; transform-style: preserve-3d; animation: blip 3s linear infinite; animation-delay: var(--d); opacity: 0; }
.rd .blip::before { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #f1f5d8; box-shadow: 0 0 14px 4px rgba(220, 240, 160, .9); }
.rd .blip::after { content: ""; position: absolute; left: -1px; top: -1px; width: 2px; height: var(--h); background: linear-gradient(#f1f5d8, transparent); transform-origin: top; transform: rotateX(-90deg); transform: rotateX(90deg) translateZ(0); transform-origin: 50% 0; }
@keyframes blip { 0% { opacity: 1; } 70% { opacity: .08; } 100% { opacity: .08; } }
.rd .pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: #f1f5d8; box-shadow: 0 0 0 0 rgba(241, 245, 216, .8); animation: pulse 1.6s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 36px rgba(241, 245, 216, 0); } }
.rd h3 { font-size: 19px; margin-top: 6px; letter-spacing: .01em; }
.rd p { font-size: 14px; opacity: .8; margin-top: 4px; }
.rd .dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* modais */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(15, 20, 10, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal .glass { background: var(--glass-strong); width: min(400px, 100%); padding: 26px 22px 20px; text-align: center; animation: pop .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal .em { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent-d); }
.modal .em svg { width: 28px; height: 28px; }
.modal h2 { font-size: 20px; } .modal p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.modal ol { text-align: left; color: var(--muted); font-size: 14.5px; padding-left: 20px; margin: 12px 0 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); z-index: 120; padding: 12px 18px; border-radius: 99px; background: var(--glass-strong); border: 1px solid var(--edge); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); font-size: 14px; opacity: 0; transition: .35s; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* termos */
.terms { width: min(640px, 100%); padding: 22px 18px 18px; }
.terms .scroll { height: min(52dvh, 460px); overflow-y: auto; margin: 14px 0 10px; padding: 14px 14px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--edge2); font-size: 14px; scrollbar-width: thin; }
.terms .scroll h3 { font-size: 14.5px; margin: 14px 0 5px; } .terms .scroll h3:first-child { margin-top: 0; }
.terms .scroll p { color: var(--muted); margin-bottom: 7px; }
.hint { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hint.ok { color: var(--ok); }
.hint svg { width: 16px; height: 16px; flex: none; }
.chk { display: flex; gap: 11px; align-items: flex-start; margin-top: 12px; font-size: 14.5px; opacity: .45; transition: opacity .3s; }
.chk.on { opacity: 1; }
.chk input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 1px 0 0; }

/* espera */
.wait .orb { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 50%; position: relative; display: grid; place-items: center; color: var(--accent-d); }
.wait .orb::before, .wait .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ripple 2.4s ease-out infinite; }
.wait .orb::after { animation-delay: 1.2s; }
@keyframes ripple { from { transform: scale(.45); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.wait .orb svg { width: 38px; height: 38px; }
.wait { text-align: center; }
.wait .kv { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* troca de tema */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; } ::view-transition-new(root) { z-index: 2; }
.theme-fade, .theme-fade * { transition: background-color .6s, color .6s, border-color .6s !important; }
@media (max-width: 470px) { .brand div { display: none; } .top { gap: 8px; padding-left: 12px; padding-right: 12px; } .brand svg { height: 32px; } .usage { padding: 0 10px 0 7px; } }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } .row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
