/* =========================================
   WEBSTART - DESIGN SYSTEM
   ========================================= */

/* --- Importação de Fontes --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Variáveis CSS Principais --- */
:root {
  /* Cores de Marca */
  --primary: #2563EB; /* Azul */
  --secondary: #7C3AED; /* Roxo */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
  
  /* Cores de Fundo (Dark Mode Premium) */
  --bg-body: #0F172A; /* Slate 900 */
  --bg-surface: #1E293B; /* Slate 800 */
  --bg-surface-lighter: #334155; /* Slate 700 */
  --glass-bg: rgba(30, 41, 59, 0.7);
  
  /* Cores de Texto */
  --text-main: #F8FAFC; /* Slate 50 */
  --text-muted: #94A3B8; /* Slate 400 */
  
  /* Cores de Feedback */
  --success: #10B981; /* Esmeralda */
  --error: #EF4444; /* Vermelho */
  --warning: #F59E0B; /* Âmbar */
  
  /* Sombras e Efeitos */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.3);
  
  /* Bordas */
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transições */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* --- Variáveis CSS - Light Mode Theme --- */
[data-theme="light"] {
  --primary: #2563EB; 
  --secondary: #7C3AED;
  --bg-body: #F8FAFC; /* Slate 50 */
  --bg-surface: #FFFFFF;
  --bg-surface-lighter: #F1F5F9; /* Slate 100 */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --text-main: #0F172A; /* Slate 900 */
  --text-muted: #475569; /* Slate 600 */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}


/* --- Reset e Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

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

a:hover {
  color: #3B82F6; /* Azul mais claro */
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Tipografia Utilitária --- */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block; /* Garante renderização correta em alguns browsers */
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 40px 0;
  }
}

/* --- Botões --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  font-size: 1rem;
  gap: 8px; /* Para ícones */
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* --- Header / Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  transition: var(--transition-normal);
}

.navbar.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Mobile: Navbar needs padding-left to not hide behind hamburger */
@media (max-width: 768px) {
  .navbar .container {
    padding-left: 60px;
  }
}

.nav-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-link {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--primary);
}

/* Hamburger Menu (Mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.8rem;
  cursor: pointer;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 9999;
  padding: 10px;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none; /* Seria ativado via JS */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .hamburger {
    display: block;
  }
}

/* --- Cards / Glassmorphism --- */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-glow);
}

/* --- Utilitários de Grid Responsivo --- */
.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

@media (max-width: 600px) {
  .grid-responsive {
    grid-template-columns: 1fr;
  }
  
  h1 { font-size: 2.2rem !important; }
  h2 { font-size: 1.8rem !important; }
}

/* --- Utilidades --- */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }

/* Forçar scroll horizontal em tabelas no mobile */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Skip Link (Acessibilidade) --- */
.skip-link {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* --- Visually Hidden (Screen Reader Only) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Touch Action (Mobile UX) --- */
a, button, [role="button"] {
  touch-action: manipulation;
}

/* --- Reduced Motion (Acessibilidade) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Focus States (Acessibilidade - WCAG) --- */
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Melhora visibilidade do foco em elementos escuros */
.glass-card:focus-within,
.nav-link:focus,
.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.3);
}

/* =========================================
   ESTILOS DOS PAINÉIS (DASHBOARD & ADMIN)
   ========================================= */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: #080c14; /* Mantido fixo escuro no admin/cliente ou pode variar */
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

[data-theme="light"] .sidebar {
    background: #FFFFFF;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 24px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

[data-theme="light"] .sidebar-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* MAIN CONTENT */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    width: calc(100% - 260px);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    padding: 24px;
}

[data-theme="light"] .metric-card {
    border-color: rgba(0,0,0,0.05);
}

.metric-value {
    font-size: 2rem;
    font-family: 'Outfit';
    font-weight: 700;
    margin: 10px 0;
}

.stat-up {
    color: var(--success);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

[data-theme="light"] .progress-bar {
    background: rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 65%;
    border-radius: 4px;
}

.mobile-toggle { 
    display: none; 
    background: none; 
    border: none; 
    color: var(--text-main); 
    cursor: pointer; 
    padding: 10px; 
}

.close-sidebar { 
    display: none; 
    background: none; 
    border: none; 
    color: var(--text-main); 
    cursor: pointer; 
}

.grid-dashboard { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 30px; 
}

.header-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 40px; 
    gap: 20px; 
}

.header-buttons { 
    display: flex; 
    gap: 15px; 
}

@media (max-width: 1000px) {
    .grid-dashboard { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; align-items: flex-start; }
    .header-buttons { display: flex; width: 100%; justify-content: space-between; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
    .header-buttons button { flex: 1; text-align: center; justify-content: center; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); z-index: 1000; transition: transform 0.3s ease; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 20px; margin-top: 60px; overflow-x: hidden; }
    .mobile-toggle { 
        display: flex; position: fixed; top: 15px; left: 15px; z-index: 999; 
        border-radius: 8px; background: var(--bg-surface); border: 1px solid rgba(255,255,255,0.1); 
        align-items: center; justify-content: center; width: 45px; height: 45px; 
    }
    
    [data-theme="light"] .mobile-toggle {
        border-color: rgba(0,0,0,0.1);
    }
    
    .close-sidebar { display: block; position: absolute; right: 15px; top: 25px; }
    .sidebar-overlay { 
        position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 998; 
        backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; 
    }
    .sidebar-overlay.active { opacity: 1; pointer-events: all; }
}

/* =========================================
   ESTILOS COMPARTILHADOS (LANDING PAGE)
   ========================================= */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* =========================================
   BOTÃO FECHAR MODAL (premium)
   ========================================= */

.modal-close-btn {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 12px rgba(239,68,68,0.3);
}
