/* ============================================================================
   ZAPMEI - CSS OTIMIZADO
   ============================================================================ */

:root {
  /* Core Colors */
  --color-primary: #2FCC85;
  --color-primary-dark: #059669;
  --color-secondary: #3B82F6;
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #EEE;
  --color-gray-300: #d1d5db;
  --color-gray-400: #5d5d5d;
  --color-gray-500: #757575;
  --color-gray-600: #4b5563;
  --color-gray-700: #3E3E3E;
  --color-gray-800: #1f2937;
  --color-gray-900: #111;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  
  /* Additional Colors for Old Version */
  --color-emerald-50: #ecfdf5;
  --color-emerald-100: #d1fae5;
  --color-emerald-300: #6ee7b7;
  --color-emerald-400: #34d399;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-700: #047857;
  --color-emerald-900: #064e3b;
  
  --color-blue-50: #eff6ff;
  --color-blue-100: #dbeafe;
  --color-blue-400: #60a5fa;
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-blue-700: #1d4ed8;
  --color-blue-900: #1e3a8a;
  
    /* Layout */
  --sidebar-width: 256px;
  --border-radius: 0.5rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --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);
  --transition: 200ms ease-in-out;
  --transition-normal: 200ms ease-in-out;
  --font-family: 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  
  /* Font Sizes */
  --font-size-sm: 0.875rem;
  --font-size-2xl: 1.5rem;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
}



/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: var(--color-white);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--color-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   LAYOUT PRINCIPAL
   ============================================================================ */
.app {
  background-color: var(--color-gray-50);
  display: flex;
  flex-direction: column;
}



.dashboard-page {
  display: flex;
  min-height: 100vh;
  background-color: var(--color-gray-50);
}



/* ============================================================================
   SIDEBAR
   ============================================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
height: 100%;
  width: var(--sidebar-width);
  background-color: var(--color-white);
  border-right: 1px solid var(--color-gray-200);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}



@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
    box-shadow: none;
  }
}

.sidebar.sidebar-open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1024px) {
  .sidebar-overlay {
    display: none;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
  height: 64px;
  flex-shrink: 0;
}



.sidebar-logo {
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  color: var(--color-gray-500);
}

.sidebar-close:hover {
  background-color: var(--color-gray-100);
}



@media (max-width: 1023px) {
  .sidebar-close {
  display: flex;
  }
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: var(--color-gray-700);
  text-decoration: none;
  border-radius: 0.5rem 0 0 0.5rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
    font-size: 0.875rem;
  border-right: 2px solid transparent;
  transition: all var(--transition);
  gap: 8px;
}

.nav-item:hover {
  background-color: var(--color-gray-50);
  color: var(--color-gray-900);
}

.nav-item.active {
  background-color: #EBFFF5;
  color: #18784D;
  border-right-color: #18784D;
}

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-size: 20px;
}





.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-gray-200);
  }



.user-profile {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0.75rem;
}



.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: var(--color-gray-900);
  display: block;
  font-size: 0.875rem;
}

.user-plan {
  color: var(--color-gray-500);
  font-size: 0.75rem;
  text-transform: capitalize;
}



.sidebar-footer-actions {
  display: flex;
  gap: 0.5rem;
}

.logout-btn {
 display: flex;
align-items: center;
gap: 8px;
  background: none;
  border: none;
  color: var(--color-gray-700);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
}


.logout-btn i {
  font-size: 24px;
}



/* ============================================================================
   MOBILE HEADER
   ============================================================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}



.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: var(--border-radius);
  color: var(--color-gray-600);
  cursor: pointer;
}

.sidebar-toggle:hover {
  background-color: var(--color-gray-100);
}

.sidebar-toggle i {
  width: 20px;
  height: 20px;
}

.mobile-header-logo {
  display: flex;
  align-items: center;
}

.mobile-logo {
  height: 32px;
}



@media (max-width: 1023px) {
  .mobile-header {
    display: flex;
  }
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

@media (max-width: 1023px) {
  .main-content {
    margin-left: 0;
    padding-top: 64px;
  }
}

.page-content {
  padding: 40px;
}

@media (max-width: 1023px) {
  .page-content {
    padding: 1rem;
  }
}

/* ============================================================================
   LANDING PAGE
   ============================================================================ */
.landing-page {
  min-height: 100vh;
  display: none;
}

.landing-page.active {
  display: block;
}

.landing-header {
  position: sticky;
  top: 0;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  z-index: 20;
  padding: 1rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  gap: 1rem;
}

@media (min-width: 768px) {
  .nav-menu {
    gap: 2rem;
  }
}

.hero {
  padding: 4rem 0;
}

@media (max-width: 767px) {
  .hero {
    padding: 2rem 0;
  }
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}

@media (max-width: 767px) {
  .hero-content {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero-content {
    padding: 0 0.5rem;
  }
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */
.auth-page {
  min-height: 100vh;
  display: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.auth-page.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.register-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: opacity var(--transition);
}

.auth-back-link:hover {
  opacity: 0.8;
}

.auth-back-link i {
  margin-right: 0.5rem;
}

.auth-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.register-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 1rem;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group small {
  display: block;
  color: var(--color-gray-500);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-500);
  padding: 0.25rem;
}

.password-toggle:hover {
  color: var(--color-gray-700);
}

.password-toggle i {
  width: 16px;
  height: 16px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
  .auth-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--color-gray-700);
  font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.forgot-password {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
  }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-footer p {
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  max-width: 400px;
}

.toast {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease-out;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   RESPONSIVE STYLES
   ============================================================================ */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }
  
  .main-content {
    margin-left: 0;
  }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
    padding: 0 0.5rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
    from {
    transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
  }
} 

.main-content.settings-page {
  padding-top: 0 !important;
} 