@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #8B5CF6;
  --primary-hover: #7C3AED;
  --primary-dark: #6D28D9;
  --secondary-color: #A855F7;
  --accent-color: #C084FC;
  --success-color: #10B981;
  --error-color: #EF4444;
  --warning-color: #F59E0B;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --bg-light: #F9FAFB;
  --bg-card: #FFFFFF;
  --border-light: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.dark {
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-light: #9CA3AF;
  --bg-light: #111827;
  --bg-card: #1F2937;
  --border-light: #374151;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 25%, #d8b4fe 50%, #c084fc 75%, #a855f7 100%);
  min-height: 100vh;
  color: var(--text-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

.dark body {
  background: linear-gradient(135deg, #0a0315 0%, #1a0828 25%, #2d1b40 50%, #4c1d95 75%, #6b21a8 100%) !important;
}

/* Efeito de partículas/rede neural */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Efeito de linhas conectando */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(45deg, transparent 49%, rgba(168, 85, 247, 0.08) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(139, 92, 246, 0.08) 50%, transparent 51%);
  background-size: 100px 100px;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Seção da marca (fora do card) */
.brand-section {
  text-align: center;
  margin-bottom: 1rem;
}

.brand-logo {
  margin-bottom: 1rem;
}

.logo {
  height: 5rem;
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo:hover {
  transform: scale(1.05);
}

.brand-name {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
  letter-spacing: 0.05em;
  position: relative;
}

.dark .brand-name {
  background: linear-gradient(135deg, #A855F7, #C084FC, #E879F9);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.3));
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.theme-toggle {
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: var(--bg-light);
  color: var(--text-primary);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--border-light);
  transform: scale(1.05);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.divider {
  width: 4rem;
  height: 0.25rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  margin: 0 auto;
  border-radius: 0.125rem;
}

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

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-weight: 600;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.qr-container {
  margin-top: 2rem;
  text-align: center;
}

.qr-wrapper {
  background: var(--bg-card);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.qr-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.qr-code {
  background: white;
  width: 12rem;
  height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
}

.spinner {
  animation: spin 1s linear infinite;
  width: 3rem;
  height: 3rem;
  color: var(--primary-color);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.countdown {
  font-size: 0.875rem;
  color: var(--text-light);
}

.qr-instructions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.status-bar {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
}

.status-connected {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-waiting {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

.alert {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success-color);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error-color);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning-color);
}

.logs-toggle {
  margin-top: 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
}

.logs-toggle:hover {
  background: var(--bg-light);
  color: var(--text-secondary);
}

.logs-container {
  margin-top: 0.5rem;
  background: var(--bg-light);
  border-radius: 0.75rem;
  padding: 1rem;
  max-height: 10rem;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
}

.log-entry {
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.log-info { color: #3B82F6; }
.log-success { color: var(--success-color); }
.log-error { color: var(--error-color); }
.log-warning { color: var(--warning-color); }

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--success-color);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hidden {
  display: none !important;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

/* Responsividade */
@media (max-width: 640px) {
  .container {
    padding: 0.5rem;
    gap: 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .logo {
    height: 4rem;
  }
  
  .brand-name {
    font-size: 1.75rem;
  }
  
  .brand-section {
    margin-bottom: 0.5rem;
  }
}

/* Animações de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease-out;
}

/* Scrollbar personalizado */
.logs-container::-webkit-scrollbar {
  width: 4px;
}

.logs-container::-webkit-scrollbar-track {
  background: transparent;
}

.logs-container::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}
