:root {
  --brand-color: #1D4ED8;
  --brand-gradient: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 50%, #6366F1 100%);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-elevation-2: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-elevation-3: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-elevation-4: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
}

.dark {
  --glass-bg: rgba(11, 18, 32, 0.85);
  --glass-border: rgba(148, 163, 184, 0.2);
}

/* Enhanced Button System */
.btn-brand {
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 500;
  letter-spacing: -0.025em;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-elevation-2);
}

.btn-brand:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation-4);
}

.btn-brand:hover:before {
  opacity: 1;
}

.btn-brand:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevation-3);
}

/* Secondary Button Style */
.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--brand-color);
  font-weight: 500;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-elevation-1);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevation-2);
  background: rgba(255, 255, 255, 0.95);
}

.dark .btn-secondary {
  background: var(--glass-bg);
  color: #3B82F6;
  border-color: rgba(148, 163, 184, 0.3);
}

.dark .btn-secondary:hover {
  background: rgba(11, 18, 32, 0.95);
}

.text-brand-dyn { color: var(--brand-color); }

.bg-brand-gradient {
  background-image: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-color) 85%, #0b1220 15%),
    color-mix(in srgb, var(--brand-color) 55%, #4f46e5 45%)
  );
}
@supports not (color-mix(in srgb, red, blue)) {
  .bg-brand-gradient { background-image: linear-gradient(135deg, var(--brand-color), #4f46e5); }
}

/* Improve white logo visibility on light backgrounds */
.logo-mark { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)); }
.dark .logo-mark { filter: none; }

/* Enhanced Card System */
.card-elevated {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-elevation-3);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card-elevated:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  opacity: 0.6;
}

.card-elevated:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-elevation-4);
}

.dark .card-elevated {
  background: var(--glass-bg);
  border-color: rgba(148, 163, 184, 0.2);
}

/* Enhanced Navigation */
.nav-link {
  position: relative;
  transition: var(--transition-fast);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(29, 78, 216, 0.08);
  color: var(--brand-color);
}

.nav-link:before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--brand-gradient);
  border-radius: 1px;
  transform: scaleX(0);
  transition: var(--transition-fast);
}

.nav-link:hover:before {
  transform: scaleX(1);
}

/* Enhanced Form Elements */
.form-input {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-elevation-1);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.dark .form-input {
  background: var(--glass-bg);
  border-color: rgba(148, 163, 184, 0.3);
}

.dark .form-input:focus {
  background: rgba(11, 18, 32, 0.95);
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Lightweight utility for visually-hidden status messages */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

/* Chat widget styles (responsive, accessible) */
.it-chat-btn {
  position: fixed; 
  right: 16px; 
  bottom: 16px; 
  z-index: 9999;
  width: 56px; 
  height: 56px; 
  border-radius: 50%; 
  border: 1px solid rgba(15,23,42,.15);
  background: white; 
  color: #0f172a; 
  box-shadow: 0 4px 12px rgba(0,0,0,.15), 0 0 0 0 rgba(29,78,216,.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}

.it-chat-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0,0,0,.2), 0 0 0 8px rgba(29,78,216,.1);
  background: #fafafa;
}

.it-chat-btn:active {
  transform: scale(0.95);
}

.dark .it-chat-btn { 
  background: #0b1220; 
  color: #e2e8f0; 
  border-color: rgba(148,163,184,.25); 
  box-shadow: 0 4px 12px rgba(0,0,0,.25), 0 0 0 0 rgba(59,130,246,.4);
}

.dark .it-chat-btn:hover {
  background: #1e293b;
  box-shadow: 0 8px 25px rgba(0,0,0,.4), 0 0 0 8px rgba(59,130,246,.15);
}

.it-chat-panel {
  position: fixed; 
  right: 16px; 
  bottom: 88px; 
  z-index: 9998; 
  width: 380px; 
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  border-radius: 16px; 
  border: 1px solid rgba(15,23,42,.12);
  background: white; 
  color: #0f172a; 
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  display: none;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.it-chat-panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dark .it-chat-panel { 
  background: rgba(11,18,32,.95); 
  color: #e2e8f0; 
  border-color: rgba(148,163,184,.25);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.4), 0 10px 10px -5px rgba(0,0,0,.2);
}

.it-chat-header { 
  padding: 16px 20px; 
  border-bottom: 1px solid rgba(15,23,42,.08); 
  font-weight: 600; 
  font-size: 16px;
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  border-radius: 16px 16px 0 0;
  background: rgba(248,250,252,.8);
}

.dark .it-chat-header { 
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.6);
}

.it-chat-header button {
  padding: 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}

.it-chat-header button:hover {
  background: rgba(15,23,42,.08);
}

.dark .it-chat-header button:hover {
  background: rgba(148,163,184,.15);
}

.it-chat-body { 
  padding: 16px 20px; 
  max-height: 320px; 
  overflow-y: auto;
  scroll-behavior: smooth;
}

.it-chat-body::-webkit-scrollbar {
  width: 6px;
}

.it-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.it-chat-body::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.3);
  border-radius: 3px;
}

.dark .it-chat-body::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.5);
}

