:root {
  --bg-main: #0B0719;
  --bg-card: #150E2D;
  --bg-soft: #1A1238;
  --text-main: #F4F2FA;
  --text-muted: #A39BBF;
  --border-line: #2D2254;
  
  --purple-vivid: #8B5CF6;
  --magenta-vivid: #EC4899;
  --cyan-vivid: #06B6D4;
  --green-vivid: #10B981;
  
  --topbar-bg: #150A33;
  --nav-bg: rgba(11, 7, 25, 0.88);
}

[data-bs-theme="light"] {
  --bg-main: #F4F3FA;
  --bg-card: #FFFFFF;
  --bg-soft: #EAE6F8;
  --text-main: #1C1535;
  --text-muted: #5E5382;
  --border-line: #D1C9EC;
  
  --purple-vivid: #6D28D9;
  --magenta-vivid: #BE185D;
  --cyan-vivid: #0369A1;
  --green-vivid: #047857;
  
  --topbar-bg: #311A6B;
  --nav-bg: rgba(244, 243, 250, 0.92);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  overflow-x: hidden;
  isolation: isolate;
  transition: background-color 0.3s ease, color 0.3s ease;
}
[data-bs-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 44% 38% at 24% 20%, rgba(139, 92, 246, 0.21), transparent 76%),
    radial-gradient(ellipse 38% 40% at 80% 42%, rgba(6, 182, 212, 0.15), transparent 76%),
    radial-gradient(ellipse 46% 34% at 54% 86%, rgba(236, 72, 153, 0.15), transparent 78%),
    radial-gradient(ellipse 38% 32% at 56% 16%, rgba(236, 72, 153, 0.11), transparent 78%),
    radial-gradient(ellipse 34% 32% at 18% 72%, rgba(16, 185, 129, 0.08), transparent 76%);
  filter: blur(48px);
  opacity: 0.86;
  animation: ambient-light-drift 22s ease-in-out infinite alternate;
}
@keyframes ambient-light-drift {
  0% { transform: translate3d(-3%, -1.5%, 0) scale(0.98); opacity: 0.76; }
  45% { transform: translate3d(1%, 1.5%, 0) scale(1.02); opacity: 0.94; }
  100% { transform: translate3d(3%, -1%, 0) scale(1.04); opacity: 0.8; }
}

.py-6 { padding: 96px 0; }
.soft { background-color: var(--bg-soft); }
.muted { color: var(--text-muted); font-size: 0.9rem; }
.light-gray { color: var(--text-muted); }

.h-display {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 1.2rem;
}
.glow-text {
  background: linear-gradient(135deg, var(--magenta-vivid), var(--purple-vivid), var(--cyan-vivid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.h-sec {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 1.8rem;
}

.topbar {
  display: block; text-align: center; background: var(--topbar-bg);
  color: #fff; font-size: 0.88rem; font-weight: 600; padding: 9px 12px; text-decoration: none;
}
.topbar:hover { color: var(--cyan-vivid); }
.navbar {
  background: var(--nav-bg); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-line); padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text-main); text-decoration: none; }
.brand b { color: var(--purple-vivid); }
.logo-img { height: 38px; width: auto; display: block; }
.logo-light { display: none; }
[data-bs-theme="light"] .logo-dark { display: none; }
[data-bs-theme="light"] .logo-light { display: block; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple-vivid), var(--magenta-vivid));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.navbar .nav-link { color: var(--text-main); font-weight: 600; font-size: 0.95rem; }
.navbar .nav-link:hover { color: var(--purple-vivid); }
.navbar .ts-dd {
  display: block;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms;
}
.navbar .dropdown.show > .ts-dd {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s;
}
@media (hover: hover) and (min-width: 992px) {
  .navbar .dropdown:hover > .ts-dd {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 300ms ease, transform 300ms ease, visibility 0s;
  }
}
.navbar .ts-dd .dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-block: 0.45rem;
  line-height: 1.2;
}
.navbar .ts-dd .dropdown-item small { display: block; line-height: 1.2; }

.theme-toggle-btn {
  background: var(--bg-soft); border: 1px solid var(--border-line);
  color: var(--text-main); width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer; transition: 0.2s;
}
.theme-toggle-btn:hover { border-color: var(--purple-vivid); color: var(--purple-vivid); }
[data-bs-theme="dark"] .sun-icon { display: block; }
[data-bs-theme="dark"] .moon-icon { display: none; }
[data-bs-theme="light"] .sun-icon { display: none; }
[data-bs-theme="light"] .moon-icon { display: block; }

