/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - MD TERCEIRIZAÇÃO
   ========================================================================== */

:root {
  /* Colors */
  --primary-rgb: 37, 51, 104; /* Corporate Blue #253368 */
  --primary: rgb(var(--primary-rgb));
  --primary-hover: #1b2650;
  --secondary-rgb: 59, 130, 246; /* Vibrant Accent Blue #3b82f6 */
  --secondary: rgb(var(--secondary-rgb));
  --secondary-hover: #2563eb;
  
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-light: #e2e8f0;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  
  /* CRM Dark Mode Variables */
  --crm-bg: #0b0f19;
  --crm-card: rgba(23, 32, 53, 0.7);
  --crm-border: rgba(255, 255, 255, 0.08);
  --crm-text: #e2e8f0;
  --crm-text-muted: #94a3b8;
  
  /* Fonts */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --header-height: 80px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-premium: 0 20px 40px -15px rgba(var(--secondary-rgb), 0.15);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

ul {
  list-style: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   LAYOUT & HEADER/FOOTER (LANDING PAGE)
   ========================================================================== */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: var(--transition);
}

.main-header.scrolled {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  height: 70px;
}

.header-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(var(--secondary-rgb), 0.3);
}

.logo-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  color: var(--secondary);
}

.logo-subtitle {
  font-size: 11px;
  color: var(--primary);
  display: block;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: -4px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-item {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 15px;
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-item:hover::after {
  width: 100%;
}

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

.btn-crm-access {
  background: rgba(30, 58, 138, 0.08);
  color: var(--secondary);
  border: 1px solid rgba(30, 58, 138, 0.15);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-crm-access:hover {
  background: var(--secondary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
}

.main-footer {
  background: #0f172a;
  color: #f8fafc;
  padding: 80px 0 30px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 60px;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo .logo-title {
  color: white;
  font-size: 24px;
}

.footer-logo .logo-subtitle {
  color: var(--primary-hover);
  display: inline-block;
  margin-left: 4px;
  font-size: 24px;
  text-transform: none;
  font-family: var(--font-title);
  font-weight: 800;
}

.footer-desc {
  color: var(--text-light);
  margin-bottom: 24px;
  max-width: 380px;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  color: white;
  display: block;
}

.footer-links h4, .footer-contact h4 {
  font-size: 18px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 8px;
}

.footer-links h4::after, .footer-contact h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary);
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links ul li a {
  color: var(--text-light);
}

.footer-links ul li a:hover {
  color: var(--primary-hover);
  padding-left: 4px;
}

.footer-contact p {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.footer-contact p i {
  color: var(--primary-hover);
  width: 18px;
  height: 18px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 60px auto 0 auto;
  padding: 30px 24px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   PUBLIC LANDING PAGE VIEWS & COMPONENTS
   ========================================================================== */

#app-container {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - 400px);
}

#app-container:has(.crm-wrapper),
#app-container:has(.crm-login-container) {
  margin-top: 0;
  min-height: 100vh;
}

.landing-section {
  padding: 100px 0;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: radial-gradient(circle at 80% 20%, rgba(var(--secondary-rgb), 0.08) 0%, transparent 50%), var(--bg-white);
  padding: 140px 0 100px 0;
  overflow: hidden;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 48px;
  color: var(--primary);
  margin-bottom: 24px;
}

.hero-content h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(var(--secondary-rgb), 0.2);
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(var(--secondary-rgb), 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(30, 58, 138, 0.05);
  transform: translateY(-2px);
}

.hero-badges {
  display: flex;
  gap: 24px;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-dark);
}

.hero-badge i {
  color: var(--success);
  width: 20px;
  height: 20px;
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
}

.image-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 400px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.1), rgba(30, 58, 138, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

/* Stylized placeholder illustration */
.hero-illustration {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 80%;
}

.illus-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transform: translateX(-20px);
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.illus-card:nth-child(1) { animation-delay: 0.2s; }
.illus-card:nth-child(2) { animation-delay: 0.4s; transform: translateX(20px); }
.illus-card:nth-child(3) { animation-delay: 0.6s; }

.illus-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--secondary-rgb), 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.illus-icon.blue {
  background: rgba(30, 58, 138, 0.1);
  color: var(--secondary);
}

.illus-info {
  flex-grow: 1;
}

.illus-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
}

.illus-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px auto;
  padding: 0 24px;
}

