/**
 * UpPay site footer — canonical shared chrome (donate-test).
 * #uppay-footer-root reserves shell space before js/uppay-local-footer.js mounts.
 *
 * SHARED CHROME CONTRACT
 * This file is the ONLY source of truth for footer geometry and visuals.
 * Every rule is scoped under #uppay-site-footer so page stylesheets using
 * class-only selectors (including the games bundle's legacy footer copy)
 * can never win regardless of <link> order.
 * Pages may not style descendants of #uppay-site-footer.
 *
 * Requires css/uppay-design-tokens.css first.
 */

/* ------------------------------------------------------------------ *
 * 0. MOUNT PLACEHOLDER (pre-JS)
 * ------------------------------------------------------------------ */
#uppay-footer-root {
  display: block;
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  min-height: 36.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 18, 0.96);
}

@media (min-width: 768px) {
  #uppay-footer-root {
    min-height: 18.35rem;
  }
}

@media (min-width: 1200px) {
  #uppay-footer-root {
    min-height: 17.625rem;
  }
}

/* ------------------------------------------------------------------ *
 * 1. COMPONENT ISOLATION
 * ------------------------------------------------------------------ */
#uppay-site-footer,
#uppay-site-footer *,
#uppay-site-footer *::before,
#uppay-site-footer *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: transparent;
  border-radius: 0;
  outline: 0;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-decoration: none;
  text-align: inherit;
  list-style: none;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: none;
  opacity: 1;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

#uppay-site-footer a,
#uppay-site-footer button {
  color: inherit;
  cursor: pointer;
}

#uppay-site-footer img,
#uppay-site-footer svg {
  display: block;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ *
 * 2. CANONICAL TOKENS + SHELL
 * Tokens are declared on the component, out of reach of page :root/body.
 * ------------------------------------------------------------------ */
#uppay-site-footer {
  --uppay-footer-inner-max: 1400px;
  --uppay-footer-padding-x: 1rem;
  --uppay-footer-padding-top: 2.75rem;
  --uppay-footer-padding-bottom: 2.25rem;
  --uppay-footer-column-gap: 2.5rem;
  --uppay-footer-row-gap: 2rem;
  --uppay-footer-social-size: 2.9rem;
  --uppay-footer-social-glyph: 1.4rem;
  --uppay-footer-logo-asset-h: 2.5rem;
  --uppay-footer-legal-gap: 0.65rem 1.35rem;

  /* Page position is page-agnostic here: the footer always sits last, never
     shrinks and stacks above page background layers, so pages do not need
     their own sticky-footer or z-index rule. */
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  padding: var(--uppay-footer-padding-top) 0 var(--uppay-footer-padding-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 18, 0.96);
  color: var(--uppay-text);
  font-family: var(--uppay-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
}

@media (min-width: 640px) {
  #uppay-site-footer {
    --uppay-footer-padding-x: 1.25rem;
  }
}

/* ------------------------------------------------------------------ *
 * 3. INNER CONTAINER
 * ------------------------------------------------------------------ */
#uppay-site-footer .uppay-footer-inner {
  width: 100%;
  max-width: var(--uppay-footer-inner-max);
  margin: 0 auto;
  padding: 0 var(--uppay-footer-padding-x);
}

#uppay-site-footer .uppay-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--uppay-footer-row-gap) var(--uppay-footer-column-gap);
}

@media (min-width: 768px) {
  #uppay-site-footer .uppay-footer-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* ------------------------------------------------------------------ *
 * 4. BRAND COLUMN
 * ------------------------------------------------------------------ */
#uppay-site-footer .uppay-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

#uppay-site-footer .uppay-footer-brand--asset {
  gap: 0;
}

#uppay-site-footer .uppay-footer-logo-asset {
  width: auto;
  height: var(--uppay-footer-logo-asset-h);
  max-height: var(--uppay-footer-logo-asset-h);
  max-width: min(12rem, 72vw);
  object-fit: contain;
  object-position: left center;
}