.it-chat-msg { 
  margin: 12px 0; 
  font-size: 14px; 
  line-height: 1.4;
  animation: fadeInUp 0.3s ease-out;
}

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

.it-chat-msg.user { 
  text-align: right; 
}

.it-chat-msg .bubble { 
  display: inline-block; 
  padding: 10px 14px; 
  border-radius: 16px; 
  max-width: 85%;
  word-wrap: break-word;
  line-height: 1.4;
}

.it-chat-msg.user .bubble { 
  background: var(--brand-color); 
  color: white;
  border-bottom-right-radius: 4px;
}

.it-chat-msg.assistant .bubble { 
  background: #f1f5f9; 
  color: #334155;
  border-bottom-left-radius: 4px;
}

.dark .it-chat-msg.assistant .bubble { 
  background: rgba(148,163,184,.15); 
  color: #e2e8f0; 
}

.it-chat-footer { 
  padding: 16px 20px; 
  border-top: 1px solid rgba(15,23,42,.08); 
  display: flex; 
  gap: 12px;
  border-radius: 0 0 16px 16px;
  background: rgba(248,250,252,.5);
}

.dark .it-chat-footer { 
  border-color: rgba(148,163,184,.18);
  background: rgba(15,23,42,.3);
}

.it-chat-input { 
  flex: 1; 
  font-family: inherit; 
  font-size: 14px;
  padding: 10px 14px; 
  border-radius: 12px; 
  border: 1px solid rgba(15,23,42,.2); 
  background: white; 
  color: #0f172a;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.it-chat-input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}

.dark .it-chat-input { 
  background: #0b1220; 
  color: #e2e8f0; 
  border-color: rgba(148,163,184,.35); 
}

.dark .it-chat-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.it-chat-send { 
  padding: 10px 16px; 
  border-radius: 12px; 
  background: var(--brand-color); 
  color: white; 
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-end;
}

.it-chat-send:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

.it-chat-send:active {
  transform: translateY(0);
}

.it-chat-send[disabled] { 
  opacity: 0.6; 
  cursor: not-allowed;
  transform: none;
}

.it-chat-send[disabled]:hover {
  background: var(--brand-color);
  transform: none;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .it-chat-btn {
    right: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
  }
  
  .it-chat-panel {
    right: 12px;
    bottom: 76px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
  }
  
  .it-chat-header,
  .it-chat-body,
  .it-chat-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .it-chat-body {
    max-height: 280px;
  }
}

/* Tablet landscape adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .it-chat-panel {
    max-height: calc(100vh - 80px);
  }
  
  .it-chat-body {
    max-height: 240px;
  }
}

/* Advanced Animation Utilities */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(29, 78, 216, 0.3); }
  50% { box-shadow: 0 0 30px rgba(29, 78, 216, 0.6); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.shimmer-effect {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Enhanced Typography */
.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Advanced Glass Morphism */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dark .glass-card {
  background: rgba(11, 18, 32, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(148, 163, 184, 0.1);
}

/* Professional Badge Component */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.status-badge:before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-color);
  animation: pulse-glow 2s infinite;
}

.status-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevation-3);
}

/* Enhanced Section Dividers */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
  margin: 4rem 0;
}

.dark .section-divider {
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
}

/* Responsive Grid Enhancements */
.masonry-grid {
  columns: 1;
  column-gap: 2rem;
}

@media (min-width: 640px) {
  .masonry-grid { columns: 2; }
}

@media (min-width: 1024px) {
  .masonry-grid { columns: 3; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 2rem;
}

/* Mobile-First Responsive Improvements */
@media (max-width: 640px) {
  /* Hero section mobile optimization */
  .hero-mobile-stack {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-mobile-stack > * {
    width: 100%;
    text-align: center;
  }
  
  /* Better mobile form layouts */
  .mobile-form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .mobile-form-stack input,
  .mobile-form-stack button {
    width: 100%;
  }
  
  /* Mobile card grid improvements */
  .mobile-card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Improved mobile spacing */
  .mobile-section-padding {
    padding: 2rem 1rem;
  }
  
  /* Mobile-friendly CTA sizing */
  .mobile-cta {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 3rem;
  }
  
  /* Better mobile newsletter form */
  .newsletter-mobile {
    flex-direction: column;
    align-items: stretch;
  }
  
  .newsletter-mobile input {
    text-align: center;
    margin-bottom: 0.75rem;
  }
}

/* Tablet improvements */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Tablet-specific optimizations */
  .tablet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tablet-hero-spacing {
    gap: 2rem;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Disable hover effects on touch devices */
  .hover-effects {
    transition: none;
  }
  
  .hover-effects:hover {
    transform: none;
  }
}

/* Enhanced mobile navigation */
@media (max-width: 768px) {
  .mobile-nav-improvements {
    padding: 1rem;
  }
  
  .mobile-nav-improvements a {
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 1rem;
  }
}

/* Improved mobile contact form */
.mobile-contact-form {
  padding: 1.5rem;
  margin: 0;
}

@media (max-width: 640px) {
  .mobile-contact-form {
    padding: 1rem;
  }
  
  .mobile-contact-form input,
  .mobile-contact-form textarea,
  .mobile-contact-form button {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }
}
