/*
 * Commis Landing — Design Tokens & Component Primitives
 * Source: commis_landing_vs_code_resources/commis-landing.tokens.css
 * Used by: cms/views/pages/dynamic/custom/home/home.php (public landing, /ingresar route excluded)
 * NOTE: Do NOT import Google Fonts here — home.php imports them directly via <link>.
 */

:root {
  --commis-midnight: #10122A;
  --commis-primary: #405CCA;
  --commis-primary-dark: #2342B1;
  --commis-lime: #60B860;
  --commis-indigo-white: #F0F4FF;
  --commis-bg: #F8F9FF;
  --commis-surface: #FFFFFF;
  --commis-border: #E6E9F2;
  --commis-text: #0F172A;
  --commis-muted: #64748B;
  --commis-warning: #F59E0B;
  --commis-error: #EF4444;
  --commis-info: #3B82F6;
  --commis-shadow-sm: 0 2px 12px rgba(16, 24, 40, 0.06);
  --commis-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --commis-shadow-lg: 0 18px 55px rgba(16, 24, 40, 0.10);
  --commis-radius-sm: 8px;
  --commis-radius-md: 12px;
  --commis-radius-lg: 16px;
  --commis-radius-xl: 22px;
  --commis-container: 1180px;
  --commis-gutter-desktop: 32px;
  --commis-gutter-tablet: 20px;
  --commis-gutter-mobile: 16px;
  --commis-font-body: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --commis-font-display: "DM Serif Display", Georgia, serif;
}

/* ===== BASE ===== */
.commis-landing {
  font-family: var(--commis-font-body);
  color: var(--commis-text);
  background: linear-gradient(180deg, #fff 0%, var(--commis-bg) 100%);
  overflow-x: hidden;
}

/* ===== BRAND SUBTITLE ===== */
.commis-brand-subtitle {
  display: block;
  color: var(--commis-primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}

/* ===== PROGRESS BAR ===== */
.commis-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--commis-primary), var(--commis-lime));
  z-index: 9999;
}

/* ===== GLOW ===== */
.commis-glow {
  position: fixed;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(64, 92, 202, 0.12), transparent 70%);
  pointer-events: none;
  translate: -50% -50%;
  z-index: 0;
}

/* ===== HEADER ===== */
.commis-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(230, 233, 242, 0.85);
  transition: box-shadow 220ms ease, background 220ms ease;
}

.commis-header.is-scrolled {
  box-shadow: var(--commis-shadow-sm);
  background: rgba(255, 255, 255, 0.92);
}

/* ===== CONTAINER ===== */
.commis-container {
  width: min(var(--commis-container), calc(100% - 64px));
  margin-inline: auto;
}

/* ===== BUTTONS ===== */
.commis-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: var(--commis-radius-md);
  border: 1px solid transparent;
  font-family: var(--commis-font-body);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.commis-btn-primary {
  background: linear-gradient(135deg, #1745ff, var(--commis-primary));
  color: #fff;
  box-shadow: 0 12px 28px rgba(64, 92, 202, 0.25);
}

.commis-btn-secondary {
  background: #fff;
  color: var(--commis-midnight);
  border-color: #d4d9ea;
  box-shadow: var(--commis-shadow-sm);
}

.commis-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--commis-shadow-lg);
}

/* ===== REVEAL ANIMATION ===== */
.commis-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.commis-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ORBITAL ===== */
.commis-orbit {
  position: absolute;
  border: 1px solid rgba(64, 92, 202, 0.22);
  border-radius: 50%;
  animation: commisRotate 28s linear infinite;
}

.commis-orbit.reverse {
  animation-direction: reverse;
  animation-duration: 38s;
}

@keyframes commisRotate {
  to { transform: rotate(360deg); }
}

/* ===== FLOAT ===== */
.commis-float {
  animation: commisFloat 5s ease-in-out infinite;
}

@keyframes commisFloat {
  50% { translate: 0 -12px; }
}

/* ===== CENTER NODE BREATH ===== */
.commis-center-node {
  animation: commisBreath 3.5s ease-in-out infinite;
}

@keyframes commisBreath {
  50% { transform: translate(-50%, -50%) scale(1.04); }
}

/* ===== MODULE CARDS ===== */
.commis-module-card {
  background: #fff;
  border: 1px solid var(--commis-border);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(16, 24, 40, 0.035);
  transition: transform 220ms ease, box-shadow 220ms ease;
  position: relative;
  overflow: hidden;
}

.commis-module-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  background: var(--module-color, var(--commis-primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.commis-module-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--commis-shadow-lg);
}

.commis-module-card:hover::after {
  transform: scaleX(1);
}

/* ===== DASHBOARD 3D ===== */
.commis-dashboard {
  transition: transform 160ms ease, box-shadow 220ms ease;
  transform-style: preserve-3d;
}

/* ===== CHART LINE ===== */
.commis-chart-line {
  stroke: #1745ff;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: commisDrawLine 2300ms ease forwards;
}

@keyframes commisDrawLine {
  to { stroke-dashoffset: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .commis-container {
    width: min(100% - 40px, var(--commis-container));
  }

  .commis-desktop-nav {
    display: none;
  }

  .commis-hero-grid,
  .commis-dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .commis-modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .commis-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .commis-container {
    width: min(100% - 32px, var(--commis-container));
  }

  .commis-modules-grid,
  .commis-logos-grid {
    grid-template-columns: 1fr !important;
  }

  .commis-hero-title {
    font-size: 44px !important;
  }

  .commis-btn {
    width: 100%;
  }

  .commis-dashboard-sidebar {
    display: none;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .commis-glow {
    display: none;
  }

  .commis-reveal {
    opacity: 1;
    transform: none;
  }
}
