:root {
  --purple-950: #0f0a1e;
  --purple-900: #1e1035;
  --purple-700: #6d28d9;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --purple-100: #f3e8ff;
  --purple-50: #fbf7ff;
  
  --gray-900: #0f172a;
  --gray-600: #475569;
  --gray-400: #94a3b8;
  --gray-200: #e2e8f0;
  --gray-100: #f8fafc;
  
  --surface: #ffffff;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-subtle: 0 10px 25px -5px rgba(124, 58, 237, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--purple-50);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Fundo Iluminado Minimalista */
.bg-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(251, 247, 255, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.app-container {
  width: 100%;
  max-width: 680px;
  z-index: 1;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--purple-950);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--purple-600);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  flex-shrink: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-700);
  border: 1px solid var(--purple-100);
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Card Principal */
.search-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--purple-100);
  box-shadow: var(--shadow-subtle);
  width: 100%;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--purple-950);
  margin-bottom: 6px;
}

.card-header p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 24px;
}

/* Segmented Control (Abas) */
.segmented-control {
  display: flex;
  background: var(--purple-50);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--purple-100);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.tab-btn.active {
  background: white;
  color: var(--purple-700);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Input e Botão */
.input-wrapper {
  display: flex;
  gap: 10px;
}

.input-wrapper input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.input-wrapper input:focus {
  border-color: var(--purple-600);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.input-wrapper button {
  background: var(--purple-600);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.input-wrapper button:hover {
  background: var(--purple-700);
}

/* Container de Resultados */
.result-box {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--purple-100);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Estilo dos Cards de Dados Gerados */
.res-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-950);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.info-item {
  background: var(--purple-50);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--purple-600);
  margin-bottom: 4px;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-900);
  word-break: break-word;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================
   REGRAS DE RESPONSIVIDADE (MOBILE / TABLET)
   ========================================== */

@media (max-width: 600px) {
  body {
    padding: 12px;
    align-items: flex-start;
  }

  .app-header {
    margin-bottom: 16px;
  }

  .brand {
    font-size: 1rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .search-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .card-header h2 {
    font-size: 1.15rem;
  }

  .card-header p {
    font-size: 0.85rem;
    margin-bottom: 18px;
  }

  .input-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .input-wrapper button {
    width: 100%;
    padding: 14px;
  }

  .tab-btn {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .grid-info {
    grid-template-columns: 1fr;
  }

  .info-item {
    padding: 10px 12px;
  }
}
