:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Animado */
.bg-grid {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Efeitos de brilho flutuantes */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.glow.p1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(240, 147, 251, 0.4), transparent 70%);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.glow.p2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.4), transparent 70%);
  bottom: -10%;
  right: -5%;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
}

/* Badge suave */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.6s ease;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #10b981, #34d399);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Card de Login */
.card-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: white;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.card-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* Animações de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease both;
}

/* Form Controls */
.form-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.9);
  display: block;
}

.input-soft {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.3s ease;
  width: 100%;
}

.input-soft::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-soft:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Botão Principal */
.btn-brand {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(245, 87, 108, 0.3);
}

.btn-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-brand:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(245, 87, 108, 0.4);
}

.btn-brand:hover::before {
  opacity: 1;
}

.btn-brand:active {
  transform: translateY(-1px);
}

.btn-brand span {
  position: relative;
  z-index: 1;
}

/* Links */
.link-soft {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.link-soft::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: width 0.3s ease;
}

.link-soft:hover {
  color: white;
}

.link-soft:hover::after {
  width: 100%;
}

/* Alertas */
.alert {
  border-radius: 12px;
  border: none;
  animation: slideDown 0.4s ease;
  backdrop-filter: blur(10px);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fee;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
[data-loading="true"] button[type="submit"] {
  position: relative;
}

[data-loading="true"] button[type="submit"]:disabled {
  opacity: 0.7;
  pointer-events: none;
}

[data-loading="true"] button[type="submit"]:disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 576px) {
  html, body {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body, .container, .container-fluid {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .section, .section-header, .section-title, .table-container, .table, .stats-grid, .info-grid {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .card-glass {
    border-radius: 20px;
    padding: 1.2rem !important;
    margin-top: 32px !important;
    margin-bottom: 32px !important;
    min-width: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .badge-soft {
    font-size: 12px;
    padding: 6px 12px;
  }
  .glow {
    filter: blur(60px);
  }
}

/* Text utilities */
.text-white-50 {
  color: rgba(255, 255, 255, 0.7) !important;
}

.fw-bold {
  font-weight: 700 !important;
}

/* Animação no foco do input */
.input-soft:focus {
  animation: inputFocus 0.4s ease;
}

@keyframes inputFocus {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(-2px); }
}

/* Efeito de onda no click do botão */
.btn-brand {
  overflow: hidden;
}

.btn-brand::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-brand:active::after {
  width: 300px;
  height: 300px;
}

/* --- AJUSTES MOBILE E LOGIN --- */
@media (max-width: 576px) {
  html, body {
    min-height: 100vh !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative;
  }
  body.bg-grid {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-height: 100vh !important;
    height: auto !important;
    padding-bottom: 40px !important;
  }
  .container, .container-fluid {
    padding-left: 8px !important;
    padding-right: 8px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .card-glass {
    padding: 1.2rem !important;
    margin-top: 32px !important;
    margin-bottom: 32px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .logo-container {
    margin-bottom: 12px !important;
  }
  .feature-badge {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  .fade-in-up {
    animation: none !important;
  }
}

/* Forçar rolagem vertical sempre disponível no login */
body.bg-grid {
  overflow-y: auto !important;
}
