/* IceAPIs v2 — Tema preto profundo + azul elétrico */
:root {
  --bg: #000000;
  --bg-2: #030508;
  --panel: #06090f;
  --panel-2: #0a0f1a;
  --panel-hi: #0f1626;
  --border: #141b2a;
  --border-hi: #1e2a44;
  --border-glow: #1d4ed8;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-faint: #475569;
  --accent: #3b82f6;
  --accent-hi: #60a5fa;
  --accent-dim: #1e40af;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
  background: #000000;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ============ LUPA ESCANEANDO (só na home) ============ */
.scan-lupa {
  position: fixed;
  top: 40%;
  left: -100px;
  width: 80px;
  height: 80px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: scanLupaMove 18s linear infinite;
}
@keyframes scanLupaMove {
  0%   { transform: translate(0, 0) rotate(-10deg); }
  25%  { transform: translate(30vw, -30px) rotate(5deg); }
  50%  { transform: translate(55vw, 20px) rotate(-5deg); }
  75%  { transform: translate(80vw, -20px) rotate(10deg); }
  100% { transform: translate(110vw, 0) rotate(-10deg); }
}

/* Conteúdo acima da lupa */
.topbar, main, .login-wrap, .footer { position: relative; z-index: 1; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============ TOPBAR ============ */
.topbar {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 28px rgba(59, 130, 246, 0.6);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.brand-name span { color: var(--accent-hi); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 9px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.nav a:hover { color: var(--text); background: var(--panel-hi); }
.nav a.active {
  color: var(--accent-hi);
  background: var(--panel-hi);
  box-shadow: inset 0 0 0 1px var(--border-hi);
}

/* ============ USER MENU ============ */
.user-menu { position: relative; margin-left: 10px; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.user-btn:hover { border-color: var(--border-hi); background: var(--panel-hi); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--panel-hi);
  object-fit: cover;
  display: block;
}
.user-name { font-weight: 500; }
.owner-badge {
  display: inline-block;
  padding: 1px 7px;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s;
  z-index: 100;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.1s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--panel-hi); color: var(--text); }
.dropdown-item.danger:hover { color: var(--bad); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

.dropdown-info {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-info .label { font-size: 10px; letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase; }
.dropdown-info .value { font-size: 13px; color: var(--text); margin-top: 2px; }

/* ============ HERO ============ */
.hero { padding: 48px 0 32px; text-align: center; }

.hero-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 24px;
}
.hero-logo-img {
  width: 260px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.login-echo-img {
  width: 180px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.4));
}

/* Botão sair visível no topbar */
.btn-logout-top {
  margin-left: 8px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-logout-top:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.hero h1 {
  font-size: clamp(32px, 5.5vw, 54px);
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============ PANELS ============ */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.panel:hover { border-color: var(--border-hi); }
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.6;
}
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.05), transparent 70%);
  pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }

.panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hi);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.panel-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--panel-hi); color: var(--text); border-color: var(--border-hi); box-shadow: none; }

.btn-discord {
  background: linear-gradient(180deg, #5865f2 0%, #4752c4 100%);
  border-color: #5865f2;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-discord:hover { box-shadow: 0 8px 32px rgba(88, 101, 242, 0.6), inset 0 1px 0 rgba(255,255,255,0.2); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.btn-icon {
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  box-shadow: none;
  font-family: inherit;
}
.btn-icon:hover { background: var(--panel-hi); color: var(--accent-hi); border-color: var(--border-hi); }

/* ============ INPUTS ============ */
.input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  transition: all 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.1);
}
.input::placeholder { color: var(--text-faint); }

.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

/* ============ PIN DISPLAY ============ */
.pin-box {
  background:
    radial-gradient(ellipse at center top, rgba(59, 130, 246, 0.15), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.pin-box::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.pin-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  font-weight: 600;
}

.pin-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-hi);
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.6), 0 0 40px rgba(59, 130, 246, 0.3);
  margin: 4px 0;
  user-select: all;
}

.pin-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pin-link-row .link-text {
  flex: 1;
  color: var(--accent-hi);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  word-break: break-all;
  text-align: left;
}
.pin-link-row .link-text:hover { color: var(--text); }

.limit-info {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--panel-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.limit-info strong { color: var(--accent-hi); }

/* ============ BADGES / STATUS ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge.good { background: rgba(16, 185, 129, 0.12); color: var(--good); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.warn { background: rgba(245, 158, 11, 0.12); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.bad { background: rgba(239, 68, 68, 0.12); color: var(--bad); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge.dim { background: var(--panel-hi); color: var(--text-dim); border: 1px solid var(--border); }
.badge.accent { background: rgba(59, 130, 246, 0.12); color: var(--accent-hi); border: 1px solid rgba(59, 130, 246, 0.3); }

.status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
}
.status-dot.good { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status-dot.dim { background: var(--text-faint); }
.status-dot.accent { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }

/* ============ LIST / TABLE ============ */
.list { list-style: none; }
.list li {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.list li:first-child { border-top: none; }
.list li .main { flex: 1; min-width: 0; }
.list li .name {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.list li .name:hover { color: var(--accent-hi); }
.list li .meta { color: var(--text-faint); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

.list-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--panel-hi);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
}
.list-user img { width: 18px; height: 18px; border-radius: 50%; }

/* ============ LOADING ============ */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading { text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 14px; }

/* ============ ALERTS ============ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
  line-height: 1.5;
}
.alert-error { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.alert-warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }

/* ============ SCAN RESULT ============ */
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.result-head h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.result-head .meta { color: var(--text-faint); font-family: 'JetBrains Mono', monospace; font-size: 11px; }

.section { margin-top: 28px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.section-title .count {
  background: var(--panel-hi);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.detection {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.detection:hover { border-color: var(--border-hi); }

.detection-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.detection-name { font-weight: 600; font-size: 14px; color: var(--text); }

.indication {
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border);
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}
.indication.sev-warning { border-left-color: var(--warn); }
.indication.sev-critical, .indication.sev-cheat, .indication.sev-detection { border-left-color: var(--bad); }
.indication.sev-info { border-left-color: var(--accent); }

.note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 0;
}

.empty { text-align: center; padding: 32px 20px; color: var(--text-faint); font-size: 14px; }

/* ============ LOGIN PAGE ============ */
.login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #000000;
}
.login-card {
  background: #06090f;
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  padding: 48px 36px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
/* .login-logo (removido - substituído por .login-echo-img) */
.login-card h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }

/* ============ BACK BUTTON ============ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  transition: all 0.15s;
}
.back-link:hover { background: var(--panel-hi); color: var(--text); }

/* ============ FOOTER ============ */
.footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}

/* ============ UTIL ============ */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel, .hero, .login-card { animation: fadeIn 0.5s ease-out; }

.copy-feedback {
  display: inline-block;
  padding: 2px 6px;
  background: var(--good);
  color: #000;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  animation: fadeIn 0.2s;
}

/* ============ MOBILE ============ */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav a { padding: 7px 10px; font-size: 12px; }
  .user-name { display: none; }
  .pin-code { font-size: 32px; }
  .hero { padding: 40px 0 20px; }
  .panel { padding: 22px 18px; }
}