.section-tag {
  color: var(--secondary);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 12px;
}

.section-title {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 16px;
}

/* Services Grid */
.services-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.service-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 40px 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--secondary-rgb), 0.2);
}

.service-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: rgba(var(--secondary-rgb), 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: var(--transition);
}

.service-card:hover .service-icon-wrapper {
  background: var(--primary);
  color: white;
}

.service-card h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.service-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-card:hover .service-link {
  color: var(--secondary-hover);
}

/* Diferenciais Section */
.diferenciais-section {
  background: var(--bg-white);
}

.diferenciais-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.diferenciais-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dif-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.dif-card:hover {
  border-color: rgba(var(--secondary-rgb), 0.2);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}

.dif-icon {
  color: var(--secondary);
  margin-bottom: 16px;
}

.dif-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--primary);
}

.dif-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Contact Section & Form */
.contact-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1.5fr;
}

.contact-info-panel {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-panel h3 {
  font-size: 28px;
  margin-bottom: 16px;
}

.contact-info-panel p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 40px;
}

.info-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.info-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.info-item-text p {
  margin: 0;
  font-size: 14px;
}

.info-item-text p.title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}

.contact-form-panel {
  padding: 60px 50px;
}

.contact-form-panel h3 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.crm-wrapper .form-group label {
  color: var(--crm-text-muted);
}

.crm-wrapper .form-control {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--crm-border);
  color: white;
}

.crm-wrapper select.form-control option {
  background-color: #172035;
  color: white;
}

.crm-wrapper .form-control:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.2);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-light);
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.btn-form-submit {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.15);
  transition: var(--transition);
}

.btn-form-submit:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(var(--secondary-rgb), 0.25);
}

.btn-form-submit:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
}

/* Floating WhatsApp Button & Popup Widget */
.whatsapp-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
}

.whatsapp-float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  position: relative;
}

.whatsapp-float-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25d366;
  opacity: 0.4;
  z-index: -1;
  animation: floatPulse 2s infinite;
}

.whatsapp-float-btn:hover {
  transform: scale(1.08) rotate(5deg);
  background: #20ba5a;
}

.whatsapp-float-btn svg {
  width: 30px;
  height: 30px;
  fill: white;
  display: block;
}

.whatsapp-popup {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.whatsapp-popup.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.whatsapp-popup-header {
  background: #075e54;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.whatsapp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-title);
}

.whatsapp-status-info h4 {
  font-size: 14px;
  margin: 0;
}

.whatsapp-status-info span {
  font-size: 11px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.whatsapp-status-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #25d366;
  border-radius: 50%;
  display: inline-block;
}

.whatsapp-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.7;
}

.whatsapp-popup-close:hover {
  opacity: 1;
}

.whatsapp-popup-body {
  padding: 20px;
  background: #efe7dd;
  max-height: 360px;
  overflow-y: auto;
}

.whatsapp-message-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
}

.whatsapp-message-bubble::after {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent white transparent transparent;
}

.whatsapp-popup-form .form-group {
  margin-bottom: 12px;
}

.whatsapp-popup-form label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.whatsapp-popup-form .form-control {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-whatsapp-submit {
  width: 100%;
  background: #25d366;
  color: white;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  margin-top: 16px;
}

.btn-whatsapp-submit:hover {
  background: #20ba5a;
}

/* Success Modal & Toast Alert */
.toast-alert {
  position: fixed;
  top: 24px;
  right: 24px;
  background: white;
  border-left: 4px solid var(--success);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateX(120%);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-alert.show {
  transform: translateX(0);
}

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

.toast-alert i {
  color: var(--success);
}

.toast-alert.error i {
  color: var(--danger);
}

.toast-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

/* ==========================================================================
   CRM PANEL LAYOUT & VIEWS (ADMIN AREA)
   ========================================================================== */

.crm-wrapper {
  background-color: var(--crm-bg);
  color: var(--crm-text);
  min-height: 100vh;
  margin-top: 0 !important; /* Reseta margem de cabeçalho global */
  display: flex;
  overflow: hidden;
}

/* CRM Sidebar */
.crm-sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.9);
  border-right: 1px solid var(--crm-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.crm-sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-logo .logo-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.crm-logo .logo-title {
  color: white;
  font-size: 18px;
}

.crm-logo .logo-subtitle {
  font-size: 9px;
}

.crm-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.crm-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--crm-text-muted);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: var(--transition);
}

