/* UPA — Auth: session page, flow steps, pulse animations */

/* Session page: bridge between landing and admin */
body.upa-page .upa-auth {
  width: min(100% - 2rem, 1040px);
  margin: 0 auto;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-content: center;
  gap: 1.1rem;
  position: relative;
  padding-top: 3.2rem;
}

body.upa-page .upa-auth__back {
  position: absolute;
  top: 0.8rem;
  left: 0;
  z-index: 2;
}

body.upa-page .upa-auth__intro,
body.upa-page .upa-auth__panel {
  background: var(--upa-surface);
  border: 1px solid var(--upa-border);
  border-radius: 18px;
  box-shadow: var(--upa-shadow);
}

body.upa-page .upa-auth__intro {
  padding: clamp(1rem, 2vw, 2rem);
}

body.upa-page .upa-auth__panel {
  padding: clamp(1rem, 2vw, 1.6rem);
}

body.upa-page .upa-auth__kicker {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--upa-primary);
}

body.upa-page .upa-auth__title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.6rem, 3.7vw, 2.2rem);
}

body.upa-page .upa-auth__text {
  margin: 0.8rem 0 0;
  color: var(--upa-muted);
  max-width: 35rem;
}

body.upa-page .upa-flow {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin: 1.2rem 0 0;
  padding: 0;
}

body.upa-page .upa-flow__item {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 11px;
  border: 1px solid var(--upa-border);
  color: var(--upa-muted);
  background: #fbfdff;
}

body.upa-page .upa-flow__item::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  min-width: 0.55rem;
  border-radius: 999px;
  background: #c0cedf;
}

body.upa-page .upa-flow__item + .upa-flow__item::marker {
  content: "";
}

body.upa-page .upa-flow__item.is-done {
  border-color: #b9e9cf;
  color: #155b3e;
  background: #f2fff7;
}

body.upa-page .upa-flow__item.is-done::before {
  background: var(--upa-success);
}

body.upa-page .upa-flow__item.is-active {
  border-color: #b7d5fb;
  color: #164d95;
  background: #f1f7ff;
  box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.14);
}

body.upa-page .upa-flow__item.is-active::before {
  background: var(--upa-primary);
  animation: upa-pulse-dot 1.2s ease-in-out infinite;
}

body.upa-page .upa-flow__item.is-next {
  border-color: #d5e2f2;
  color: #3a5776;
  background: #f6f9fd;
}

body.upa-page .upa-flow__item.is-next::before {
  background: #90a8c4;
  animation: upa-next-dot 1.8s ease-in-out infinite;
}

body.upa-page .upa-flow__line {
  position: absolute;
  left: calc(0.75rem + 0.275rem - 1px);
  top: calc(100% + 1px);
  width: 2px;
  height: 0.72rem;
  pointer-events: none;
}

body.upa-page .upa-flow__line--solid {
  background: #7fceb0;
}

body.upa-page .upa-flow__line--dashed {
  background: repeating-linear-gradient(
    to bottom,
    #86a9d2 0 4px,
    transparent 4px 8px
  );
}

body.upa-page .upa-auth__widget {
  border: 1px solid var(--upa-border);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--upa-surface-soft);
}

body.upa-page .upa-auth__label {
  margin: 0 0 0.75rem;
  color: var(--upa-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

body.upa-page .upa-auth__link {
  display: inline-block;
  margin-top: var(--tg-spacing-md);
  color: var(--upa-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 140ms ease;
}

body.upa-page .upa-auth__link:hover {
  color: var(--upa-primary);
  text-decoration: underline;
}

body.upa-page .upa-auth__consent {
  margin: 0.75rem 0 0;
  color: var(--upa-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

body.upa-page .upa-auth__consent a {
  color: var(--upa-primary);
  font-weight: 600;
  text-decoration: none;
}

body.upa-page .upa-auth__consent a:hover {
  text-decoration: underline;
}

@keyframes upa-pulse-dot {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.36);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 7px rgba(31, 111, 235, 0);
  }
}

@keyframes upa-next-dot {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

@keyframes upa-preview-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes upa-preview-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  body.upa-page .upa-auth {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3.4rem;
    margin: 0.9rem auto 1.3rem;
  }

  body.upa-page .upa-auth__back {
    top: 0;
  }
}
