.tg-footer {
  margin-top: 6px;
  padding: 0 0 6px;
  background: transparent;
  overflow: visible;
}

.footer-card,
.footer-inner,
.site-footer,
.public-footer {
  overflow: visible;
}

.tg-footer-inner {
  position: relative;
  overflow: visible;
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 249, 255, 0.84)),
    var(--card-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 18px;
}

.tg-footer-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  width: auto;
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.32),
    rgba(25, 183, 223, 0.18),
    transparent 68%
  );
  pointer-events: none;
}

.tg-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.tg-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

.tg-footer-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tg-footer-sub {
  margin-top: 3px;
  max-width: 520px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tg-footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-social {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 160ms ease;
}

.tg-social:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
}

.tg-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.tg-footer-links > a,
.tg-footer-links .footer-legal-summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid transparent;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.tg-footer-links > a:hover,
.tg-footer-links .footer-legal-summary:hover,
.tg-footer-links .footer-legal-summary:focus-visible,
.tg-footer-links > a:focus-visible {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
}

.footer-legal {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.footer-legal-summary {
  list-style: none;
  cursor: pointer;
}

.footer-legal-summary::-webkit-details-marker {
  display: none;
}

.footer-legal-summary::after {
  content: "\25B2";
  margin-left: 6px;
  font-size: 0.8em;
  transition: transform 120ms ease;
}

.footer-legal:not([open]) .footer-legal-summary::after {
  content: "\25BC";
}

.footer-legal-panel {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 230px;
  padding: 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 9999;
  gap: 6px;
}

.footer-legal[open] .footer-legal-panel {
  display: grid;
}

.footer-legal-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
}

.footer-legal-panel a:hover,
.footer-legal-panel a:focus-visible {
  color: var(--text);
  background: rgba(77, 134, 255, 0.12);
}

.tg-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.tg-footer-copy,
.tg-footer-mini {
  color: var(--text-dim);
  font-size: 0.9rem;
}

html[data-bs-theme="dark"] .tg-footer-inner {
  background:
    linear-gradient(180deg, rgba(18, 24, 21, 0.96), rgba(12, 17, 14, 0.94)),
    var(--card-strong);
}

html[data-bs-theme="dark"] .footer-legal-panel {
  background: var(--card-strong);
  border-color: rgba(77, 134, 255, 0.24);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .footer-legal-summary:hover,
html[data-bs-theme="dark"] .footer-legal-summary:focus-visible,
html[data-bs-theme="dark"] .tg-social:hover,
html[data-bs-theme="dark"] .tg-footer-links a:hover {
  border-color: rgba(77, 134, 255, 0.26);
  background: rgba(77, 134, 255, 0.16);
}

@media (max-width: 767.98px) {
  .tg-footer-top {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .tg-footer-brand {
    min-width: 0;
    align-items: flex-start;
  }

  .tg-footer-social {
    width: 100%;
    justify-content: flex-start;
  }

  .tg-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tg-footer-links > a,
  .footer-legal {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    background: rgba(37, 99, 235, 0.04);
  }

  .footer-legal {
    display: block;
    height: auto;
  }

  .footer-legal-summary {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .footer-legal-panel {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    margin-top: 10px;
    box-shadow: none;
    padding: 8px;
    border-radius: 16px;
  }

  .tg-footer-bottom {
    align-items: flex-start;
    padding-top: 12px;
  }
}

@media (max-width: 575.98px) {
  .tg-footer-inner {
    padding: 20px 16px;
    border-radius: 24px;
    gap: 16px;
  }

  .tg-footer-inner::before {
    left: 18px;
    right: 18px;
  }

  .tg-footer-brand {
    gap: 12px;
  }

  .tg-footer-title {
    font-size: 0.96rem;
  }

  .tg-footer-sub,
  .tg-footer-copy,
  .tg-footer-mini {
    font-size: 0.84rem;
  }

  .tg-footer-links {
    grid-template-columns: 1fr;
  }

  .tg-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}