/* ════════════════════════════════════════════════════════════
   Implemental-IA — Shared Stylesheet
   ════════════════════════════════════════════════════════════ */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Variables ─── */
:root {
  --violet:       #5A4A99;
  --violet-light: #7A6AB9;
  --violet-dark:  #1E1735;
  --violet-pale:  #EDE8F5;
  --green:        #33AF7F;
  --green-light:  #55C99A;
  --green-pale:   #D0F0E4;
  --dark:         #1E1735;
  --dark-mid:     #1E1735;
  --gray-900:     #111827;
  --gray-700:     #374151;
  --gray-500:     #6B7280;
  --gray-200:     #E5E7EB;
  --gray-100:     #F3F4F6;
  --white:        #FFFFFF;
  --bg-subtle:    #FAFAFA;
  --shadow-sm:    0 1px 3px rgba(90,74,153,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 20px rgba(90,74,153,.12), 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg:    0 20px 60px rgba(90,74,153,.15), 0 8px 24px rgba(0,0,0,.1);
  --radius:       14px;
  --radius-sm:    8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-weight: 300;
  background: var(--white);
  color: var(--gray-700);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Utilities ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 100px;
  letter-spacing: .3px;
  border: 1px solid rgba(255,255,255,.25);
}
.badge svg { width: 14px; height: 14px; }

.badge-light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--violet-pale);
  color: var(--violet-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  letter-spacing: .3px;
}

.section-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--violet);
  margin-bottom: 12px;
}
.section-label-light {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--green-light);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 8px;
  margin-bottom: 16px;
}
.section-title-white {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--white);
  margin-top: 8px;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 17px;
  color: var(--gray-500);
  max-width: 580px;
  line-height: 1.7;
}
.section-sub-white {
  font-size: 17px;
  color: rgba(255,255,255,.7);
  max-width: 580px;
  line-height: 1.7;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .22s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-sm {
  font-size: 14px;
  padding: 9px 20px;
}
.btn-primary {
  background: linear-gradient(-45deg, #1E1735, #33AF7F);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(51,175,127,.35);
}
.btn-primary:hover {
  background: linear-gradient(-45deg, #111020, #28956a);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(51,175,127,.45);
}
.btn-outline {
  border-color: var(--violet);
  color: var(--violet);
  background: transparent;
}
.btn-outline:hover {
  background: var(--violet-pale);
  transform: translateY(-2px);
}
.btn-ghost {
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.9);
  background: transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.7);
  transform: translateY(-2px);
}
.btn-white {
  background: var(--white);
  color: var(--violet);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ─── NAV ─── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--dark);
  transition: background .3s, box-shadow .3s;
}
#navbar.scrolled {
  background: var(--dark);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.active {
  color: var(--green-light);
  font-weight: 700;
}
.nav-cta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: all .3s;
}

/* ─── DARK HERO (full viewport) ─── */
.hero-dark {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background: var(--dark);
}
.hero-dark-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(90,74,153,.35) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(51,175,127,.18) 0%, transparent 60%);
}
.hero-dark-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ─── PAGE HERO (~60vh) ─── */
.page-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background: var(--dark);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(90,74,153,.3) 0%, transparent 65%),
    radial-gradient(ellipse 35% 45% at 15% 75%, rgba(51,175,127,.15) 0%, transparent 60%);
}
.page-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}
.page-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.page-hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-top: 16px;
  margin-bottom: 20px;
}
.page-hero p {
  font-size: 18px;
  color: rgba(255,255,255,.72);
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto;
}

/* ─── SERVICE CARDS ─── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--violet-pale), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.service-card:hover {
  border-color: var(--violet-light);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.service-card:hover::before { opacity: 1; }
.service-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--violet-pale);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  position: relative;
  transition: background .3s;
}
.service-card:hover .service-icon { background: var(--violet); }
.service-icon svg {
  width: 26px; height: 26px;
  color: var(--violet);
  transition: color .3s;
}
.service-card:hover .service-icon svg { color: var(--white); }
.service-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
  position: relative;
}
.service-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.7;
  position: relative;
}
.service-num {
  position: absolute;
  top: 20px; right: 24px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--gray-100);
  line-height: 1;
  transition: color .3s;
  z-index: 0;
}
.service-card:hover .service-num { color: var(--violet-pale); }

/* ─── PROCESS STEPS ─── */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  width: 100%;
  margin-top: 40px;
}
.step {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 60px;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,.15);
}
.step-num {
  width: 40px; height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--green-light);
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: all .3s;
  border: 1px solid rgba(255,255,255,.2);
}
.step:hover .step-num {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}
.step-desc { font-size: 14px; color: rgba(255,255,255,.65); line-height: 1.65; }

/* Light variant steps */
.steps-light .step:not(:last-child)::after {
  background: var(--gray-200);
}
.steps-light .step-num {
  background: var(--violet-pale);
  color: var(--violet);
  border: 1px solid var(--violet-pale);
}
.steps-light .step:hover .step-num {
  background: var(--violet);
  color: var(--white);
  border-color: var(--violet);
}
.steps-light .step-title { color: var(--gray-900); }
.steps-light .step-desc { color: var(--gray-500); }

