/*
 * IESYS Labs — Aurora V2.5
 * Electric Narrative + Consent & Lead Intelligence
 *
 * Loaded after the existing Aurora layers.
 */

/* ===============================================================
   ELECTRIC NARRATIVE
   =============================================================== */

:root {
  --iesys-electric-core: #1478ff;
  --iesys-electric-hot: #61c7ff;
  --iesys-electric-soft: rgba(20, 120, 255, .24);
  --iesys-electric-faint: rgba(20, 120, 255, .10);
}

html[data-theme="dark"] {
  --iesys-electric-core: #3797ff;
  --iesys-electric-hot: #83dcff;
  --iesys-electric-soft: rgba(55, 151, 255, .36);
  --iesys-electric-faint: rgba(55, 151, 255, .14);
}

.iesys-electric-word,
.iesys-electric-heading {
  position: relative;
}

.iesys-electric-word {
  display: inline-block;
  isolation: isolate;
}

.iesys-electric-word::after,
.iesys-electric-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.14em;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left center;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      var(--iesys-electric-core) 8%,
      var(--iesys-electric-hot) 72%,
      #e6f8ff 94%,
      transparent 100%
    );
  box-shadow:
    0 0 5px var(--iesys-electric-hot),
    0 0 15px var(--iesys-electric-soft);
  opacity: 0;
  transition:
    transform 850ms cubic-bezier(.16,.84,.22,1),
    opacity 260ms ease;
  pointer-events: none;
}

.iesys-electric-word::before,
.iesys-electric-heading::before {
  content: "";
  position: absolute;
  right: -7px;
  bottom: calc(-.14em - 5px);
  width: 13px;
  height: 11px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(132deg,
      transparent 0 31%,
      var(--iesys-electric-hot) 33% 40%,
      transparent 42% 57%,
      #eafaff 59% 65%,
      transparent 67%);
  filter:
    drop-shadow(0 0 3px var(--iesys-electric-hot))
    drop-shadow(0 0 8px var(--iesys-electric-soft));
}

.iesys-electric-visible.iesys-electric-word::after,
.iesys-electric-visible.iesys-electric-heading::after {
  transform: scaleX(1);
  opacity: .95;
}

.iesys-electric-visible.iesys-electric-word::before,
.iesys-electric-visible.iesys-electric-heading::before {
  animation: iesysElectricWordSpark 3.9s ease-in-out 650ms infinite;
}

/* Whole-card title treatment. */
.iesys-electric-heading {
  width: fit-content;
  max-width: 100%;
  padding-bottom: .08em;
}

/* Major statements get a little more energy. */
h1 .iesys-electric-word::after,
h2 .iesys-electric-word::after,
.iesys-immersive-title .iesys-electric-word::after {
  height: 3px;
  bottom: -.10em;
}

h1 .iesys-electric-word::before,
h2 .iesys-electric-word::before,
.iesys-immersive-title .iesys-electric-word::before {
  bottom: calc(-.10em - 5px);
}

@keyframes iesysElectricWordSpark {
  0%, 72%, 100% { opacity: 0; transform: translate3d(0,0,0) scale(.7); }
  76% { opacity: .22; }
  78% { opacity: .92; transform: translate3d(2px,-1px,0) scale(1); }
  80% { opacity: .18; transform: translate3d(-2px,1px,0) scale(.86); }
  83% { opacity: .68; transform: translate3d(1px,0,0) scale(.92); }
  87% { opacity: 0; }
}

/* ===============================================================
   CONSENT CENTER
   =============================================================== */

.iesys-consent-root {
  --consent-bg: rgba(255,255,255,.96);
  --consent-text: #101a2a;
  --consent-muted: #5f6b7c;
  --consent-line: rgba(19,34,55,.14);
  --consent-soft: #f2f6fb;
  position: relative;
  z-index: 2147483000;
}

html[data-theme="dark"] .iesys-consent-root {
  --consent-bg: rgba(9,14,23,.96);
  --consent-text: #f3f7fc;
  --consent-muted: #aab6c7;
  --consent-line: rgba(255,255,255,.12);
  --consent-soft: #101925;
}

.iesys-consent-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: min(1120px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  color: var(--consent-text);
  border: 1px solid var(--consent-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 4% 50%, var(--iesys-electric-faint), transparent 18rem),
    var(--consent-bg);
  box-shadow:
    0 28px 80px rgba(13,27,49,.20),
    inset 0 1px rgba(255,255,255,.35);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

html[data-theme="dark"] .iesys-consent-banner {
  box-shadow: 0 32px 90px rgba(0,0,0,.46);
}

.iesys-consent-banner[hidden] {
  display: none !important;
}

.iesys-consent-copy {
  min-width: 0;
}

.iesys-consent-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 7px;
  color: var(--iesys-electric-core);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.iesys-consent-kicker::before {
  content: "";
  width: 25px;
  height: 1px;
  background: var(--iesys-electric-core);
  box-shadow: 0 0 8px var(--iesys-electric-soft);
}

.iesys-consent-title {
  margin: 0;
  color: var(--consent-text);
  font-size: clamp(1.05rem,1.5vw,1.28rem);
  font-weight: 780;
  letter-spacing: -.025em;
}

.iesys-consent-text {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--consent-muted);
  font-size: .88rem;
  line-height: 1.55;
}