.crm-nav-item:hover, .crm-nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.crm-nav-item.active {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.2);
}

.crm-sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--crm-border);
}

.btn-crm-logout {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-crm-logout:hover {
  background: var(--danger);
  color: white;
}

/* CRM Content Area */
.crm-main-content {
  margin-left: 260px;
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(var(--secondary-rgb), 0.05) 0%, transparent 60%);
  overflow-y: auto;
}

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

.crm-page-title h2 {
  font-size: 28px;
  color: white;
  margin-bottom: 6px;
}

.crm-page-title p {
  color: var(--crm-text-muted);
  font-size: 14px;
}

/* Login Screen */
.crm-login-container {
  min-height: 100vh;
  width: 100vw;
  background: var(--crm-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.crm-login-container::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.15) 0%, transparent 70%);
  z-index: 1;
}

.crm-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-premium);
  position: relative;
  z-index: 10;
}

.crm-login-header {
  text-align: center;
  margin-bottom: 32px;
}

.crm-login-header .logo-icon {
  margin: 0 auto 16px auto;
}

.crm-login-header h2 {
  color: white;
  font-size: 24px;
  margin-bottom: 8px;
}

.crm-login-header p {
  color: var(--crm-text-muted);
  font-size: 14px;
}

.crm-login-card .form-control {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--crm-border);
  color: white;
}

.crm-login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.crm-login-card label {
  color: var(--crm-text-muted);
}

/* Dashboard Metrics Grid */
.crm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.metric-card:hover {
  border-color: rgba(var(--secondary-rgb), 0.3);
  transform: translateY(-2px);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(var(--secondary-rgb), 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.blue { background: rgba(14, 165, 233, 0.1); color: var(--info); }
.metric-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.metric-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

.metric-info h4 {
  font-size: 13px;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.metric-info p {
  font-size: 28px;
  font-family: var(--font-title);
  font-weight: 800;
  color: white;
}

/* Dashboard Charts & Insights */
.crm-dashboard-charts {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.crm-chart-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.crm-chart-card h3 {
  font-size: 18px;
  color: white;
  margin-bottom: 24px;
}

/* Custom CSS/SVG Charts */
.chart-bar-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar-item {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  align-items: center;
  gap: 16px;
}

.chart-bar-label {
  font-size: 13px;
  color: var(--crm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.chart-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.8s ease-in-out;
}

.chart-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-align: right;
}

.origem-insights {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

.origem-stat {
  text-align: center;
}

.origem-stat-num {
  font-size: 24px;
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary-hover);
}

.origem-stat-label {
  font-size: 12px;
  color: var(--crm-text-muted);
}

/* Kanban Board View */
.kanban-view-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 60vh;
  align-items: flex-start;
}

.kanban-column {
  flex: 0 0 280px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--crm-border);
}

.kanban-column-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--crm-text);
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-cards-container {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
}

.kanban-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: grab;
  transition: var(--transition);
  position: relative;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card:hover {
  border-color: rgba(var(--secondary-rgb), 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 14px;
  color: white;
  margin-bottom: 8px;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--crm-text-muted);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.kanban-card-service {
  background: rgba(var(--secondary-rgb), 0.15);
  color: #60a5fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.kanban-card-days {
  color: var(--warning);
}

.kanban-card-days.urgent {
  color: var(--danger);
  font-weight: 600;
}

.kanban-card.dragging {
  opacity: 0.5;
  border: 2px dashed var(--primary);
}

/* Leads List Table View */
.crm-table-container {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}

.crm-table-controls {
  padding: 20px 24px;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.crm-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.crm-search-wrapper input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
}

.crm-search-wrapper input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.crm-search-wrapper i {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--crm-text-muted);
}

.crm-filters {
  display: flex;
  gap: 12px;
}

.crm-filters select {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  cursor: pointer;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.crm-table th {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.3);
  border-bottom: 1px solid var(--crm-border);
  font-family: var(--font-title);
  color: white;
  font-weight: 600;
}

.crm-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--crm-border);
  color: var(--crm-text);
  white-space: nowrap;
}