.btn-ts {
  background: linear-gradient(135deg, var(--purple-vivid), var(--magenta-vivid));
  color: #fff; border-radius: 999px; padding: 12px 26px; font-weight: 700; border: 0;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3); transition: 0.25s;
}
.btn-ts:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4); color: #fff; }
.btn-ghost { border: 1px solid var(--border-line); border-radius: 999px; padding: 11px 24px; font-weight: 600; color: var(--text-main); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text-main); }

.hero { position: relative; padding: 110px 0 90px; background: transparent; }
.badge-vivid {
  display: inline-block; padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 0.82rem;
  background: rgba(16, 185, 129, 0.15); border: 1px solid var(--green-vivid); color: var(--green-vivid);
}
.hero-form {
  display: flex; gap: 8px; max-width: 530px; margin: 0 auto 16px;
  background: var(--bg-card); border: 1px solid var(--border-line);
  border-radius: 999px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.hero-form input { flex: 1; border: 0; outline: 0; padding: 0 20px; background: transparent; color: var(--text-main); }
.tiny { font-size: 0.85rem; color: var(--text-muted); }

/* TARJETAS DE HERRAMIENTAS CON LOGOS OFICIALES */
.tool-card {
  display: flex; flex-direction: column; height: 100%; padding: 32px;
  background: var(--bg-card); border: 1px solid var(--border-line); border-radius: 24px;
  text-decoration: none; color: var(--text-main); transition: all 0.3s ease;
}
.tool-card:hover {
  transform: translateY(-6px); border-color: var(--purple-vivid);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2); color: var(--text-main);
}
.tool-brand-header {
  padding: 16px; background: #F4F3FA; border-radius: 16px;
  border: 1px solid var(--border-line); display: flex; align-items: center; justify-content: center; min-height: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.tool-logo-img { max-height: 100px; max-width: 100%; width: auto; object-fit: contain; transition: transform 0.3s ease; }
.tool-card:hover .tool-logo-img { transform: scale(1.05); }
.tool-desc { color: var(--text-muted); font-size: 0.98rem; line-height: 1.6; margin-bottom: 20px; }
.tool-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--purple-vivid); }
.tool-card:hover .tool-footer { color: var(--magenta-vivid); }

.fcard, .fw, .rec, .tabbox, .tc, .stat-box, .val-card {
  background: var(--bg-card); border: 1px solid var(--border-line);
  border-radius: 22px; transition: 0.3s; color: var(--text-main); text-decoration: none;
}
.tc { overflow: hidden; }
.tabbox { padding: 40px; }
.fcard { display: flex; flex-direction: column; height: 100%; padding: 28px; }
.fcard:hover, .fw:hover, .rec:hover { transform: translateY(-6px); border-color: var(--purple-vivid); box-shadow: 0 20px 40px rgba(115, 83, 186, 0.15); }
.fcard h3 { font-size: 1.25rem; font-weight: 700; }
.fcard p { color: var(--text-muted); font-size: 0.95rem; }

.mock { margin-top: auto; padding: 16px; border-radius: 16px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 10px; font-size: 0.82rem; }
.ring {
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(var(--purple-vivid) calc(var(--p)*1%), var(--border-line) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.ring::after { content: ""; position: absolute; inset: 9px; background: var(--bg-soft); border-radius: 50%; }
.ring b { position: relative; z-index: 1; font-size: 0.95rem; }

.mbar { flex: 1; height: 8px; border-radius: 4px; background: var(--border-line); overflow: hidden; }
.mbar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--purple-vivid), var(--magenta-vivid)); }
.mbar.g i { background: linear-gradient(90deg, var(--cyan-vivid), var(--green-vivid)); }

.val-card { padding: 20px; text-align: left; font-size: 0.9rem; color: var(--text-muted); }
.val-card b { display: block; color: var(--text-main); font-size: 1.05rem; margin-bottom: 4px; }

.fw { padding: 24px; }
.fw i { font-size: 1.8rem; color: var(--purple-vivid); display: block; margin-bottom: 10px; }
.fw b { display: block; font-size: 1.05rem; }
.fw small { color: var(--text-muted); }

