/* ============================================================
   ArrowPB — Design System
   Preto + Laranja. Dark, clean, moderno.
   Sem estilos inline (CSP): tudo por classe.
   ============================================================ */

:root {
  /* superfícies */
  --bg:        #070707;
  --bg-soft:   #0A0A0B;
  --surface:   #101012;
  --surface-2: #16161A;
  --surface-3: #1C1C21;

  /* linhas */
  --line:      #24242A;
  --line-soft: #1A1A1F;
  --line-hi:   rgba(255, 255, 255, .06);

  /* texto */
  --txt:       #F5F4F2;
  --txt-dim:   #ABA49C;
  --muted:     #8B847B;   /* 5.1:1 sobre --surface: passa AA para texto pequeno */

  /* marca */
  --org:       #FF6A00;
  --org-2:     #FF8C1A;
  --org-3:     #FFB066;
  --org-soft:  #FFD9A0;
  --glow:      rgba(255, 106, 0, .40);
  --glow-soft: rgba(255, 106, 0, .12);

  /* semânticas */
  --ok:        #4ADE80;
  --ok-bg:     #12291C;
  --ok-line:   #235C39;
  --warn:      #FFC93F;
  --warn-bg:   #2E2610;
  --warn-line: #6A5514;
  --bad:       #FF7A7A;
  --bad-bg:    #341616;
  --bad-line:  #6B2525;

  /* geometria */
  --r-sm: 9px;
  --r:    13px;
  --r-lg: 18px;
  --ring: 0 0 0 3px rgba(255, 106, 0, .18);
  --shadow: 0 18px 44px rgba(0, 0, 0, .55);

  /* movimento */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --fast: .14s var(--ease);
  --mid:  .24s var(--ease);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Segoe UI', Bahnschrift, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(820px 380px at 50% -12%, var(--glow-soft), transparent 62%),
    radial-gradient(620px 340px at 88% 108%, rgba(255, 80, 0, .06), transparent 60%);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* seleção e foco consistentes */
::selection { background: var(--org); color: #170A00; }
:focus-visible { outline: 2px solid var(--org-2); outline-offset: 2px; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #2B2B31; border-radius: 6px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--org); }

/* link "pular para conteúdo" (a11y) */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--org); color: #170A00; font-weight: 800;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- layout ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 34px 20px 80px; }
.wrap-wide { max-width: 1240px; }

/* ---------- topbar / marca ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 26px;
  animation: fadeUp .5s var(--ease) both;
}
.mark {
  width: 50px; height: 50px; flex: 0 0 50px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2A1500, var(--org));
  box-shadow: 0 8px 26px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform var(--mid);
}
.mark svg { width: 26px; height: 26px; }
.topbar:hover .mark { transform: translateY(-2px) rotate(-6deg); }

.wordmark { font-size: 27px; font-weight: 800; letter-spacing: 0; line-height: 1.05; }
.wordmark em { font-style: normal; color: var(--org); }
.tagline { color: var(--muted); font-size: 12.5px; margin-top: 3px; letter-spacing: .2px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* badge do admin no topbar */
.chip {
  font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--org-3); background: rgba(255, 106, 0, .10);
  border: 1px solid rgba(255, 106, 0, .28);
  padding: 5px 11px; border-radius: 99px;
}

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  animation: fadeUp .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: border-color var(--mid);
}
/* realce sutil no topo da borda */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, var(--line-hi), transparent);
}
.card-narrow { max-width: 440px; margin-inline: auto; }

.card h2 {
  font-size: 15px; font-weight: 700; color: var(--org-2);
  letter-spacing: .3px; margin-bottom: 4px;
}
.card h2 + .hint { margin-bottom: 18px; }
.hint { color: var(--muted); font-size: 12.5px; }

.section { margin-top: 22px; }

/* cabeçalho de seção com divisória */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}

