:root {
  --bg-main: #070a13;
  --bg-card: rgba(16, 24, 44, 0.75);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.3);
  
  --text-main: #f0f4fc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --color-danger: #ff3366;
  --color-danger-bg: rgba(255, 51, 102, 0.12);
  --color-danger-border: rgba(255, 51, 102, 0.35);

  --color-warning: #ffb800;
  --color-warning-bg: rgba(255, 184, 0, 0.12);
  --color-warning-border: rgba(255, 184, 0, 0.35);

  --color-success: #00e676;
  --color-success-bg: rgba(0, 230, 118, 0.12);
  --color-success-border: rgba(0, 230, 118, 0.35);

  --color-accent: #00f2fe;
  --color-accent-grad: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --color-danger-grad: linear-gradient(135deg, #ff0844 0%, #ff4e50 100%);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
  --shadow-glow: 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-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Fundo Dinâmico com Efeito Glow */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
}

.glow-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, #00f2fe, #4facfe);
}

.glow-2 {
  width: 500px;
  height: 500px;
  bottom: 0;
  right: 5%;
  background: radial-gradient(circle, #ff0844, #7928ca);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  background: rgba(7, 10, 19, 0.75);
  backdrop-filter: blur(16px);
  padding: 1rem 1.5rem;
}

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

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

.shield-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--color-accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #070a13;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.shield-logo svg {
  width: 26px;
  height: 26px;
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-live {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(0, 242, 254, 0.35);
  letter-spacing: 0.05em;
}

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

/* Container Principal */
.main-container {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1.25rem;
}

/* Exemplos Rápidos */
.quick-examples-section {
  background: rgba(16, 24, 44, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quick-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.chip {
  background: rgba(255, 255, 255, 0.05);
  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-accent);
  color: #fff;
  transform: translateY(-2px);
}

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

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.tab-btn {
  background: rgba(16, 24, 44, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(26, 38, 68, 0.7);
}

.tab-btn.active {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-accent);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.tab-content {
  display: none;
}

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

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

/* Input Styles */
.input-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.input-header label {
  font-size: 0.98rem;
  color: var(--text-main);
}

.input-header .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

textarea, input[type="text"], select {
  width: 100%;
  background: rgba(8, 12, 24, 0.85);
  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.9rem 1.1rem;
  transition: all 0.2s ease;
  resize: vertical;
}

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

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

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

.input-group-row {
  display: flex;
  gap: 0.75rem;
}

/* Botões */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--color-accent-grad);
  color: #070a13;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: 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.2);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Áreas de Resultado */
.result-area {
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

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

.result-card.risk-high {
  background: linear-gradient(180deg, rgba(35, 10, 20, 0.9) 0%, rgba(18, 12, 22, 0.9) 100%);
  border: 2px solid var(--color-danger);
}

.result-card.risk-medium {
  background: linear-gradient(180deg, rgba(35, 28, 10, 0.9) 0%, rgba(18, 16, 12, 0.9) 100%);
  border: 2px solid var(--color-warning);
}

.result-card.risk-low {
  background: linear-gradient(180deg, rgba(10, 35, 22, 0.9) 0%, rgba(12, 22, 16, 0.9) 100%);
  border: 2px solid var(--color-success);
}

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

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

.risk-high .risk-badge-large {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.risk-medium .risk-badge-large {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.risk-low .risk-badge-large {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.risk-score-display {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
}

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

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

.key-verdict-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.key-verdict-box strong {
  color: #fff;
}

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

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

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

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.2rem;
  word-break: break-all;
}

.detail-value.highlight-warning {
  color: #ffa726;
}

.detail-value.highlight-danger {
  color: var(--color-danger);
}

.flags-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.flag-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
  border-left: 4px solid var(--color-danger);
}

.flag-card.flag-warning {
  border-left-color: var(--color-warning);
}

.flag-card.flag-safe {
  border-left-color: var(--color-success);
}

.flag-icon {
  font-size: 1.25rem;
}

.flag-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.flag-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-footer-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.25rem;
}

.btn-whatsapp-share {
  background: #25d366;
  color: #070a13;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-whatsapp-share:hover {
  background: #1eb956;
  transform: translateY(-2px);
}

/* ===================================================
   MÓDULO OSINT & INVESTIGAÇÃO
   =================================================== */
.osint-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

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

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

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

.btn-osint-action {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-osint-action:hover {
  background: var(--color-accent);
  color: #070a13;
}

.interactive-guide-box {
  background: rgba(0, 242, 254, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  margin-top: 1.5rem;
}

.interactive-guide-box h4 {
  font-size: 1.05rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.interactive-guide-box ol {
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.interactive-guide-box li {
  margin-bottom: 0.5rem;
}

/* ===================================================
   MÓDULO SOS RECUPERAÇÃO MED & B.O.
   =================================================== */
.recovery-steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.rec-step-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.urgent-card {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.rec-step-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.urgent-card .rec-step-badge {
  color: var(--color-danger);
}

.step-action-box {
  background: rgba(0,0,0,0.35);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.step-action-box ol {
  padding-left: 1.1rem;
  margin-top: 0.35rem;
}

.step-action-box li {
  margin-bottom: 0.3rem;
}

.bo-box {
  background: rgba(8, 12, 24, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

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

.gateway-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.contact-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.contact-card h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.contact-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.contact-card code {
  color: var(--color-accent);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.badge-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  color: var(--text-dim);
}

/* Informações / Base */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem 0;
}

.info-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.info-box h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.alert-box {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.tip-box {
  border-color: rgba(0, 242, 254, 0.3);
  background: rgba(0, 242, 254, 0.05);
}

.tip-box ul {
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.tip-box li {
  margin-bottom: 0.4rem;
}

.section-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
}

.subtitle-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.table-responsive {
  overflow-x: auto;
}

.gateway-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.gateway-table th, .gateway-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.gateway-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.badge-risk-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-risk-high {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-risk-med {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

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

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

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

/* Responsividade Mobile */
@media (max-width: 768px) {
  .info-grid, .recovery-steps-grid, .form-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    width: 100%;
    justify-content: center;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar button {
    width: 100%;
    justify-content: center;
  }

  .input-group-row {
    flex-direction: column;
  }

  .input-group-row button {
    width: 100%;
  }
}