.seg { height: 100%; padding: 36px 30px; border-radius: 28px; color: #fff; }
.s1 { background: linear-gradient(145deg, #3B0764, #7C3AED); }
.s2 { background: linear-gradient(145deg, #831843, #DB2777); }
.s3 { background: linear-gradient(145deg, #064E3B, #059669); }
.seg a { color: #fff; font-weight: 700; text-decoration: none; }

.bigq { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.3; margin-bottom: 20px; }
.bigq { cursor: pointer; user-select: none; -webkit-user-select: none; }
.bigq:focus-visible { outline: 2px solid var(--cyan-vivid); outline-offset: 8px; border-radius: 4px; }
.carousel-fade .carousel-item { transition: opacity 450ms ease-in-out; }
.carousel-fade .carousel-item.active.carousel-item-start,
.carousel-fade .carousel-item.active.carousel-item-end { transition: opacity 450ms ease-in-out; }
.who { color: var(--text-muted); }
.testimonial-progress {
  width: min(100%, 360px);
  height: 4px;
  margin: 30px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-line);
}
.testimonial-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--cyan-vivid), var(--purple-vivid), var(--magenta-vivid));
  will-change: transform;
}

.accordion-item { border: 1px solid var(--border-line) !important; background: var(--bg-card) !important; border-radius: 16px !important; margin-bottom: 12px; overflow: hidden; }
.accordion-button { background: var(--bg-card) !important; color: var(--text-main) !important; font-weight: 600; }
.accordion-button:not(.collapsed) { background: var(--bg-soft) !important; color: var(--purple-vivid) !important; }
.workflow-progress {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-line);
}
.workflow-progress .progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-vivid), var(--purple-vivid), var(--magenta-vivid));
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ts-modal { background: var(--bg-card); color: var(--text-main); border-radius: 24px; border: 1px solid var(--border-line); }
.cta { padding: 100px 0; background: linear-gradient(135deg, #311A6B, #7C3AED, #047857); }
.cta .light-gray { color: var(--text-main); }
footer { background: #070410; color: #fff; padding: 64px 0 30px; }
footer h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
footer a:not(.brand) { display: block; color: #A39BBF; text-decoration: none; margin-bottom: 8px; }
footer a:hover { color: var(--cyan-vivid); }
footer .cr-stripe { margin-bottom: 48px; }
[data-bs-theme="light"] .cta {
  background: linear-gradient(135deg, #E9E6F5, #F8E8F0 52%, #DDF1EA);
}
[data-bs-theme="light"] .cta .text-white { color: var(--text-main) !important; }
[data-bs-theme="light"] footer {
  background: var(--bg-soft);
  color: var(--text-main);
  border-top: 1px solid var(--border-line);
}
[data-bs-theme="light"] footer .brand.text-white { color: var(--text-main) !important; }
[data-bs-theme="light"] footer a:not(.brand) { color: var(--text-muted); }

html.js .reveal { opacity: 0; transition: opacity 0.5s ease; }
html.js .reveal.active { opacity: 1; }

section.navigation-arrival > .container {
  animation: section-arrival 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero > .container.page-arrival {
  animation: section-arrival 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes section-arrival {
  from { opacity: 0.25; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-bs-theme="dark"] body::before { animation: none; }
  section.navigation-arrival > .container,
  .hero > .container.page-arrival {
    animation: section-arrival-reduced 1000ms ease-out both;
  }
}
@keyframes section-arrival-reduced {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

/* ===== SELECTOR DE IDIOMA ES / EN ===== */
.lang-switch {
  display: flex; border: 1px solid var(--border-line); border-radius: 999px;
  background: var(--bg-soft); padding: 3px; flex-shrink: 0;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: 0.8rem; line-height: 1; padding: 8px 11px;
  border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.lang-switch button:hover { color: var(--text-main); }
.lang-switch button.active {
  background: linear-gradient(135deg, var(--purple-vivid), var(--magenta-vivid)); color: #fff;
}
@media (max-width: 576px) {
  .navbar .btn-ts { padding: 8px 14px; font-size: 0.85rem; }
  .navbar .d-flex.gap-2 { gap: 6px !important; }
  .tabbox { padding: 24px; }
  .hero-form { flex-direction: column; align-items: stretch; border-radius: 20px; }
  .hero-form input { min-width: 0; min-height: 44px; }
}