/* The old branding clearance is unnecessary when the public footer is absent. */
body.app-body.authenticated-body {
  padding-bottom: 0;
}

.cds-footer {
  --cds-footer-accent: #1597ff;
  --cds-footer-text: #1d2d49;
  --cds-footer-muted: #52627d;
  --cds-footer-divider: rgba(35, 89, 164, 0.2);
  position: relative;
  z-index: 12;
  margin-top: auto;
  padding: 0;
  overflow: hidden;
  color: var(--cds-footer-text);
  border-top: 1px solid rgba(21, 151, 255, 0.42);
  background: linear-gradient(105deg, #f7faff 0%, #ffffff 52%, #f2f7ff 100%);
  box-shadow: 0 -8px 28px rgba(17, 55, 108, 0.06);
  backdrop-filter: blur(14px);
}

.cds-footer::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent 0%, #168dff 18%, #4bb7ff 50%, #168dff 82%, transparent 100%);
  opacity: 0.72;
  box-shadow: 0 0 12px rgba(21, 151, 255, 0.34);
}

.cds-footer-inner {
  display: grid;
  grid-template-columns: minmax(280px, auto) minmax(0, 1fr) auto;
  align-items: center;
  min-height: 88px;
  gap: clamp(1rem, 2.4vw, 2.8rem);
  max-width: 1720px;
  margin-inline: auto;
  padding: 0.9rem clamp(1rem, 3vw, 3.75rem);
}

.cds-footer-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.85rem;
  min-width: 0;
  color: var(--cds-footer-text);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.cds-footer-brand .cds-theme-logo--footer {
  --cds-logo-size: 46px;
  flex: 0 0 46px;
  filter: drop-shadow(0 0 8px rgba(21, 151, 255, 0.22));
}

.cds-footer-brand:hover,
.cds-footer-brand:focus-visible {
  color: var(--cds-footer-accent);
}

.cds-footer-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
}

.cds-footer-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem clamp(0.52rem, 0.82vw, 0.82rem);
  color: var(--cds-footer-muted);
  font-size: clamp(0.69rem, 0.72vw, 0.79rem);
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.cds-footer-link + .cds-footer-link {
  border-left: 1px solid var(--cds-footer-divider);
}

.cds-footer-link svg {
  display: none;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cds-footer-link::after {
  position: absolute;
  right: 0.72rem;
  bottom: 0.1rem;
  left: 0.72rem;
  height: 2px;
  border-radius: 2px;
  content: "";
  background: var(--cds-footer-accent);
  box-shadow: 0 0 8px rgba(21, 151, 255, 0.55);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cds-footer-link:hover,
.cds-footer-link:focus-visible,
.cds-footer-link.is-active {
  color: var(--cds-footer-accent);
  text-shadow: 0 0 12px rgba(21, 151, 255, 0.16);
}

.cds-footer-link:hover::after,
.cds-footer-link:focus-visible::after,
.cds-footer-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.cds-footer-brand:focus-visible,
.cds-footer-link:focus-visible,
.cds-footer-powered:focus-visible {
  border-radius: 6px;
  outline: 3px solid rgba(21, 151, 255, 0.42);
  outline-offset: 3px;
}

.cds-footer-powered {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.42rem 0.52rem 0.42rem 1rem;
  color: #ffffff;
  border: 1px solid rgba(25, 160, 255, 0.78);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(8, 29, 61, 0.97), rgba(10, 20, 43, 0.96));
  box-shadow: 0 0 17px rgba(20, 150, 255, 0.18), inset 0 0 16px rgba(39, 134, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.cds-footer-powered img {
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
}

.cds-footer-powered:hover,
.cds-footer-powered:focus-visible {
  color: #ffffff;
  border-color: #4bb7ff;
  box-shadow: 0 0 22px rgba(20, 150, 255, 0.32), inset 0 0 18px rgba(39, 134, 255, 0.12);
  transform: translateY(-1px);
}

[data-theme="dark"] .cds-footer {
  --cds-footer-text: #f5f8ff;
  --cds-footer-muted: #d8e2f2;
  --cds-footer-divider: rgba(39, 121, 219, 0.42);
  border-top-color: rgba(21, 151, 255, 0.72);
  background: linear-gradient(108deg, #071426 0%, #09172b 48%, #061225 100%);
  box-shadow: 0 -10px 34px rgba(0, 9, 26, 0.32), inset 0 1px rgba(72, 165, 255, 0.08);
}

[data-theme="dark"] .cds-footer-brand .cds-theme-logo--footer {
  filter: drop-shadow(0 0 9px rgba(21, 151, 255, 0.42));
}

@media (max-width: 1199.98px) {
  .cds-footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 1.25rem;
    padding-block: 0.75rem;
  }

  .cds-footer-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 767.98px) {
  .cds-footer,
  [data-theme="dark"] .cds-footer {
    --cds-footer-text: #f5f8ff;
    --cds-footer-muted: #cbd8ea;
    --cds-footer-divider: rgba(65, 150, 238, 0.42);
    background: radial-gradient(ellipse at 50% 18%, rgba(0, 132, 255, 0.08), transparent 65%), #031326;
    box-shadow: 0 -8px 28px rgba(0, 22, 49, 0.2);
  }

  .cds-footer-inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 1.3rem;
    padding: 1.8rem 1.4rem calc(1.8rem + env(safe-area-inset-bottom));
  }

  .cds-footer-brand,
  .cds-footer-powered {
    justify-self: center;
  }

  .cds-footer-brand {
    flex-direction: column;
    gap: 1rem;
    font-size: 1.05rem;
    text-align: center;
    white-space: normal;
  }

  .cds-footer-brand .cds-theme-logo--footer {
    --cds-logo-size: 68px;
    flex-basis: 68px;
    filter: drop-shadow(0 0 10px rgba(21, 151, 255, 0.42));
  }

  .cds-footer-nav {
    flex-wrap: wrap;
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--cds-footer-divider);
  }

  .cds-footer-link {
    flex: 0 0 33.333333%;
    min-width: 0;
    min-height: 44px;
    padding: 0.5rem 0.3rem;
    font-size: 1rem;
  }

  .cds-footer-link:nth-child(4),
  .cds-footer-link:nth-child(6) {
    border-left: 0;
  }

  .cds-footer-link:nth-child(5) {
    flex-basis: 66.666667%;
  }

  .cds-footer-link:nth-child(6) {
    flex-basis: 100%;
  }

  .cds-footer-powered {
    grid-row: auto;
    min-height: 52px;
    padding: 0.45rem 0.65rem 0.45rem 1.25rem;
    gap: 0.9rem;
    font-size: 1.05rem;
  }

  .cds-footer-powered img {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cds-footer-link,
  .cds-footer-link::after,
  .cds-footer-powered {
    transition: none;
  }
}
