/* HS SHIELD Web — mesma paleta, tipografia e animações do app Android (GhostColors / GhostType). */
:root {
  --bg: #080808;
  --bg2: #101010;
  --fg: #ffffff;
  --muted: #a1a1aa;
  --text-muted: #71717a;
  --card: #171717;
  --border: #292929;
  --border-strong: #3a3a3a;
  --metallic: #d4d4d8;
  --fast-out-slow-in: cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* Proteção ativa: tela principal fica branca (LightPalette do Android) */
body.on {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #52525b;
  --card: #f4f4f5;
  --border: #e4e4e7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  transition: background-color .7s var(--fast-out-slow-in), color .7s var(--fast-out-slow-in);
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; }
.screen {
  position: absolute; inset: 0;
  padding: calc(var(--safe-top) + 14px) 20px calc(var(--safe-bottom) + 12px);
  display: flex; flex-direction: column;
}
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wrap { width: 100%; max-width: 480px; margin: 0 auto; }
.center-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Entrada escalonada (staggeredEntrance: fade + 18dp, 520 ms, +70 ms por item) */
.stagger { opacity: 0; transform: translateY(18px); }
.show .stagger { animation: stagger .52s var(--fast-out-slow-in) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes stagger { to { opacity: 1; transform: none; } }

/* Tipografia (GhostType) */
.brand { font-size: 20px; line-height: 24px; font-weight: 900; letter-spacing: 3px; }
.brand-xl { font-size: 20px; line-height: 24px; font-weight: 900; letter-spacing: 4px; margin-top: 18px; }
.eyebrow { font-size: 10px; line-height: 12px; font-weight: 500; letter-spacing: 3.5px; color: var(--muted); transition: color .7s var(--fast-out-slow-in); }
.title { font-size: 22px; line-height: 28px; font-weight: 700; margin: 18px 0 8px; }
.muted { color: var(--muted); font-size: 15px; line-height: 22px; margin: 0 0 18px; }
.small { font-size: 13px; line-height: 19px; }
.hint { color: var(--text-muted); font-size: 13px; line-height: 19px; margin-top: 18px; }
.label { display: block; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 2px; color: var(--muted); margin-bottom: 10px; }
.label-strong { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 2px; color: #fff; }
.body-sm { font-size: 13px; line-height: 19px; color: #a1a1aa; margin-top: 3px; }

/* ---------- Splash ---------- */
#splash { padding: 0; align-items: center; justify-content: center; background: #080808; z-index: 5; }
.splash-logo { position: absolute; left: 50%; top: 50%; width: 104px; height: 120px; margin: -60px 0 0 -52px; opacity: 0; filter: drop-shadow(0 0 26px rgba(255,255,255,.28)); }
.splash-text { position: absolute; left: 0; right: 0; top: calc(50% + 205px - 40px); display: flex; flex-direction: column; align-items: center; }
.splash-name { font-size: 34px; line-height: 38px; font-weight: 900; color: #fff; opacity: 0; white-space: nowrap; }
.splash-tag { margin-top: 10px; font-size: 11px; font-weight: 500; letter-spacing: 6px; color: #a1a1aa; opacity: 0; }
.splash-line { margin-top: 18px; height: 1px; width: 0; background: linear-gradient(90deg, transparent, #d4d4d8, transparent); }

/* ---------- Transição pós-login ---------- */
#entering { padding: 0; background: #080808; align-items: center; justify-content: center; }
.enter-name { position: absolute; left: 0; right: 0; top: calc(50% + 132px - 12px); text-align: center; font-size: 20px; font-weight: 900; letter-spacing: 3px; color: #fff; opacity: 0; }

/* ---------- Login / instalação ---------- */
#login, #install { background: #080808; color: #fff; }
.login-col { display: flex; flex-direction: column; align-items: center; padding: 34px 4px 32px; }
.logo-sm { width: 64px; }
.logo-md { width: 76px; filter: drop-shadow(0 0 20px rgba(255,255,255,.22)); }
.flanked { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 10px; font-weight: 500; letter-spacing: 3.5px; color: #a1a1aa; }
.flanked span { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, #3a3a3a); }
.flanked span:last-child { transform: scaleX(-1); }
.steps { list-style: none; padding: 0; margin: 6px 0 0; width: 100%; text-align: left; }
.steps li { display: flex; gap: 14px; align-items: center; background: #101010; border: 1px solid #292929; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; font-size: 15px; line-height: 1.4; }
.steps li > b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #080808; display: grid; place-items: center; font-size: 13px; }
.ico-inline { width: 18px; height: 18px; vertical-align: -3px; }

.card { width: 100%; background: #101010; border: 1px solid #292929; border-radius: 22px; }
.form {
  margin-top: 44px; padding: 26px 22px; text-align: left; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #141414, #101010);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.form-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.form-sub { margin: 8px 0 26px; font-size: 15px; line-height: 22px; color: #a1a1aa; }
.field {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-radius: 14px;
  background: #0b0b0b; border: 1px solid #292929; color: #71717a; transition: border-color .2s, box-shadow .2s, color .2s;
}
.field svg { width: 20px; height: 20px; flex: none; }
.field:focus-within { border-color: #fff; color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.field.err { border-color: #f4f4f5; animation: shake .42s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: #fff; font-size: 16px; }
.field input::placeholder { color: #52525b; }
.check { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 14px; color: #a1a1aa; cursor: pointer; }
.check input { display: none; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1px solid #3a3a3a; display: grid; place-items: center; transition: .2s; }
.check input:checked + .box { background: #fff; border-color: #fff; }
.check input:checked + .box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid #080808; border-bottom: 2px solid #080808; transform: rotate(-45deg) translate(1px, -1px); }
.error { margin-top: 10px; display: flex; gap: 8px; font-size: 13px; line-height: 19px; color: #f4f4f5; animation: fadeUp .25s ease; }
.error::before { content: "!"; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 1.4px solid currentColor; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(-4px); } }

.btn {
  width: 100%; height: 56px; border-radius: 16px; margin-top: 22px;
  font-size: 14px; font-weight: 700; letter-spacing: 1.8px;
  display: grid; place-items: center; transition: transform .35s var(--spring), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: #fff; color: #080808; box-shadow: 0 10px 30px rgba(255,255,255,.08); }
.btn.ghost { border: 1px solid var(--border-strong); color: inherit; }
.btn[disabled] { opacity: .7; }
.btn .loading { display: inline-flex; align-items: center; gap: 10px; }
.btn .loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(8,8,8,.25); border-top-color: #080808; animation: spin .8s linear infinite; }

/* ---------- Principal ---------- */
#main { background: var(--bg); transition: background-color .7s var(--fast-out-slow-in); }
.topbar { display: flex; align-items: center; gap: 12px; margin-top: 0; }
.top-logo { width: 40px; height: 46px; transition: filter .7s var(--fast-out-slow-in); }
body.on .top-logo { filter: invert(1) hue-rotate(180deg); }
.top-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border);
  transition: background-color .7s var(--fast-out-slow-in), border-color .7s var(--fast-out-slow-in), transform .35s var(--spring);
}
.round-btn:active { transform: scale(.97); }
.round-btn svg { width: 20px; height: 20px; }

.appcard {
  margin-top: 22px; width: 100%; max-width: 480px; align-self: center;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border); text-align: left;
  transition: background-color .7s var(--fast-out-slow-in), border-color .7s var(--fast-out-slow-in), transform .35s var(--spring);
}
.appcard:active:not([disabled]) { transform: scale(.98); }
.appcard[disabled] { cursor: default; }
.appcard img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; flex: none; }
.appcard-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-name { font-size: 17px; line-height: 22px; font-weight: 700; letter-spacing: .6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-action { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 500; letter-spacing: 3.5px; }
.app-action svg { width: 14px; height: 14px; }
.app-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fg); display: none; }
body.on .app-action { display: none; }
body.on .app-dot { display: block; }
.fade-swap { animation: swap .3s ease; }
@keyframes swap { from { opacity: 0; } }

.stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.shield {
  position: relative; width: var(--size, 300px); height: var(--size, 300px); border-radius: 50%;
  display: grid; place-items: center; outline: none;
  transition: transform .35s var(--spring);
  perspective: 600px;
}
.shield.pressed { transform: scale(.97); }
.shield canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.disc {
  position: relative; width: 52%; height: 52%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  transition: background-color .7s var(--fast-out-slow-in), color .7s var(--fast-out-slow-in), border-color .7s var(--fast-out-slow-in);
  overflow: hidden; will-change: transform;
}
.disc::before { /* brilho no topo */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 22%, rgba(255,255,255,var(--shine, .08)), transparent 62%);
}
.disc::after { /* sombra na base (esfera) */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.35));
}
body.on .disc { background: #000; color: #fff; border-color: #000; --shine: .16; }
.disc > * { position: relative; z-index: 1; }
.disc-icon { width: 34px; height: 34px; }
.disc-label { margin-top: 10px; font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 2px; }
.disc-state { margin-top: 4px; font-size: 19px; line-height: 22px; font-weight: 700; letter-spacing: 2px; }
#icon-check { display: none; }
body.on #icon-check { display: inline; }
body.on #icon-alert, body.on #icon-dot { display: none; }

.timer-area { height: 110px; display: flex; justify-content: center; align-items: flex-start; }
.timer { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
body.on .timer { opacity: 1; transform: none; transition: opacity .4s ease, transform .4s ease; }
.timer-value { font-size: 34px; line-height: 38px; font-weight: 900; letter-spacing: 2px; font-variant-numeric: tabular-nums; }

/* ---------- Popup de ativação ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(0,0,0,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .22s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 460px; background: #171717; color: #fff; border: 1px solid #3a3a3a;
  border-radius: 24px; padding: 20px; animation: pop .32s var(--fast-out-slow-in);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-badge { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; flex: none; }
.modal-badge svg { width: 22px; height: 22px; }
.modal-titles { flex: 1; min-width: 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #3a3a3a; border-top-color: #fff; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.rows { background: #101010; border: 1px solid #292929; border-radius: 14px; padding: 6px 14px; }
.rows div { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #292929; }
.rows div:last-child { border-bottom: 0; }
.rows span { flex: 1; font-size: 10px; font-weight: 500; letter-spacing: 1.5px; color: #71717a; }
.rows b { font-size: 13px; font-weight: 400; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.log-title { margin: 14px 0 8px; color: #71717a; }
.log {
  height: 170px; overflow: hidden; border-radius: 12px; background: #000; border: 1px solid #292929;
  padding: 8px 10px; font: 10.5px/14px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #a1a1aa;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.log div { white-space: nowrap; overflow: hidden; }
.log div:last-child { color: #fff; font-weight: 700; }
.progress { margin-top: 14px; height: 3px; border-radius: 3px; background: #292929; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; }

/* ---------- Folhas ---------- */
.sheet-overlay { align-items: end; padding: 0; }
.sheet {
  width: 100%; max-width: 520px; margin: 0 auto; background: #101010; color: #fff;
  border: 1px solid #292929; border-bottom: 0; border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(var(--safe-bottom) + 22px);
  animation: up .35s var(--fast-out-slow-in); max-height: 90vh; overflow-y: auto;
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .muted { color: #a1a1aa; }
.grabber { width: 40px; height: 5px; border-radius: 5px; background: #3a3a3a; margin: 0 auto 16px; }
.sheet-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.sheet .card { background: #171717; margin-top: 14px; }
.list { padding: 2px 16px; }
.row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; font-size: 14.5px; border-bottom: 1px solid #292929; text-align: left; }
.row:last-child { border-bottom: 0; }
.row span { color: #a1a1aa; }
.row b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
.plus { font-size: 20px; transition: transform .25s; }
.plus.open { transform: rotate(45deg); }
.about { margin: -4px 0 12px; font-size: 13.5px; line-height: 1.55; color: #a1a1aa; }
.pick-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pick { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; border: 1px solid #292929; background: #171717; text-align: left; transition: transform .35s var(--spring), border-color .2s; }
.pick:active { transform: scale(.98); }
.pick img { width: 48px; height: 48px; border-radius: 12px; }
.pick .name { flex: 1; font-weight: 700; font-size: 16px; }
.pick .radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #3a3a3a; display: grid; place-items: center; }
.pick.sel { border-color: #fff; }
.pick.sel .radio { border-color: #fff; }
.pick.sel .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 28px); transform: translateX(-50%);
  z-index: 40; max-width: calc(100% - 40px); padding: 13px 18px; border-radius: 14px;
  background: #171717; color: #fff; border: 1px solid #3a3a3a; font-size: 14px; font-weight: 600; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); animation: toast .3s var(--fast-out-slow-in);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