/* ---------- abas (segmented control) ---------- */
.tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px; margin-bottom: 22px;
}
.tabs button {
  position: relative; z-index: 1;
  background: none; border: 0; box-shadow: none;
  color: var(--muted); font-weight: 700; font-size: 13.5px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; transition: color var(--mid);
}
.tabs button:hover { color: var(--txt-dim); transform: none; box-shadow: none; }
.tabs button[aria-selected="true"] { color: #170A00; }
/* indicador deslizante */
.tabs-thumb {
  position: absolute; z-index: 0; top: 4px; left: 4px; bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: linear-gradient(180deg, #E05A00, var(--org-2));
  box-shadow: 0 4px 14px var(--glow);
  transition: transform var(--mid);
}
.tabs-thumb.right { transform: translateX(100%); }

/* ---------- formulário ---------- */
.field { margin-bottom: 14px; animation: fadeUp .4s var(--ease) both; }
.field label {
  display: block; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted); margin-bottom: 7px;
}

input, select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
input:hover, select:hover { border-color: #2E2E35; }
input:focus, select:focus {
  border-color: var(--org);
  box-shadow: var(--ring);
  background: #0E0906;
}
input::placeholder { color: #6B655D; }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 40px #0E0906 inset;
}
input[type="number"] { -moz-appearance: textfield; }

/* ---------- botões ---------- */
button, .btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #E05A00, var(--org-2));
  color: #170A00;
  font-family: inherit; font-weight: 800; font-size: 14px;
  letter-spacing: .2px;
  border: 0; border-radius: var(--r-sm);
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 106, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform var(--fast), box-shadow var(--mid), filter var(--fast);
}
/* brilho que atravessa no hover */
button::after, .btn::after {
  content: ""; position: absolute; top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: skewX(-18deg);
  transition: left .5s var(--ease);
}
button:hover:not(:disabled), .btn:hover { transform: translateY(-2px); box-shadow: 0 11px 28px rgba(255, 106, 0, .38); }
button:hover:not(:disabled)::after { left: 130%; }
button:active:not(:disabled), .btn:active { transform: translateY(0) scale(.985); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* variantes */
.btn-block { width: 100%; }
.btn-lg { font-size: 15.5px; padding: 15px 26px; border-radius: var(--r); }
.btn-sm { font-size: 12.5px; padding: 7px 12px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }

.btn-ghost, button.ghost {
  background: var(--surface-3); color: var(--org-3);
  border: 1px solid rgba(255, 106, 0, .24);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled), button.ghost:hover:not(:disabled) {
  border-color: var(--org); color: var(--org-2); background: #201A14;
}
.btn-quiet, button.quiet {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); box-shadow: none;
}
.btn-quiet:hover:not(:disabled) { color: var(--txt-dim); border-color: #33333A; background: var(--surface-3); }

.btn-danger, button.danger {
  background: linear-gradient(180deg, #8A2000, #C03000); color: #FFF; box-shadow: 0 5px 14px rgba(160, 40, 0, .3);
}
.btn-danger:hover:not(:disabled), button.danger:hover:not(:disabled) { box-shadow: 0 9px 22px rgba(190, 50, 0, .45); }

/* spinner dentro do botão */
.spinner {
  width: 14px; height: 14px; flex: 0 0 14px;
  border: 2px solid rgba(0, 0, 0, .25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-loading { pointer-events: none; }

/* ---------- linhas / utilidades ---------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.row > .grow { flex: 1 1 180px; }
.row > .shrink { flex: 0 0 auto; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.center { text-align: center; }
.mono { font-family: Consolas, 'Cascadia Mono', ui-monospace, monospace; }
.hide { display: none !important; }
.stack-sm > * + * { margin-top: 12px; }

/* ---------- mensagens ---------- */
.msg {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; min-height: 20px; margin-top: 12px;
  color: var(--muted);
  transition: color var(--mid);
}
.msg:empty { display: none; }
.msg.err { color: var(--bad); }
.msg.okc { color: var(--ok); }
.msg::before { font-size: 14px; }
.msg.err::before { content: "⚠"; }
.msg.okc::before { content: "✓"; }

/* ---------- pill de status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok   { background: var(--ok-bg);   color: var(--ok);   border: 1px solid var(--ok-line); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.pill-bad  { background: var(--bad-bg);  color: var(--bad);  border: 1px solid var(--bad-line); }
.pill-mute { background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); }
/* "online" pulsa */
.pill-live::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); animation: pulse 1.8s var(--ease) infinite;
}

/* ---------- key do usuário ---------- */
.key-box {
  position: relative; overflow: hidden;
  background: #0A0705;
  border: 1px dashed rgba(255, 106, 0, .5);
  border-radius: var(--r);
  padding: 22px 16px;
  text-align: center;
  font-family: Consolas, 'Cascadia Mono', ui-monospace, monospace;
  font-size: clamp(16px, 4.4vw, 23px);
  font-weight: 700; letter-spacing: 2.6px;
  color: var(--org-soft);
  text-shadow: 0 0 16px rgba(255, 140, 0, .32);
  word-break: break-all;
  transition: border-color var(--mid), background var(--mid);
}
/* brilho que varre a key */
.key-box::after {
  content: ""; position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 170, 60, .13), transparent);
  animation: shimmer 3.6s var(--ease) infinite;
}
/* estado copiado */
.key-box.copied {
  border-style: solid; border-color: var(--ok);
  color: var(--ok); background: #08130C; text-shadow: none;
}
.key-box.copied::after { animation: none; opacity: 0; }

/* barra de validade */
.validity { margin-top: 16px; }
.validity-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.bar { height: 6px; background: #24201C; border-radius: 99px; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #B33F00, var(--org-2));
  width: 0;
  transition: width .9s var(--ease);
}
.bar.is-low > i { background: linear-gradient(90deg, #A03400, var(--bad)); }

/* ---------- área de download ---------- */
.download {
  display: flex; align-items: center; gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 106, 0, .22);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 106, 0, .07), transparent);
  transition: border-color var(--mid);
}
.download:hover { border-color: rgba(255, 106, 0, .42); }
.download-info { flex: 1 1 auto; min-width: 0; }
.download-info b { display: block; font-size: 14.5px; }
.download-info span { color: var(--muted); font-size: 12.5px; }
.download .btn { flex: 0 0 auto; }
.download.is-blocked { border-color: var(--line); background: none; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 14px; text-align: center;
  animation: fadeUp .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
  transition: transform var(--mid), border-color var(--mid);
}
.stat:hover { transform: translateY(-3px); border-color: #2F2F36; }
.stat b {
  display: block; font-size: 30px; font-weight: 800; line-height: 1.1;
  color: var(--org-2); text-shadow: 0 0 18px var(--glow);
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; margin-top: 5px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
}

/* ---------- tabelas ---------- */
.table-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-soft); }
th {
  color: var(--org-2); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .9px;
  white-space: nowrap; border-bottom-color: var(--line);
}
tbody tr { transition: background var(--fast); animation: fadeIn .35s var(--ease) both; }
tbody tr:hover { background: #16130F; }
tbody tr:last-child td { border-bottom: 0; }
td.key-cell { font-family: Consolas, ui-monospace, monospace; color: var(--org-soft); font-weight: 700; }
td.actions { white-space: nowrap; text-align: right; }
td.actions > * + * { margin-left: 5px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13px; }

/* ---------- gráfico de uso ---------- */
.usage-row { margin-bottom: 11px; animation: fadeIn .35s var(--ease) both; }
.usage-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.usage-top b { color: var(--org-2); font-variant-numeric: tabular-nums; }
.bar-day { height: 6px; background: #24201C; border-radius: 99px; overflow: hidden; }
.bar-day > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #B33F00, var(--org-2));
  width: 0; transition: width .8s var(--ease);
}

/* ---------- logs (auditoria) ---------- */
.log-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-soft);
  animation: fadeIn .3s var(--ease) both;
  transition: background var(--fast);
}
.log-line:hover { background: #16130F; }
.log-line:last-child { border-bottom: 0; }
.log-when { color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.log-ev {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
}
.log-key { font-family: Consolas, ui-monospace, monospace; color: var(--txt-dim); }
.log-ip { color: var(--muted); margin-left: auto; flex: 0 0 auto; }
.ev-ok       { background: var(--ok-bg);   color: var(--ok); }
.ev-bad      { background: var(--bad-bg);  color: var(--bad); }
.ev-warn     { background: var(--warn-bg); color: var(--warn); }
.ev-mute     { background: var(--surface-3); color: var(--muted); }

/* ---------- busca ---------- */
.search { position: relative; max-width: 340px; }
.search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.search input { padding-left: 36px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 26px;
  display: flex; align-items: center; gap: 9px;
  transform: translate(-50%, 22px);
  background: linear-gradient(180deg, #1E150A, #140E06);
  border: 1px solid var(--org);
  color: var(--org-soft);
  padding: 12px 22px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 700;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .65), 0 0 22px var(--glow);
  opacity: 0; pointer-events: none;
  transition: opacity var(--mid), transform var(--mid);
  z-index: 99;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- skeleton (carregando) ---------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-3); border-radius: var(--r-sm);
  height: 14px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
  animation: sweep 1.4s var(--ease) infinite;
}
.skeleton[data-gap] { margin-top: 10px; }
.skeleton-lg { height: 44px; border-radius: var(--r); }

/* ---------- rótulo só para leitor de tela ---------- */
.sr-label {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- <details> (segurança da conta) ---------- */
details { border-radius: var(--r); }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; list-style: none;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-soft);
  font-size: 14px; font-weight: 700; color: var(--txt-dim);
  transition: border-color var(--mid), color var(--mid), background var(--mid);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "▾"; color: var(--org-2); font-size: 15px;
  transition: transform var(--mid);
}
summary:hover { border-color: #33333A; color: var(--txt); background: var(--surface-3); }
details[open] > summary {
  border-color: rgba(255, 106, 0, .35);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  color: var(--txt);
}
details[open] > summary::after { transform: rotate(180deg); }
details > form { padding: 4px 2px 0; }
summary > .hint { margin-left: auto; }

/* ---------- modo "só login" (marca centralizada) ----------
   Na tela deslogada o card fica centralizado; sem centralizar a marca
   também, topbar e card ficavam em eixos diferentes.
   O .topbar-right precisa sair do flex: ele tem margin-left:auto e,
   mesmo vazio, engolia o espaço livre e anulava a centralização. */
.wrap.auth-mode .topbar { justify-content: center; }
.wrap.auth-mode .topbar-right { display: none; }

/* linha de campos que não deve esticar (criar keys) */
.row-tight > .grow { flex: 0 1 170px; }

/* âncora que envolve botão não deve parecer link */
.download a, a:has(> button) { text-decoration: none; display: inline-block; }
.download a:hover { text-decoration: none; }

/* nas abas não entra o brilho do botão padrão */
.tabs button::after { display: none; }

a { color: var(--org-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- escalonamento das entradas ----------
   A CSP proíbe o atributo style="", então o atraso de cada item
   vem daqui, via a variável --i lida pelas keyframes. */
.stats > .stat:nth-child(1) { --i: 0; }
.stats > .stat:nth-child(2) { --i: 1; }
.stats > .stat:nth-child(3) { --i: 2; }
.stats > .stat:nth-child(4) { --i: 3; }

#painel > *:nth-child(1),
#userCard > *:nth-child(1) { --i: 0; }
#painel > *:nth-child(2),
#userCard > *:nth-child(2) { --i: 1; }
#painel > *:nth-child(3),
#userCard > *:nth-child(3) { --i: 2; }
#painel > *:nth-child(4),
#userCard > *:nth-child(4) { --i: 3; }
#painel > *:nth-child(5),
#userCard > *:nth-child(5) { --i: 4; }
#painel > *:nth-child(6),
#userCard > *:nth-child(6) { --i: 5; }
#painel > *:nth-child(7),
#userCard > *:nth-child(7) { --i: 6; }

/* o bloco de keys recém-criadas precisa respirar */
.notice .mono {
  font-size: 13px; line-height: 1.7; color: var(--org-soft);
  white-space: pre-wrap; word-break: break-all;
}



/* ---------- aviso ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r);
  background: rgba(255, 106, 0, .07);
  border: 1px solid rgba(255, 106, 0, .24);
  font-size: 13px; color: var(--txt-dim); line-height: 1.6;
}
.notice svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--org-2); margin-top: 1px; }
.notice b { color: var(--org-3); }

/* ---------- animações ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { left: -60%; } 55%, 100% { left: 120%; } }
@keyframes sweep  { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pulse  { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, .5); }
                    70% { opacity: .75; box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); } }
@keyframes glow   { 0%, 100% { box-shadow: 0 8px 26px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }
                    50%      { box-shadow: 0 8px 38px rgba(255, 120, 0, .62), inset 0 1px 0 rgba(255,255,255,.3); } }
.mark { animation: glow 3.4s var(--ease) infinite; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 24px 16px 64px; }
  .card { padding: 20px; border-radius: var(--r); }
  .wordmark { font-size: 23px; }
  .topbar { gap: 11px; }
  .mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
  .mark svg { width: 23px; height: 23px; }
  .btn-lg { width: 100%; }
  .download { flex-direction: column; align-items: stretch; text-align: center; }
  .download .btn { width: 100%; }
  .log-ip { display: none; }

  /* campos secundários da tabela somem no celular: a lista de keys
     ficava com ~9 linhas por card */
  table.responsive td.col-opt { display: none; }

  /* tabela vira lista de cards */
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr {
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 10px 12px; margin-bottom: 10px;
    background: var(--surface);
  }
  table.responsive tr:hover { background: var(--surface-2); }
  table.responsive td {
    border: 0; padding: 5px 0;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
  }
  table.responsive td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .7px;
    flex: 0 0 auto;
  }
  table.responsive td.actions { justify-content: flex-end; padding-top: 10px; }
  table.responsive td.actions::before { display: none; }
}

/* ---------- acessibilidade: menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* telas estreitas: campo e botão empilham em vez de espremer o input */
@media (max-width: 520px) {
  .row-stack { flex-direction: column; }
  .row-stack > * { flex: 1 1 auto; width: 100%; }
  .row-tight > .grow { flex: 1 1 auto; }
}
