/* Header no sticky en este prototipo: puede salir de vista al bajar */
html.cx-proto-contact .header-area.is-sticky,
html.cx-proto-contact .header-area .is-sticky,
html.cx-proto-contact .header-bottom-wrap.is-sticky,
html.cx-proto-contact .header-area.is-sticky .header-bottom-wrap {
  position: relative !important;
  top: auto !important;
}

.cx-contact {
  --cx-deep: #020B24;
  --cx-dark: #061B49;
  --cx-corp: #082B69;
  --cx-electric: #087BFF;
  --cx-sky: #62C7FF;
  --cx-icon: #0a3d8f;
  --cx-text: rgba(210, 225, 255, 0.86);
  --cx-muted: rgba(170, 195, 230, 0.72);
  position: relative;
  isolation: isolate;
  color: #fff;
  padding: clamp(3.5rem, 8vh, 6rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  overflow: hidden;
  background: var(--cx-deep);
  min-height: calc(100vh - 2rem);
}

.cx-contact__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 8% 38%, rgba(8, 123, 255, 0.16) 0%, transparent 58%),
    radial-gradient(ellipse 62% 48% at 92% 68%, rgba(21, 157, 255, 0.1) 0%, transparent 55%),
    linear-gradient(180deg, #020B24 0%, #041638 52%, #06245A 100%);
  pointer-events: none;
}

.cx-contact__orbits {
  position: absolute;
  inset: -6% -4%;
  width: 108%;
  height: 112%;
  display: block;
  overflow: visible;
}

.cx-bg-ambient {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
}

.cx-bg-ambient--l {
  animation: cxAmbientDrift 36s ease-in-out infinite alternate;
}

.cx-bg-ambient--r {
  animation: cxAmbientDrift 44s ease-in-out infinite alternate-reverse;
}

.cx-bg-dots {
  animation: cxDotsPulse 18s ease-in-out infinite;
}

.cx-bg-layer {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.cx-bg-layer--secondary {
  animation: cxOrbitFloatC 40s ease-in-out infinite alternate;
}

.cx-bg-layer--left {
  transform-origin: 12% 42%;
  animation: cxOrbitFloatA 32s ease-in-out infinite alternate;
}

.cx-bg-layer--top {
  transform-origin: 62% 18%;
  animation: cxOrbitFloatB 38s ease-in-out infinite alternate;
}

.cx-bg-layer--right {
  transform-origin: 88% 55%;
  animation: cxOrbitFloatC 28s ease-in-out infinite alternate;
}

.cx-bg-pulse {
  stroke-dasharray: 70 930;
  stroke-dashoffset: 0;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(101, 213, 255, 0.55));
}

.cx-bg-pulse--a { animation: cxPulseTravel 11s linear infinite; }
.cx-bg-pulse--b { animation: cxPulseTravel 14s linear infinite reverse; }
.cx-bg-pulse--c { animation: cxPulseTravel 12.5s linear 1.8s infinite; }

@keyframes cxOrbitFloatA {
  from { transform: translate(-10px, 6px) scale(1) rotate(-1.2deg); }
  to { transform: translate(14px, -10px) scale(1.03) rotate(1.4deg); }
}

@keyframes cxOrbitFloatB {
  from { transform: translate(8px, -8px) scale(1.02) rotate(0.8deg); }
  to { transform: translate(-12px, 10px) scale(0.98) rotate(-1deg); }
}

@keyframes cxOrbitFloatC {
  from { transform: translate(6px, 10px) scale(1) rotate(1deg); }
  to { transform: translate(-10px, -8px) scale(1.04) rotate(-0.8deg); }
}

@keyframes cxAmbientDrift {
  from { transform: translate(0, 0) scale(1); opacity: 0.85; }
  to { transform: translate(18px, -12px) scale(1.06); opacity: 1; }
}

@keyframes cxDotsPulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.5; }
}

@keyframes cxPulseTravel {
  to { stroke-dashoffset: -1000; }
}

.cx-contact__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
}

/* —— Intro —— */
.cx-contact__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cx-sky);
}

.cx-contact__title {
  margin: 0 0 1.1rem;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
}

.cx-contact__lead {
  margin: 0 0 1rem;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  color: var(--cx-text);
  max-width: 34rem;
}

.cx-contact__lead span {
  color: var(--cx-sky);
  font-weight: 600;
}

.cx-contact__note {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--cx-muted);
}

/* —— Services glass —— */
.cx-services {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.15rem 1.15rem;
  border-radius: 22px;
  background:
    linear-gradient(165deg, rgba(9, 38, 87, 0.82) 0%, rgba(5, 22, 56, 0.75) 46%, rgba(4, 22, 52, 0.78) 100%);
  border: 1px solid rgba(95, 160, 255, 0.2);
  box-shadow:
    0 18px 40px rgba(0, 8, 30, 0.28),
    0 0 28px rgba(8, 123, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cx-services__header {
  margin-bottom: 1rem;
  padding: 0 0.15rem;
}

.cx-services__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(98, 199, 255, 0.85);
}

.cx-services__title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #fff;
}

