/* ===============================================
   GLOBAL STYLES & VARIABLES - BTScorp Theme
   =============================================== */
:root {
  --primary: #0f3c73;
  --primary-dark: #0c2f59;
  --primary-light: #1d60b3;
  --secondary: #0b1221;
  --secondary-light: #16233a;
  --sidebar-header-bg: #0b1221;
  --sidebar-header-text: #ffffff;
  --accent: #5bd1ff;
  --accent-red: #ef4444;
  --accent-orange: #1d60b3;
  --accent-yellow: #f5c542;
  --accent-green: #10b981;
  --background: #f6f8fb;
  --surface: #ffffff;
  --text-primary: #0b1221;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #cad4e0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 6px 12px -4px rgba(12, 47, 89, 0.25);
  --shadow-lg: 0 18px 32px -8px rgba(12, 47, 89, 0.28);
  --shadow-xl: 0 28px 52px -12px rgba(12, 47, 89, 0.3);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* ===============================================
   BUTTONS
   =============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 1rem;
}

.btn-hero {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-hero svg {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.btn-hero:hover svg {
  transform: translateX(4px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 140, 0, 0.5);
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-light {
  background: white;
  color: var(--primary);
}

.btn-light:hover {
  background: var(--background);
  transform: translateY(-2px);
}

/* ===============================================
   LAYOUT - AUTHENTICATED
   =============================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--background);
}

.app-sidebar {
  width: 260px;
  background: var(--secondary);
  color: white;
  padding: 0 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: auto;
}

.sidebar-brand {
  background-color: var(--sidebar-header-bg);
  margin: 0 -1rem;
  padding: 0.75rem 1rem;
  border-radius: 0;
  min-height: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.sidebar-brand a {
  color: var(--sidebar-header-text, white);
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-brand a i {
  font-size: 1.3rem;
  transition: var(--transition);
}

.sidebar-brand a .brand-text {
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scroll-behavior: auto;
}

/* Seções Colapsáveis */
.nav-section-group {
  margin-top: 0.5rem;
}

.nav-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius);
}

.nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.nav-section-toggle span {
  display: flex;
  align-items: center;
}

.nav-section-toggle .toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.nav-section-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.nav-section-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
  opacity: 1;
}

.nav-section-items.collapsed {
  max-height: 0;
  opacity: 0;
}

.nav-section-items a {
  padding-left: 2.5rem;
  font-size: 0.9rem;
}

.nav-help {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem !important;
}

.nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  padding: 1.75rem 1rem 0.5rem;
  font-weight: 800;
}

.sidebar-nav a {
  color: rgba(255, 255, 255, 0.75);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav a i {
  font-size: 1.25rem;
  opacity: 0.7;
  transition: var(--transition);
  min-width: 20px;
  text-align: center;
}

.sidebar-nav a .nav-text {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.3s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-nav a:hover i {
  opacity: 1;
  color: var(--accent);
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  background: var(--secondary);
  padding: 0.75rem 1.5rem;
  min-height: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.topbar-user .user-name {
  color: #ffffff;
  font-weight: 600;
}

.topbar-user .user-role {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.9;
}

.sidebar-nav a.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 60, 115, 0.3);
}

.sidebar-nav a.active i {
  color: var(--accent);
}

.topbar-user .btn-logout {
  background: rgba(255, 255, 255, 0.08) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  transition: var(--transition);
}

.topbar-user .btn-logout:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px);
}

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

.app-main {
  padding: 2rem;
  flex: 1;
}

/* ===============================================
   PUBLIC HEADER
   =============================================== */
.public-header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.public-header .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===============================================
   HERO SECTION
   =============================================== */
.hero-section {
  background: radial-gradient(circle at top right, var(--primary-dark) 0%, var(--secondary) 100%);
  padding: 8rem 2rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(var(--accent) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.1;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 40px); }
}

.hero-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(4px);
}