/* ─── CTA BANNER ─── */
.cta-banner { padding: 80px 0; }
.cta-inner {
  background: linear-gradient(-45deg, #1E1735, #33AF7F);
  border-radius: 24px;
  padding: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.cta-inner::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent);
  right: -100px; top: -100px;
}
.cta-inner::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51,175,127,.25), transparent);
  left: 40%; bottom: -60px;
}
.cta-text { position: relative; z-index: 1; }
.cta-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.cta-desc { font-size: 16px; color: rgba(255,255,255,.75); max-width: 440px; }
.cta-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── FOOTER ─── */
footer {
  background: var(--dark);
  color: rgba(255,255,255,.6);
  padding: 60px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo { color: var(--white); margin-bottom: 14px; }
.footer-brand p { font-size: 14px; line-height: 1.65; }
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a {
  font-size: 14px;
  color: rgba(255,255,255,.5);
  transition: color .2s;
}
.footer-col ul a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p { font-size: 13px; }
.footer-bottom .green-dot { color: var(--green-light); }

/* ─── REVEAL ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── MOBILE MENU ─── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 999;
}
.mobile-menu.open { display: block; }
.mobile-menu-panel {
  position: absolute;
  top: 0; right: 0;
  width: 280px; height: 100%;
  background: var(--dark);
  padding: 80px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-panel a {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: color .2s;
}
.mobile-menu-panel a:hover { color: var(--green-light); }
.mobile-menu-panel a.active { color: var(--green-light); font-weight: 700; }

/* ─── FORM STYLES ─── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--bg-subtle);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(90,74,153,.12);
}
.form-group textarea { min-height: 120px; }
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: #EF4444;
}
.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
  border-color: var(--green);
}
.form-submit { width: 100%; justify-content: center; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }

  .services-grid { grid-template-columns: 1fr 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }

  .cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 40px 24px;
  }
  .cta-actions { justify-content: center; }
}

@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ─── REDUCED MOTION ─── */
@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;
  }
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover,
  .btn-primary:hover,
  .btn-outline:hover,
  .btn-ghost:hover,
  .btn-white:hover {
    transform: none;
  }
}

/* ─── Nav dropdown ─── */
.nav-item { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E1735;
  border: 1px solid rgba(90,74,153,0.3);
  border-radius: 12px;
  padding: 8px;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: rgba(90,74,153,0.3);
  color: #55C99A;
}
.nav-dropdown a .dd-num {
  font-size: 11px;
  font-weight: 700;
  color: #33AF7F;
  min-width: 20px;
}
/* Arrow indicator on "Servicios" link */
.has-dropdown > a::after {
  content: '▾';
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
}

/* ─── Clickable service card arrow ─── */
.service-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.service-card-arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--violet);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s;
  position: relative;
}
.service-card-link:hover .service-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--green);
}

/* ─── CHATBOT ─── */
#chat-btn {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(-45deg, #1E1735, #33AF7F);
  box-shadow: 0 4px 20px rgba(51,175,127,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
#chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(51,175,127,0.5); }
#chat-btn svg { width: 28px; height: 28px; color: #fff; }

#chat-window {
  position: fixed; bottom: 100px; right: 28px; z-index: 9998;
  width: 360px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: none; flex-direction: column; overflow: hidden;
  font-family: 'Hanken Grotesk', sans-serif;
}
#chat-window.open { display: flex; }

#chat-header {
  background: linear-gradient(-45deg, #1E1735, #33AF7F);
  color: #fff; padding: 16px 18px;
  display: flex; align-items: center; gap: 10px;
}
#chat-header .chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
#chat-header .chat-avatar svg { width: 20px; height: 20px; }
#chat-header .chat-info { flex: 1; }
#chat-header .chat-name { font-weight: 700; font-size: 15px; }
#chat-header .chat-status { font-size: 12px; opacity: .8; }
#chat-close { background: none; border: none; cursor: pointer; color: #fff; opacity: .8; }
#chat-close:hover { opacity: 1; }

#chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 280px; max-height: 380px;
  background: #f9f9fb;
}
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg.bot { background: #fff; border: 1px solid #e5e7eb; align-self: flex-start; color: #111827; border-bottom-left-radius: 4px; }
.chat-msg.user { background: linear-gradient(-45deg, #1E1735, #33AF7F); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #33AF7F; animation: typing .9s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

#chat-input-row {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid #e5e7eb; background: #fff;
  align-items: flex-end;
}
#chat-input {
  flex: 1; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 10px 14px; font-size: 14px; outline: none;
  font-family: 'Hanken Grotesk', sans-serif;
  transition: border-color .2s;
  resize: none; min-height: 44px; max-height: 120px;
  line-height: 1.5; overflow-y: auto;
}
#chat-input:focus { border-color: #33AF7F; }
#chat-send {
  background: linear-gradient(-45deg, #1E1735, #33AF7F);
  border: none; border-radius: 50%; width: 38px; height: 38px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .15s;
}
#chat-send:hover { transform: scale(1.08); }
#chat-send svg { width: 17px; height: 17px; color: #fff; }