.cx-services__title span {
  display: block;
  color: var(--cx-sky);
}

.cx-services__viewport {
  position: relative;
  height: 14.5rem;
  overflow: hidden;
  outline: none;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
}

.cx-services__viewport:focus-visible {
  box-shadow: 0 0 0 2px rgba(98, 199, 255, 0.45);
  border-radius: 0.75rem;
}

.cx-services__track {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.cx-services__viewport.is-manual {
  overflow-y: auto;
  overflow-x: hidden;
  cursor: grab;
  overscroll-behavior: contain;
  mask-image: none;
  -webkit-mask-image: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 199, 255, 0.28) transparent;
}

.cx-services__viewport.is-manual:active {
  cursor: grabbing;
}

.cx-services__viewport.is-manual::-webkit-scrollbar {
  width: 5px;
}

.cx-services__viewport.is-manual::-webkit-scrollbar-track {
  background: transparent;
}

.cx-services__viewport.is-manual::-webkit-scrollbar-thumb {
  background: rgba(98, 199, 255, 0.28);
  border-radius: 999px;
}

.cx-services__viewport.is-manual::-webkit-scrollbar-thumb:hover {
  background: rgba(98, 199, 255, 0.45);
}

.cx-services__viewport.is-manual .cx-services__track {
  transform: none !important;
}

.cx-services.is-reduced .cx-services__viewport {
  height: auto;
  overflow: visible;
  mask-image: none;
  -webkit-mask-image: none;
}

.cx-services.is-reduced .cx-services__track {
  transform: none;
}

.cx-service-card {
  --cx-icon-from: #063B95;
  --cx-icon-to: #041F5C;
  --cx-icon-glow: rgba(6, 59, 149, 0.45);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 5.75rem;
  height: 5.75rem;
  margin: 0;
  padding: 11px 15px;
  border-radius: 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0A2450 0%, #061638 100%);
  border: 1px solid rgba(95, 160, 255, 0.16);
  box-shadow:
    0 10px 22px rgba(0, 8, 30, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease,
    background 250ms ease;
}

.cx-service-card:hover,
.cx-service-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(140, 195, 255, 0.38);
  box-shadow:
    0 14px 26px rgba(0, 8, 30, 0.28),
    0 0 18px rgba(8, 123, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cx-service-card:hover .cx-service-card__icon,
.cx-service-card:focus-within .cx-service-card__icon {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 18px var(--cx-icon-glow),
    0 0 22px var(--cx-icon-glow);
}

.cx-service-card__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 36, 80, 0.9) 0%, rgba(4, 16, 40, 0.95) 100%);
  border: 1px solid rgba(95, 160, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cx-service-card__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  color: #eaf6ff;
  background: linear-gradient(145deg, var(--cx-icon-from) 0%, var(--cx-icon-to) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 1px rgba(8, 123, 255, 0.08),
    0 6px 16px var(--cx-icon-glow);
  transition: box-shadow 250ms ease;
}

.cx-service-card__icon::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 42%);
  pointer-events: none;
}

.cx-service-card__icon i {
  position: relative;
  z-index: 1;
}

.cx-service-card__body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.cx-service-card__title {
  margin: 0 0 0.2rem;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cx-service-card__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #A9BCD9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* —— Form panel + luminous border —— */
.cx-contact__panel-wrap {
  position: relative;
}

.cx-contact__panel {
  position: relative;
  padding: clamp(1.35rem, 2.4vw, 1.85rem);
  border-radius: 1.25rem;
  background: rgba(6, 27, 73, 0.88);
  border: 1px solid rgba(98, 199, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(8, 123, 255, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(8, 123, 255, 0.22),
    0 0 44px rgba(98, 199, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  isolation: isolate;
  animation: cxFormBreathe 3.8s ease-in-out infinite;
}

.cx-contact__panel-glow {
  position: absolute;
  inset: -42%;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(8, 123, 255, 0.15) 0%,
    rgba(98, 199, 255, 0.55) 8%,
    rgba(8, 123, 255, 0.95) 14%,
    rgba(98, 199, 255, 0.35) 22%,
    transparent 32%,
    transparent 68%,
    rgba(98, 199, 255, 0.2) 78%,
    rgba(8, 123, 255, 0.7) 86%,
    rgba(98, 199, 255, 0.4) 94%,
    rgba(8, 123, 255, 0.15) 100%
  );
  pointer-events: none;
  animation:
    cxFormGlowSpin 7s linear infinite,
    cxFormGlowBreathe 3.8s ease-in-out infinite;
  will-change: transform, opacity;
  opacity: 0.78;
}

.cx-contact__panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(98, 199, 255, 0.45),
    0 0 18px rgba(8, 123, 255, 0.45),
    0 0 36px rgba(98, 199, 255, 0.25);
  animation: cxFormRingBreathe 3.8s ease-in-out infinite;
}

.cx-contact__panel::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: 0;
  border-radius: calc(1.25rem - 1px);
  background: rgba(6, 27, 73, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

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

@keyframes cxFormGlowBreathe {
  0%, 100% { opacity: 0.68; }
  50% { opacity: 1; }
}

@keyframes cxFormBreathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(8, 123, 255, 0.12),
      0 24px 60px rgba(0, 0, 0, 0.32),
      0 0 18px rgba(8, 123, 255, 0.18),
      0 0 36px rgba(98, 199, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(8, 123, 255, 0.32),
      0 24px 60px rgba(0, 0, 0, 0.32),
      0 0 42px rgba(8, 123, 255, 0.55),
      0 0 86px rgba(98, 199, 255, 0.34);
  }
}

@keyframes cxFormRingBreathe {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(98, 199, 255, 0.32),
      0 0 14px rgba(8, 123, 255, 0.28),
      0 0 28px rgba(98, 199, 255, 0.16);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(98, 199, 255, 0.7),
      0 0 28px rgba(8, 123, 255, 0.65),
      0 0 56px rgba(98, 199, 255, 0.38);
  }
}

.cx-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.cx-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.cx-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.cx-form__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(180, 210, 255, 0.78);
}