.crm-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.crm-table tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.badge.novo-lead { background: rgba(14, 165, 233, 0.15); color: var(--info); }
.badge.contato { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge.proposta { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge.negociacao { background: rgba(var(--secondary-rgb), 0.15); color: #60a5fa; }
.badge.fechado { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge.perdido { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.badge.whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.badge.landing-page { background: rgba(30, 58, 138, 0.15); color: #60a5fa; }

.btn-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--crm-border);
  color: var(--crm-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Detail Drawer (Slide-out panel) */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: #0f172a;
  border-left: 1px solid var(--crm-border);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow-y: auto;
}

.drawer-backdrop.open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--crm-border);
}

.drawer-header h3 {
  font-size: 20px;
  color: white;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--crm-text-muted);
  cursor: pointer;
}

.drawer-close:hover {
  color: white;
}

.drawer-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-info-group h4 {
  font-size: 12px;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.drawer-info-group p {
  font-size: 15px;
  color: white;
}

.drawer-info-group select.form-control, .drawer-info-group textarea.form-control {
  background: rgba(255,255,255,0.03);
  border-color: var(--crm-border);
  color: white;
}

.drawer-footer {
  margin-top: 40px;
  display: flex;
  gap: 16px;
}

/* Proposal Generator View */
.proposal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.proposal-form-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 30px;
}

.proposal-form-card h3 {
  font-size: 18px;
  color: white;
  margin-bottom: 24px;
}

.proposal-preview-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-print-proposal {
  margin-bottom: 20px;
  align-self: flex-end;
}

/* A4 Sheet Timbrado Page Styles */
.a4-sheet {
  width: 100%;
  max-width: 595px; /* A4 size scaling */
  min-height: 842px;
  background: white;
  color: #1e293b;
  padding: 40px 50px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid var(--border-light);
}

.proposal-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.proposal-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.proposal-header .logo-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.proposal-header .logo-title {
  font-size: 16px;
  color: var(--primary);
}

.proposal-header .logo-subtitle {
  font-size: 8px;
}

.proposal-header-meta {
  text-align: right;
}

.proposal-header-meta h2 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 4px;
}

.proposal-header-meta p {
  color: var(--text-muted);
  font-size: 9px;
}

.proposal-body {
  margin: 30px 0;
  flex-grow: 1;
}

.proposal-body h3 {
  font-size: 13px;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  margin: 20px 0 10px 0;
}

.proposal-intro {
  margin-bottom: 20px;
}

.proposal-client-table, .proposal-pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.proposal-client-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.proposal-client-table td.label {
  font-weight: 700;
  color: var(--primary);
  width: 100px;
}

.proposal-pricing-table th {
  background: var(--bg-light);
  padding: 8px 12px;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--border-light);
  text-align: left;
}

.proposal-pricing-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
}

.proposal-pricing-table tr.total-row {
  background: #f1f5f9;
  font-weight: 700;
}

.proposal-terms {
  margin-top: 24px;
  font-size: 9px;
  color: var(--text-muted);
}

.proposal-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  text-align: center;
}

.signature-line {
  border-top: 1px solid var(--text-muted);
  padding-top: 8px;
  font-size: 9px;
}

.signature-line span {
  display: block;
}

.signature-line span.name {
  font-weight: 700;
  color: var(--primary);
}

.proposal-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  text-align: center;
  font-size: 8px;
  color: var(--text-muted);
}

/* CRM Settings Panel */
.crm-settings-card {
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  padding: 30px;
  max-width: 600px;
}

.crm-settings-card h3 {
  font-size: 18px;
  color: white;
  margin-bottom: 24px;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* Animation utilities */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.animate-zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-content p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta, .hero-badges {
    justify-content: center;
  }
  .image-wrapper {
    margin: 0 auto;
  }
  .diferenciais-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-container {
    grid-template-columns: 1fr;
  }
  .contact-info-panel {
    padding: 40px;
  }
  .crm-dashboard-charts {
    grid-template-columns: 1fr;
  }
  .proposal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none; /* In vanilla, we will toggle classes for mobile menu */
  }
  .mobile-menu-btn {
    display: block;
  }
  .main-header.menu-open .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    gap: 16px;
  }
  .crm-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .crm-sidebar.open {
    transform: translateX(0);
  }
  .crm-main-content {
    margin-left: 0;
    padding: 20px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ==========================================================================
   PRINT MEDIA RULES (PROPOSAL PDF OUTPUT)
   ========================================================================== */

@media print {
  body * {
    visibility: hidden;
  }
  
  .a4-sheet, .a4-sheet * {
    visibility: visible;
  }
  
  .a4-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
  }
  
  /* Prevent header and footer of browser from printing URL and Date */
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}
