:root {
  --bg-dark: #060913;
  --bg-panel: rgba(14, 21, 38, 0.78);
  --bg-panel-hover: rgba(20, 31, 56, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(0, 242, 254, 0.35);

  --text-main: #f3f6fc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-cyan: #00f2fe;
  --color-blue: #4facfe;
  --color-emerald: #00e676;
  --color-gold: #ffb800;
  --color-crimson: #ff2a5f;

  --grad-cyan: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-emerald: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
  --grad-crimson: linear-gradient(135deg, #ff2a5f 0%, #ff7643 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-main: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* =========================================================
   FUNDO CYBERNETIC COM RADAR
   ========================================================= */
.cyber-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cyber-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.radar-scan {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 900px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 80px rgba(0, 242, 254, 0.03);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.2;
}

.orb-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  right: 5%;
  background: radial-gradient(circle, #00f2fe, #4facfe);
}

.orb-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  left: 0;
  background: radial-gradient(circle, #ff2a5f, #7928ca);
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  position: relative;
  z-index: 10;
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 1.5rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--grad-cyan);
  color: #060913;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}

.badge-icon svg {
  width: 28px;
  height: 28px;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cyber-highlight {
  color: var(--color-cyan);
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.pro-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-emerald);
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* =========================================================
   CONTAINER PRINCIPAL
   ========================================================= */
.main-layout {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1.25rem;
}

/* Cenários Rápidos */
.quick-scenarios-bar {
  background: rgba(14, 21, 38, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scenarios-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.scenarios-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--color-cyan);
  color: #fff;
  transform: translateY(-2px);
}

.chip-track:hover {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--color-emerald);
}

/* =========================================================
   ABAS PRINCIPAIS
   ========================================================= */
.main-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.nav-tab {
  background: rgba(14, 21, 38, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: rgba(24, 35, 62, 0.85);
  color: var(--text-main);
}

.nav-tab.active {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-cyan);
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   BOXES & PANELS
   ========================================================= */
.panel-box {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-main);
}

.box-title {
  margin-bottom: 1.25rem;
}

.box-title h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.box-title p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.box-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.box-title-bar h3 {
  font-size: 1.15rem;
  color: #fff;
}

.box-title-bar p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

/* =========================================================
   INPUTS & BUSCAS
   ========================================================= */
.search-bar-wrap {
  display: flex;
  gap: 0.75rem;
}

.input-with-icon {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 700;
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 70px;
}

input[type="text"], select, textarea {
  width: 100%;
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.85rem 1.1rem;
  transition: all 0.2s;
}

input[type="text"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
}

.textarea-container {
  position: relative;
  margin-bottom: 1.25rem;
}

.btn-clear-abs {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-abs:hover {
  background: var(--color-crimson);
  color: #fff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.form-group.span-2 {
  grid-column: span 2;
}

.dossier-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* =========================================================
   BOTÕES
   ========================================================= */
.btn-cyan {
  background: var(--grad-cyan);
  color: #060913;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
  white-space: nowrap;
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 242, 254, 0.45);
}

.btn-emerald {
  background: var(--grad-emerald);
  color: #060913;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 230, 118, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================================
   CONTAINERS DE RESULTADO
   ========================================================= */
.results-container {
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

.dossier-card {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-main);
  position: relative;
  overflow: hidden;
}

.dossier-card.threat-high {
  background: linear-gradient(180deg, rgba(38, 12, 24, 0.92) 0%, rgba(18, 12, 24, 0.92) 100%);
  border: 2px solid var(--color-crimson);
}

.dossier-card.threat-med {
  background: linear-gradient(180deg, rgba(38, 30, 12, 0.92) 0%, rgba(18, 16, 12, 0.92) 100%);
  border: 2px solid var(--color-gold);
}

.dossier-card.threat-low {
  background: linear-gradient(180deg, rgba(12, 38, 24, 0.92) 0%, rgba(12, 20, 16, 0.92) 100%);
  border: 2px solid var(--color-emerald);
}

.dossier-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.threat-badge {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.threat-high .threat-badge {
  background: rgba(255, 42, 95, 0.15);
  color: var(--color-crimson);
  border: 1px solid rgba(255, 42, 95, 0.4);
}

.threat-med .threat-badge {
  background: rgba(255, 184, 0, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(255, 184, 0, 0.4);
}

.threat-low .threat-badge {
  background: rgba(0, 230, 118, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.score-display {
  font-family: 'JetBrains Mono', monospace;
}

.score-display .val {
  font-size: 2.2rem;
  font-weight: 800;
}

.score-display .max {
  font-size: 1.1rem;
  color: var(--text-dim);
}

.intel-summary-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.6;
}

.intel-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.intel-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.intel-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.intel-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.2rem;
  word-break: break-all;
}

.intel-val.danger {
  color: var(--color-crimson);
}

.intel-val.warning {
  color: var(--color-gold);
}

/* Ferramentas OSINT em Grid */
.osint-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.osint-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.osint-tile h4 {
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.osint-tile p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.osint-link-btn {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--color-cyan);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.osint-link-btn:hover {
  background: var(--color-cyan);
  color: #060913;
}

/* =========================================================
   MÓDULO TELEMETRIA IP & MAPA
   ========================================================= */
.trap-output-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.copy-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.copy-input-row input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--color-cyan);
}

.btn-copy {
  background: var(--grad-cyan);
  color: #060913;
  font-weight: 700;
  border: none;
  padding: 0 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.trap-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.telemetry-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 1.25rem;
}

.captures-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.capture-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 4px solid var(--color-emerald);
}

.capture-item-card.vpn {
  border-left-color: var(--color-crimson);
}

.capture-top {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.capture-details-line {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* =========================================================
   DOSSIÊ FORMAL POLICIAL
   ========================================================= */
.dossier-rendered-box {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-main);
  font-family: 'Times New Roman', Times, serif;
}

.dossier-header-formal {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.dossier-header-formal h3 {
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.dossier-header-formal h4 {
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.dossier-header-formal p {
  font-size: 0.9rem;
  font-style: italic;
}

.dossier-content {
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* =========================================================
   FOOTER
   ========================================================= */
.app-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 19, 0.95);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* =========================================================
   IMPRESSÃO FORMAL DO DOSSIÊ
   ========================================================= */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .quick-scenarios-bar, .main-tabs, .dossier-form-grid, .action-row, .app-footer, .cyber-bg {
    display: none !important;
  }
  .dossier-rendered-box {
    padding: 0 !important;
    box-shadow: none !important;
  }
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */
@media (max-width: 850px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .grid-2-cols, .telemetry-layout, .dossier-form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.span-2 {
    grid-column: span 1;
  }
  .search-bar-wrap {
    flex-direction: column;
  }
}