.cx-form__input,
.cx-form__select,
.cx-form__textarea {
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(126, 200, 255, 0.22);
  background: rgba(2, 11, 36, 0.72);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cx-form__input::placeholder,
.cx-form__textarea::placeholder {
  color: #fff;
  opacity: 1;
}

.cx-form__input::-webkit-input-placeholder,
.cx-form__textarea::-webkit-input-placeholder {
  color: #fff;
  opacity: 1;
}

.cx-form__input::-moz-placeholder,
.cx-form__textarea::-moz-placeholder {
  color: #fff;
  opacity: 1;
}

.cx-form__select:invalid {
  color: #fff;
}

.cx-form__input:focus,
.cx-form__select:focus,
.cx-form__textarea:focus {
  border-color: rgba(98, 199, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(8, 123, 255, 0.18);
  background: rgba(2, 11, 36, 0.92);
}

.cx-form__textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.cx-form__select-wrap {
  position: relative;
}

.cx-form__select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.cx-form__select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--cx-sky);
  border-bottom: 2px solid var(--cx-sky);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.cx-form__select option {
  color: #02174a;
  background: #fff;
}

.cx-form__hint {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: rgba(170, 195, 230, 0.65);
}

.cx-form__alert {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.cx-form__alert--error {
  color: #ffd4d4;
  background: rgba(180, 40, 60, 0.28);
  border: 1px solid rgba(255, 120, 140, 0.35);
}

.cx-form__alert--success {
  color: #d4ffe8;
  background: rgba(20, 140, 90, 0.28);
  border: 1px solid rgba(80, 220, 150, 0.35);
}

.cx-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  align-self: flex-start;
  margin-top: 0.35rem;
  min-height: 3.1rem;
  padding: 0.85rem 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 200, 255, 0.28);
  background: var(--cx-icon);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(2, 181, 255, 0.12),
    0 8px 22px rgba(8, 106, 216, 0.45),
    0 0 28px rgba(2, 181, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cx-form__submit:hover,
.cx-form__submit:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(126, 200, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(2, 181, 255, 0.18),
    0 12px 28px rgba(8, 106, 216, 0.55),
    0 0 36px rgba(2, 181, 255, 0.45);
  outline: none;
}

.cx-form__submit i {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.cx-form__submit:hover i,
.cx-form__submit:focus-visible i {
  transform: translateX(3px);
}

/* —— Entrance —— */
[data-cx-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

[data-cx-reveal="intro"] { transition-delay: 0.05s; }
[data-cx-reveal="services"] { transition-delay: 0.22s; }
[data-cx-reveal="form"] { transition-delay: 0.18s; }

.cx-contact.is-inview [data-cx-reveal] {
  opacity: 1;
  transform: translateY(0);
}

/* —— Responsive —— */
@media (max-width: 991.98px) {
  .cx-contact__inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-items: start;
  }

  .cx-contact__lead {
    max-width: none;
  }

  .cx-services__viewport {
    height: 13rem;
  }
}

@media (max-width: 575.98px) {
  .cx-form__row {
    grid-template-columns: 1fr;
  }

  .cx-form__submit {
    width: 100%;
  }

  .cx-services__viewport {
    height: 11rem;
  }

  .cx-contact__orbits {
    opacity: 0.78;
  }

  .cx-bg-pulse {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cx-bg-layer,
  .cx-bg-pulse,
  .cx-bg-ambient,
  .cx-bg-dots {
    animation: none !important;
  }

  .cx-contact__panel,
  .cx-contact__panel::before,
  .cx-contact__panel-glow {
    animation: none !important;
  }

  .cx-contact__panel-glow {
    opacity: 1;
    background: radial-gradient(
      circle at 70% 20%,
      rgba(98, 199, 255, 0.55) 0%,
      rgba(8, 123, 255, 0.25) 35%,
      transparent 60%
    );
  }

  [data-cx-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cx-service-card:hover,
  .cx-service-card:focus-within,
  .cx-form__submit:hover,
  .cx-form__submit:focus-visible {
    transform: none;
  }
}