#uppay-site-footer .uppay-footer-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.38rem;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

#uppay-site-footer .uppay-footer-brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: inherit;
}

#uppay-site-footer .uppay-footer-brand__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #ffffff;
}

#uppay-site-footer .uppay-footer-tagline,
#uppay-site-footer .uppay-footer-copy,
#uppay-site-footer .uppay-footer-entity {
  color: #8b97a8;
  font-size: 0.8125rem;
  line-height: 1.45;
  font-weight: 500;
}

#uppay-site-footer .uppay-footer-tagline {
  margin-bottom: 0.55rem;
  color: #b8c2ce;
}

#uppay-site-footer .uppay-footer-copy {
  margin-top: 0.15rem;
}

#uppay-site-footer .uppay-footer-entity {
  margin-top: 0.2rem;
}

/* ------------------------------------------------------------------ *
 * 5. LINK COLUMNS
 * ------------------------------------------------------------------ */
#uppay-site-footer .uppay-footer-heading {
  margin: 0 0 1rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

#uppay-site-footer .uppay-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#uppay-site-footer .uppay-footer-links a {
  color: #c5cdd8;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  transition: color 0.15s ease;
}

#uppay-site-footer .uppay-footer-links a:hover {
  color: #ffffff;
}

/* ------------------------------------------------------------------ *
 * 6. SOCIALS
 * ------------------------------------------------------------------ */
#uppay-site-footer .uppay-footer-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

#uppay-site-footer .uppay-footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--uppay-footer-social-size);
  height: var(--uppay-footer-social-size);
  border-radius: 999px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px rgba(0, 0, 0, 0.2);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

#uppay-site-footer .uppay-footer-social:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  filter: brightness(1.08);
}

#uppay-site-footer .uppay-footer-social__glyph {
  width: var(--uppay-footer-social-glyph);
  height: var(--uppay-footer-social-glyph);
  max-width: var(--uppay-footer-social-glyph);
  max-height: var(--uppay-footer-social-glyph);
  flex: 0 0 auto;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

#uppay-site-footer .uppay-footer-social--telegram .uppay-footer-social__glyph {
  transform: translate(0.5px, 0.5px);
}

#uppay-site-footer .uppay-footer-social--vk .uppay-footer-social__glyph {
  transform: scale(0.92);
}

#uppay-site-footer .uppay-footer-social--telegram {
  background:
    radial-gradient(circle at 50% 42%, rgba(56, 148, 198, 0.55) 0%, rgba(24, 58, 82, 0.95) 72%),
    #1a3348;
}

#uppay-site-footer .uppay-footer-social--vk {
  background:
    radial-gradient(circle at 50% 42%, rgba(55, 120, 190, 0.5) 0%, rgba(28, 48, 78, 0.96) 72%),
    #1b2c46;
}

#uppay-site-footer .uppay-footer-social--youtube {
  background:
    radial-gradient(circle at 50% 42%, rgba(170, 55, 55, 0.52) 0%, rgba(58, 28, 32, 0.96) 72%),
    #3a1c20;
}

#uppay-site-footer .uppay-footer-social--instagram {
  background:
    radial-gradient(circle at 50% 42%, rgba(160, 70, 120, 0.48) 0%, rgba(52, 30, 58, 0.96) 72%),
    #34203a;
}

#uppay-site-footer .uppay-footer-social--tiktok {
  background:
    radial-gradient(circle at 50% 42%, rgba(45, 140, 145, 0.45) 0%, rgba(28, 40, 48, 0.96) 72%),
    #1c2830;
}

/* ------------------------------------------------------------------ *
 * 7. LEGAL ROW
 * ------------------------------------------------------------------ */
#uppay-site-footer .uppay-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--uppay-footer-legal-gap);
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

#uppay-site-footer .uppay-footer-legal a {
  color: #8b97a8;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  transition: color 0.15s ease;
}

#uppay-site-footer .uppay-footer-legal a:hover {
  color: #c5cdd8;
}