.iesys-consent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.iesys-consent-btn {
  appearance: none;
  min-height: 42px;
  padding: 0 16px;
  color: var(--consent-text);
  border: 1px solid var(--consent-line);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 760;
  cursor: pointer;
  white-space: nowrap;
}

.iesys-consent-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--iesys-electric-core) 42%, var(--consent-line));
}

.iesys-consent-btn.primary {
  color: #ffffff;
  border-color: var(--iesys-electric-core);
  background:
    linear-gradient(135deg, var(--iesys-electric-core), #316ee8);
  box-shadow: 0 10px 30px var(--iesys-electric-soft);
}

.iesys-consent-btn.subtle {
  color: var(--consent-muted);
}

.iesys-consent-manage {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 0;
  color: inherit;
  border: 0;
  background: none;
  font: inherit;
  font-size: .76rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Dialog */
.iesys-consent-dialog {
  width: min(660px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 34px));
  padding: 0;
  color: var(--consent-text);
  border: 1px solid var(--consent-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 0%, var(--iesys-electric-faint), transparent 22rem),
    var(--consent-bg);
  box-shadow: 0 32px 110px rgba(0,0,0,.32);
  overflow: hidden;
}

.iesys-consent-dialog::backdrop {
  background: rgba(4,9,17,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.iesys-consent-dialog-inner {
  max-height: inherit;
  overflow: auto;
  padding: 26px;
}

.iesys-consent-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.iesys-consent-dialog h2 {
  margin: 3px 0 0;
  color: var(--consent-text) !important;
  font-size: clamp(1.6rem,4vw,2.25rem);
  letter-spacing: -.04em;
}

.iesys-consent-close {
  appearance: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: var(--consent-text);
  border: 1px solid var(--consent-line);
  border-radius: 50%;
  background: var(--consent-soft);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.iesys-consent-intro {
  margin: 12px 0 20px;
  color: var(--consent-muted);
  font-size: .9rem;
  line-height: 1.6;
}

.iesys-consent-category {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--consent-line);
}

.iesys-consent-category h3 {
  margin: 0;
  color: var(--consent-text) !important;
  font-size: .96rem;
}

.iesys-consent-category p {
  margin: 4px 0 0;
  color: var(--consent-muted) !important;
  font-size: .78rem;
  line-height: 1.5;
}

.iesys-consent-switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: 0 0 auto;
}

.iesys-consent-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.iesys-consent-switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--consent-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--consent-muted) 13%, transparent);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.iesys-consent-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform 180ms ease;
}

.iesys-consent-switch input:checked + span {
  border-color: var(--iesys-electric-core);
  background: var(--iesys-electric-core);
}

.iesys-consent-switch input:checked + span::after {
  transform: translateX(19px);
}

.iesys-consent-switch input:disabled + span {
  opacity: .72;
  cursor: not-allowed;
}

.iesys-consent-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 20px;
  border-top: 1px solid var(--consent-line);
}

.iesys-consent-policy-link {
  margin-right: auto;
  align-self: center;
  color: var(--iesys-electric-core);
  font-size: .77rem;
  font-weight: 720;
}

/* Footer preference control */
.iesys-cookie-footer-button {
  appearance: none;
  padding: 0;
  color: inherit;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===============================================================
   COOKIE POLICY PAGE
   =============================================================== */

.cookies-policy {
  width: min(900px, calc(100% - 36px));
  margin: 0 auto;
  padding: 110px 0 90px;
}

.cookies-policy h1 {
  margin: 0;
  font-size: clamp(2.7rem,7vw,5.8rem);
  letter-spacing: -.055em;
  line-height: .92;
}

.cookies-policy .lead {
  max-width: 720px;
  margin: 24px 0 52px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.cookies-policy section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.cookies-policy h2 {
  margin: 0 0 13px;
  color: var(--text);
  font-size: 1.4rem;
}

.cookies-policy p,
.cookies-policy li {
  color: var(--muted);
  line-height: 1.7;
}

.cookies-policy code {
  color: var(--blue2);
}

.cookies-policy .back-link {
  display: inline-flex;
  margin-top: 36px;
  color: var(--text);
  font-weight: 750;
}

/* ===============================================================
   RESPONSIVE + ACCESSIBILITY
   =============================================================== */

@media (max-width: 780px) {
  .iesys-consent-banner {
    grid-template-columns: 1fr;
    gap: 15px;
    bottom: 10px;
    padding: 18px;
    border-radius: 21px;
  }

  .iesys-consent-actions {
    justify-content: stretch;
  }

  .iesys-consent-btn {
    flex: 1 1 145px;
  }

  .iesys-consent-dialog-inner {
    padding: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iesys-electric-word::after,
  .iesys-electric-heading::after {
    transition: none !important;
  }

  .iesys-electric-visible.iesys-electric-word::before,
  .iesys-electric-visible.iesys-electric-heading::before {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Aurora 2.8B — keep electric rail clear of letters with descenders */
.hero h1 .iesys-electric-word::after,#select .select-intro h2 .iesys-electric-word::after{bottom:-.19em}
.hero h1 .iesys-electric-word::before,#select .select-intro h2 .iesys-electric-word::before{bottom:calc(-.19em - 5px)}
