/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN SISTEMA (Modern Dark SaaS Theme)
   ========================================================================== */
:root {
  /* Color Palette - Cyber & Enterprise Dark */
  --color-bg: #0b0f19;
  --color-bg-alt: #111827;
  --color-panel: rgba(17, 24, 39, 0.75);
  --color-panel-solid: #1e293b;
  
  --color-primary: #38bdf8;         /* Cyan Cyber */
  --color-primary-glow: rgba(56, 189, 248, 0.25);
  --color-secondary: #6366f1;       /* Indigo Tech */
  --color-accent: #10b981;          /* Emerald Success */
  --color-danger: #ef4444;          /* Crimson Alert */

  /* Text & Borders */
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(56, 189, 248, 0.4);

  /* Glassmorphism Effects */
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-blur: blur(16px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-base: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4.5rem;

  /* Layout & Design Tokens */
  --radius-sm: 0.5rem;
  --radius-md: 0.85rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--color-primary-glow);
  
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-height: 4.5rem;
}

/* ==========================================================================
   RESET & REGLAS BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body.is-modal-open {
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-xs);
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 var(--space-sm);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

a:hover {
  color: #7dd3fc;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ==========================================================================
   COMPONENTES: BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.8rem 1.6rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0284c7 100%);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
  filter: brightness(1.1);
}

.btn--secondary {
  background: var(--glass-bg);
  color: var(--color-text);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--link {
  padding: 0;
  background: none;
  color: var(--color-primary);
  font-weight: 600;
}

.btn--link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

.btn--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn--loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000000;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   HEADER & NAVBAR (Glassmorphism)
   ========================================================================== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--navbar-height);
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.navbar__container {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xl);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

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

.navbar__toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.navbar__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.navbar__menu {
  display: none;
}

.navbar__menu.is-open {
  display: flex;
  position: absolute;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.navbar__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.navbar__link {
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

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

.navbar__link--button {
  padding: 0;
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ==========================================================================
   SECCIÓN HERO
   ========================================================================== */
.hero {
  position: relative;
  padding: calc(var(--navbar-height) + 2.25rem) 0 var(--space-xl);
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 992px) {
  .hero__container {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: var(--space-md);
  padding: 0.4rem 1.1rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
}

.hero__title {
  font-size: var(--fs-2xl);
  line-height: 1.15;
  margin-bottom: var(--space-md);
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__text {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: var(--space-lg);
}

.hero__title-accent {
  -webkit-text-fill-color: var(--color-primary);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  justify-content: center;
}


/* ==========================================================================
   SECCIÓN: MOCKUP DE FLUJO DE IA (HERO)
   ========================================================================== */
.mock-window {
  background: var(--color-bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8),
              0 0 30px rgba(16, 185, 129, 0.12);
}

.mock-window__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.mock-window__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mock-window__dot--red { background-color: #ef4444; }
.mock-window__dot--yellow { background-color: #f59e0b; }
.mock-window__dot--green { background-color: var(--color-accent); }

.mock-window__title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: monospace;
  margin-left: auto;
}

.mock-window__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 576px) {
  .mock-window__body {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mock-card {
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.mock-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
}

.mock-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.mock-card__icon {
  font-size: 0.9rem;
}

.mock-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.mock-card__sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.mock-card__bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.mock-card__progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #34d399);
  border-radius: 3px;
}

/* ==========================================================================
   SECCIÓN SERVICIOS (Grilla de 6 Cards)
   ========================================================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header__title {
  font-size: var(--fs-2xl);
}

.section-header__text {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
}

.services {
  padding: var(--space-xl) 0;
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.card {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  background: var(--glass-bg);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--color-border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.card__icon {
  font-size: 2.25rem;
  margin-bottom: var(--space-sm);
  display: inline-block;
}

.card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-xs);
}

.card__text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: var(--space-md);
}

.card__action {
  align-self: flex-start;
}

/* ==========================================================================
   SECCIÓN TRANSPARENCIA / GOBERNANZA
   ========================================================================== */
.transparency {
  padding: var(--space-xl) 0;
  background-color: rgba(15, 23, 42, 0.5);
  border-top: 1px solid var(--color-border);
}

.transparency__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.transparency__item {
  padding: var(--space-md);
  background: var(--color-panel-solid);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.transparency__item h4 {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.transparency__item p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ==========================================================================
   CTA (Call To Action)
   ========================================================================== */
.cta {
  padding: var(--space-xl) 0;
}

.cta__content {
  text-align: center;
  max-width: 750px;
  margin-inline: auto;
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
}

.cta__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-xs);
}

.cta__text {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: #070a12;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xl);
  color: #ffffff;
  font-weight: 800;
}

.footer__title {
  color: #ffffff;
  font-size: var(--fs-base);
  margin-bottom: var(--space-xs);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__list a {
  color: var(--color-text-muted);
}

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

.footer__bottom {
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--fs-xs);
}

/* ==========================================================================
   MODAL & FORMULARIOS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  background-color: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal[hidden] {
  display: none;
}

.modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-lg);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal.is-visible .modal__dialog {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.modal__close:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.modal__title {
  margin-bottom: var(--space-md);
  font-size: var(--fs-xl);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text);
}

.form__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: #ffffff;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

.form__password {
  position: relative;
}

.form__password .form__input {
  padding-right: 4.5rem;
}

.form__toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  padding: 0.25rem 0.5rem;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: none;
  border: 0;
  cursor: pointer;
}

.modal__dialog--wide {
  max-width: 640px;
}

.case-study__intro {
  color: var(--color-text-muted);
}

.case-study__compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.case-study__col {
  padding: var(--space-sm);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.case-study__col--after {
  border-color: rgba(16, 185, 129, 0.3);
}

.case-study__col h3 {
  font-size: var(--fs-base);
}

.case-study__col p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.case-study__steps {
  display: grid;
  gap: var(--space-xs);
  padding-left: 1.25rem;
  margin-bottom: var(--space-sm);
  list-style: decimal;
  color: var(--color-text-muted);
}

.case-study__closing {
  font-weight: 600;
  color: var(--color-text);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.form__group--full {
  grid-column: 1 / -1;
}


/* ==========================================================================
   MEDIA QUERIES (Responsividad)
   ========================================================================== */
@media (min-width: 640px) {
  .hero__title {
    font-size: var(--fs-3xl);
  }

  .hero__actions {
    flex-direction: row;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .transparency__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .navbar__menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    padding: 0;
    background: none;
    border-bottom: 0;
  }

  .navbar__list {
    flex-direction: row;
    gap: var(--space-md);
  }
}

@media (min-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}