.badge-icon {
  width: 16px;
  height: 16px;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: white;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  max-width: 600px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 4rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(91, 209, 255, 0.5);
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(91, 209, 255, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
  margin: 0 auto 1rem;
  color: #5BD1FF;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: rgba(91, 209, 255, 0.15);
  border-radius: 16px;
  border: 2px solid rgba(91, 209, 255, 0.3);
}

.stat-value {
  font-size: 1.225rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Preview */
.hero-visual {
  position: relative;
}

.dashboard-preview {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-preview:hover {
  transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
}

.preview-header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-dots {
  display: flex;
  gap: 0.4rem;
}

.preview-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.preview-dots span:nth-child(1) { background: #ff5f56; }
.preview-dots span:nth-child(2) { background: #ffbd2e; }
.preview-dots span:nth-child(3) { background: #27c93f; }

.preview-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.preview-content {
  padding: 1.5rem;
  background: var(--surface);
  display: grid;
  gap: 1.25rem;
}

.preview-card {
  background: var(--background);
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-icon {
  font-size: 1.2rem;
  color: var(--primary);
  width: 32px;
  height: 32px;
  background: rgba(15, 60, 115, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.card-trend {
  font-size: 0.8rem;
  font-weight: 600;
}

.card-trend.positive {
  color: var(--success, #10b981);
}

.preview-chart {
  height: 80px;
  background: linear-gradient(180deg, rgba(15, 60, 115, 0.05) 0%, rgba(15, 60, 115, 0) 100%);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.preview-chart::after {
  content: '';
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0.2;
}

/* ===============================================
   FEATURES SECTION
   =============================================== */
.features-section {
  padding: 8rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.section-badge.light {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.section-title {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
  color: var(--secondary);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2.5rem;
}

.feature-card {
  background: var(--surface);
  padding: 3rem 2.5rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

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

.feature-icon.blue { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.feature-icon.green { background: color-mix(in srgb, var(--success, #10b981) 10%, transparent); color: var(--success, #10b981); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.feature-icon.orange { background: color-mix(in srgb, var(--warning, #f59e0b) 10%, transparent); color: var(--warning, #f59e0b); }
.feature-icon.red { background: color-mix(in srgb, var(--danger, #ef4444) 10%, transparent); color: var(--danger, #ef4444); }
.feature-icon.teal { background: color-mix(in srgb, var(--info, #14b8a6) 10%, transparent); color: var(--info, #14b8a6); }

.feature-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.feature-description {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.feature-list li::before {
  content: "→";
  color: var(--primary);
  font-weight: 700;
}

/* ===============================================
   PROCESS SECTION
   =============================================== */
.process-section {
  background: var(--secondary);
  padding: 8rem 2rem;
  position: relative;
}

.process-timeline {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.process-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 3rem;
  align-items: start;
}

.step-number {
  width: 80px;
  height: 80px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: 0 0 0 8px rgba(15, 60, 115, 0.1);
}

.step-content {
  padding-top: 0.5rem;
}

.step-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: white;
  font-weight: 700;
}

.step-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.step-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.step-tag {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.process-cta {
  text-align: center;
  margin-top: 5rem;
}

/* ===============================================
   BENEFITS SECTION
   =============================================== */
.benefits-section {
  padding: 8rem 2rem;
  background: var(--background);
}

.benefits-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.benefit-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.benefit-icon {
  width: 72px;
  height: 72px;
  background: var(--background);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary);
  margin: 0 auto 2rem;
}

.benefit-card h4 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.benefit-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
}

/* ===============================================
   AI SECTION
   =============================================== */
.ai-section {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 50%, var(--primary) 100%);
  padding: 8rem 2rem;
  position: relative;
  overflow: hidden;
}

.ai-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.ai-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.ai-particles .particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 50%;
  animation: aiFloat 8s infinite ease-in-out;
}

.ai-particles .particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.ai-particles .particle:nth-child(2) { top: 60%; left: 25%; animation-delay: 1.5s; }
.ai-particles .particle:nth-child(3) { top: 30%; left: 70%; animation-delay: 3s; }
.ai-particles .particle:nth-child(4) { top: 80%; left: 85%; animation-delay: 4.5s; }
.ai-particles .particle:nth-child(5) { top: 50%; left: 50%; animation-delay: 6s; }

@keyframes aiFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-20px) scale(1.5); opacity: 0.8; }
}

.ai-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

.ai-badge {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent) 0%, color-mix(in srgb, var(--primary) 20%, transparent) 100%);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-badge i {
  color: #fbbf24;
  animation: aiStarPulse 2s infinite;
}

@keyframes aiStarPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.ai-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.ai-feature-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ai-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success, #10b981), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-feature-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.06);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.ai-feature-card:hover::before {
  opacity: 1;
}

.ai-feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #10b981;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-feature-icon.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.ai-feature-icon.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.ai-feature-icon.chat {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.3);
}

.ai-feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.ai-feature-card p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.ai-feature-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ===============================================
   CTA SECTION
   =============================================== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 6rem 2rem;
  text-align: center;
  color: white;
}

.cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
  color: white;
}

.cta-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ===============================================
   ANIMATIONS
   =============================================== */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  animation: fadeInRight 0.8s ease-out forwards;
}

.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .process-step {
    grid-template-columns: 80px 1fr;
    gap: 1.5rem;
  }
  
  .step-number {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 1rem 2rem;
  }
  
  .features-section,
  .process-section,
  .benefits-section,
  .cta-section {
    padding: 3rem 1rem;
  }
  
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }
  
  .stat-item {
    padding: 1.5rem 1rem;
  }
  
  .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
  
  .hero-title {
    font-size: 1.75rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }
  
  .hero-cta {
    margin-bottom: 2.5rem;
    flex-direction: column;
  }
  
  .btn-hero {
    width: 100%;
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .app-sidebar {
    width: 220px;
  }
  
  .process-step {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .step-number {
    margin: 0 auto;
  }
  
  .step-features {
    justify-content: center;
  }
}

/* ===============================================
   UTILITIES
   =============================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5);
}

.text-white {
  color: white;
}

/* Form Controls */
.form-control, .form-select {
  border-radius: var(--radius);
  border: 1px solid #cbd5e1;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 60, 115, 0.1);
  outline: none;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  background: #fcfcfd;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 1.5rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.table tbody tr:hover {
  background: rgba(15, 60, 115, 0.03);
}

/* Utility Overrides for High Contrast */
.text-muted {
  color: var(--text-muted) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-success { background-color: var(--accent-green) !important; }
.bg-warning { background-color: var(--accent-orange) !important; }
.bg-danger { background-color: var(--accent-red) !important; }
.bg-info { background-color: #0ea5e9 !important; }

/* ===============================================
   GARANTIR CONTRASTE EM BADGES E BG-* CLASSES
   =============================================== */

/* Badges do Bootstrap - garantir texto branco em fundos escuros */
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-info {
  color: #ffffff !important;
}

.badge.bg-warning {
  color: #1f2937 !important;
}

/* Todos os elementos com bg-* devem ter texto adequado */
.bg-primary,
.bg-secondary,
.bg-success,
.bg-danger,
.bg-info {
  color: #ffffff;
}

.bg-warning {
  color: #1f2937;
}

/* Quando bg-* tem classes de opacidade, ajustar texto */
.bg-primary.bg-opacity-10,
.bg-primary.bg-opacity-25 {
  color: var(--primary) !important;
}

.bg-success.bg-opacity-10,
.bg-success.bg-opacity-25 {
  color: #065f46 !important;
}

.bg-info.bg-opacity-10,
.bg-info.bg-opacity-25 {
  color: #075985 !important;
}

.bg-warning.bg-opacity-10,
.bg-warning.bg-opacity-25 {
  color: #92400e !important;
}

.bg-danger.bg-opacity-10,
.bg-danger.bg-opacity-25 {
  color: #991b1b !important;
}

.text-primary { color: var(--primary) !important; }
.text-success { color: #065f46 !important; }
.text-warning { color: #92400e !important; }
.text-danger { color: #b91c1c !important; }

.text-white-50 {
  color: rgba(255, 255, 255, 0.75) !important;
}

.text-white {
  color: #ffffff !important;
}

.text-dark {
  color: var(--secondary) !important;
}

/* Sidebar Nav active and hover states for text */
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #ffffff !important;
}

.sidebar-nav a.active i {
  color: var(--accent) !important;
}

/* Badges High Contrast */
.badge-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Auth Pages */
.auth-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(15, 60, 115, 0.1), 0 8px 10px -6px rgba(15, 60, 115, 0.1);
  background: #ffffff;
}

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

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.025em;
}

.fw-600 {
  font-weight: 600;
}

/* ===================================================================
   RESPONSIVIDADE COMPLETA - SIDEBAR INTELIGENTE
   =================================================================== */

/* Variáveis da sidebar */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

/* Desktop: Sidebar fixa visível, margin no content */
@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        width: var(--sidebar-width);
        transition: transform 0.3s ease;
        overflow-x: hidden;
    }
    
    /* Estado recolhido da sidebar - esconde completamente */
    .app-sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .app-content {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s ease;
    }
    
    /* Ajustar content quando sidebar está escondida */
    .app-sidebar.collapsed ~ .app-content {
        margin-left: 0 !important;
    }
    
    /* Fallback usando classe no shell */
    .app-shell.sidebar-collapsed > .app-content {
        margin-left: 0 !important;
    }
    
    #sidebarToggle {
        opacity: 1;
        transition: all 0.2s ease;
    }
    
    #sidebarToggle:hover {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        transform: scale(1.05);
    }
    
    .sidebar-backdrop {
        display: none !important;
    }
}

/* Tablet e Mobile: Sidebar oculta com overlay */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        z-index: 1050;
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }
    
    .app-content {
        margin-left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile específico */
@media (max-width: 767.98px) {
    .app-main {
        padding: 1rem;
    }
    
    .app-topbar {
        padding: 0.875rem 1rem;
    }
    
    .topbar-title {
        font-size: 1rem;
    }
    
    /* Ocultar informações do usuário no topbar mobile */
    .topbar-user > div:first-child {
        display: none !important;
    }
    
    .topbar-user .btn-logout span {
        display: none;
    }
    
    .topbar-user .btn-logout {
        padding: 0.5rem;
        min-width: 42px;
    }
    
    /* Cards responsivos */
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem !important;
    }
}

/* ===============================================
   STAT CARDS - CORES DE TEXTO PARA PÁGINAS INTERNAS
   Garante texto escuro em stat-cards com fundo claro
   =============================================== */
.card.stat-card .stat-value {
    color: var(--text-primary) !important;
    text-shadow: none;
}

.card.stat-card .stat-label {
    color: var(--text-secondary) !important;
}

/* Stat cards com fundo colorido (gradiente) devem ter texto branco */
.stat-card-primary .stat-value,
.stat-card-success .stat-value,
.stat-card-warning .stat-value,
.stat-card-info .stat-value,
.stat-card-primary .stat-label,
.stat-card-success .stat-label,
.stat-card-warning .stat-label,
.stat-card-info .stat-label {
    color: var(--text-primary) !important;
}

/* ===============================================
   INPUT MASKS - CEP Loading State
   =============================================== */
input.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cstyle%3E@keyframes spin %7B to %7B transform: rotate(360deg); %7D %7D%3C/style%3E%3Cg style='transform-origin: center; animation: spin 1s linear infinite;'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%230f3c73' stroke-width='3' fill='none' stroke-dasharray='31.4 31.4' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
    padding-right: 40px;
}

/* Placeholder para campos com máscara */
input[data-mask="cpf"]::placeholder { color: #adb5bd; }
input[data-mask="cnpj"]::placeholder { color: #adb5bd; }
input[data-mask="cep"]::placeholder { color: #adb5bd; }
input[data-mask="telefone"]::placeholder { color: #adb5bd; }
input[data-mask="celular"]::placeholder { color: #adb5bd; }

/* Feedback visual do CEP */
input[data-mask="cep"].is-valid {
    border-color: var(--accent-green) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
    padding-right: 40px;
}

input[data-mask="cep"].is-invalid {
    border-color: var(--accent-red) !important;
}
