/* Modern Design System for Integrar Jr. */
:root {
  /* Color Palette */
  --primary: #6366f1; /* Indigo 500 */
  --primary-dark: #4338ca; /* Indigo 700 */
  --primary-light: #818cf8; /* Indigo 400 */
  --secondary: #f43f5e; /* Rose 500 */
  --secondary-dark: #e11d48; /* Rose 600 */
  --tertiary: #0ea5e9; /* Sky 500 */
  
  /* Backgrounds */
  --bg-main: #f8fafc; /* Slate 50 */
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9; /* Slate 100 */
  --bg-dark: #0f172a; /* Slate 900 */
  
  /* Text */
  --text-main: #1e293b; /* Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  --text-light: #f8fafc;
  
  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);
  
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-surface: #1e293b;
  --bg-subtle: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.5);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
}

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

html {
  scroll-behavior: smooth;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Global Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Header & Navigation */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 5%;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
  background: transparent;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 1rem 5%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(30, 41, 59, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header.scrolled .nav-links a,
.header.scrolled .burger,
.header.scrolled .theme-toggle {
  color: var(--text-main);
}

/* Force burger to be light when menu is open, even if scrolled */
.header:has(.nav.mobile-show) .burger {
  color: #f8fafc !important;
}

/* Make logo dark when header is scrolled in light theme */
html:not([data-theme="dark"]) .header.scrolled .logo {
  filter: brightness(0.15); /* turns white logo into dark slate */
}

.logo {
  height: 48px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-light);
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

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

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

.burger {
  display: none;
  font-size: 1.75rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  z-index: 1100;
  transition: color 0.3s ease;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--primary);
}

@media (hover: hover) {
  .theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
  }
}

/* Mobile Menu */
@media (max-width: 992px) {
  .nav {
    display: none;
  }
  
  .burger {
    display: block;
  }
  
  .nav.mobile-show {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    z-index: 1050;
  }
  
  .nav.mobile-show .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 85%;
    max-width: 400px;
    gap: 1rem;
  }
  
  .nav.mobile-show .nav-links a {
    display: block;
    font-size: 1.25rem;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav.mobile-show .nav-links a::after {
    display: none;
  }

  .nav.mobile-show .nav-links li:last-child {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
  }

  .nav.mobile-show .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    margin: 0;
    font-size: 1.5rem;
  }
}

/* Main Layout */
.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Hero Section */
.section.hero-bg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 5%;
  width: 100%;
  max-width: none;
  margin: 0;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(67, 56, 202, 0.75) 100%);
  z-index: 1;
}

.hero-bg .text-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  color: var(--text-light);
}

.hero-bg h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--text-light);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-bg p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  font-weight: 300;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Buttons */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary);
}

.cta:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: white;
}

.cta-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
}

.cta-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  box-shadow: var(--shadow-lg);
}

/* Generic Section */
.section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 6rem 5%;
  gap: 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section.align-right {
  flex-direction: row-reverse;
}

.text-content {
  flex: 1 1 400px;
}

.subheading {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
}

.text-content h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.text-content p {
  margin-bottom: 2rem;
}

.image-content {
  flex: 1 1 400px;
  position: relative;
}

.image-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.image-content img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s ease;
}

.image-wrapper:hover img {
  transform: scale(1.05);
}

/* Services Section */
.services-section {
  background: var(--bg-subtle);
  padding: 6rem 5%;
  margin: 2rem 0;
  max-width: none; /* Override max-width from .section to allow full width background */
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.service-box {
  background: var(--bg-surface);
  padding: 3rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--tertiary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-box:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.service-box:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.service-box:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

[data-theme="dark"] .service-icon {
  filter: brightness(0) invert(1);
}

.service-box h4 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.service-box p {
  font-size: 1rem;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.service-box .cta {
  width: 100%;
  padding: 0.875rem;
}

/* Carousel Section */
.carousel-section {
  padding: 4rem 0;
  overflow: hidden;
  background: var(--bg-surface);
}

.scroll-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto 2rem;
  padding: 0 5%;
}

.scroll-top h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  margin: 0;
}

.scroll-controls {
  display: flex;
  gap: 0.75rem;
}

.carousel-btn {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.carousel-viewport {
  width: 100%;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  width: max-content;
  will-change: transform;
}

.carousel-track img {
  width: 300px;
  height: 200px;
  object-fit: contain;
  background-color: #ffffff; /* Force white background for all partner logos to preserve brand visibility in dark mode */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s ease;
  filter: grayscale(20%);
  padding: 1rem;
}

.carousel-track a:hover img {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  filter: grayscale(0%);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 5rem 5% 2rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--tertiary));
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 4rem;
  max-width: 1400px;
  margin: 0 auto 3rem;
}

.footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1); /* Ensure logo is visible on dark bg */
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  transition: all 0.3s ease;
  font-size: 1.25rem;
}

.footer-socials a:hover {
  background: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  font-size: 1.1rem;
  display: inline-block;
}

.footer-links a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Contact/Subpages generic styling */
.contato-section, .page-section {
  max-width: 800px;
  margin: 8rem auto 4rem;
  padding: 3rem;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.contato-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contato-form label {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: block;
}

.contato-form input,
.contato-form select,
.contato-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-main);
}

.contato-form input:focus,
.contato-form select:focus,
.contato-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--bg-surface);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .section {
    flex-direction: column !important;
    padding: 3rem 5%;
    gap: 2.5rem;
  }
  
  .text-content, .image-content {
    flex: 1 1 100%;
    width: 100%;
  }

  .hero-bg .text-content {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
  }
  
  .text-content p {
    font-size: 1.125rem;
    line-height: 1.7;
  }

  .hero-bg h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 1.2;
  }

  .hero-bg p {
    font-size: 1.125rem;
    padding: 0 0.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    padding: 0;
    width: 100%;
  }
  
  .hero-buttons .cta {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .scroll-top {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }

  .contato-section, .page-section {
    margin: 6rem 5% 4rem;
    padding: 2rem 1.5rem;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-socials {
    justify-content: center;
  }
}
