.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(70, 208, 180, 0.28), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 164, 87, 0.24), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(12, 110, 98, 0.18), transparent 34%),
    linear-gradient(135deg, #091417 0%, #102126 46%, #142a25 100%);
  opacity: 1;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.auth-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.auth-gate-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(4, 12, 14, 0.08) 42%, rgba(4, 12, 14, 0.48) 100%);
  pointer-events: none;
}

.auth-gate-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  width: min(620px, calc(100vw - 40px));
  min-height: clamp(360px, 46vh, 460px);
  padding: 30px;
  border-radius: 28px;
  border: 1px solid rgba(176, 224, 211, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(9, 23, 27, 0.76);
  box-shadow:
    0 38px 90px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.auth-gate-shell::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  background:
    linear-gradient(135deg, rgba(57, 191, 163, 0.14), transparent 38%, rgba(255, 168, 97, 0.1) 100%);
  pointer-events: none;
}

.auth-gate-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 100%;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #edf9f6;
}

.auth-gate-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 216, 201, 0.35);
  background: rgba(223, 246, 241, 0.09);
  color: #bceee3;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate-kicker::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2ac8a9, #ff9f5a);
  box-shadow: 0 0 16px rgba(42, 200, 169, 0.75);
}

.auth-gate-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: #f6fffd;
}

.auth-gate-copy p {
  margin: 12px 0 -6px;
  max-width: 42ch;
  min-height: 3.1em;
  color: rgba(219, 239, 234, 0.84);
  font-size: 1rem;
  line-height: 1.55;
}

.auth-gate-status {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.auth-gate-loader {
  display: grid;
  gap: 10px;
}

.auth-gate-loader.hidden,
.auth-gate-actions.hidden {
  display: none;
}

.auth-gate-loader-visual {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-gate-loader-ring {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(5, 19, 22, 0.92) 0 42%, transparent 44%),
    conic-gradient(from 0deg, #2ac8a9, #93f0de, #ffab6a, #2ac8a9);
  animation: authGateSpin 1.8s linear infinite;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 28px rgba(42, 200, 169, 0.22);
}

.auth-gate-loader-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid rgba(180, 235, 223, 0.18);
}

.auth-gate-loader-bars {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-height: 48px;
}

.auth-gate-loader-bars span {
  display: block;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 171, 106, 0.98), rgba(42, 200, 169, 0.98));
  box-shadow: 0 0 18px rgba(42, 200, 169, 0.16);
  animation: authGatePulse 1.2s ease-in-out infinite;
}

.auth-gate-loader-bars span:nth-child(1) {
  height: 18px;
  animation-delay: 0ms;
}

.auth-gate-loader-bars span:nth-child(2) {
  height: 38px;
  animation-delay: 90ms;
}

.auth-gate-loader-bars span:nth-child(3) {
  height: 28px;
  animation-delay: 180ms;
}

.auth-gate-loader-bars span:nth-child(4) {
  height: 46px;
  animation-delay: 270ms;
}

.auth-gate-loader-bars span:nth-child(5) {
  height: 22px;
  animation-delay: 360ms;
}

.auth-gate-loader-bars span:nth-child(6) {
  height: 34px;
  animation-delay: 450ms;
}

.auth-gate-loader-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(216, 239, 232, 0.86);
  font-size: 0.95rem;
}

.auth-gate-loader-label strong {
  color: #f3fffc;
  font-weight: 700;
}

.auth-gate-progress {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(167, 223, 211, 0.18);
  background:
    linear-gradient(180deg, rgba(235, 249, 244, 0.08), rgba(10, 22, 26, 0.32));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-gate-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(205, 234, 226, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-gate-progress-head strong {
  color: #f4fffd;
  font-size: 0.72rem;
}

.auth-gate-progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(195, 229, 220, 0.1);
  box-shadow: inset 0 0 0 1px rgba(182, 230, 219, 0.08);
}

.auth-gate-progress-track span {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: -38%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(42, 200, 169, 0.95), rgba(255, 171, 106, 0.92), rgba(147, 240, 222, 0.95));
  box-shadow:
    0 0 24px rgba(42, 200, 169, 0.22),
    0 0 36px rgba(255, 171, 106, 0.18);
  animation: authGateSweep 1.85s ease-in-out infinite;
}

.auth-gate-actions-track span {
  animation-duration: 7.2s;
}

.auth-gate-progress-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-gate-progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(165, 221, 208, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 245, 240, 0.88);
  font-size: 0.82rem;
}

.auth-gate-progress-step::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2ac8a9;
  box-shadow: 0 0 0 0 rgba(42, 200, 169, 0.32);
  animation: authGateStepPulse 1.8s ease-in-out infinite;
}

.auth-gate-progress-step:nth-child(2)::before {
  background: #f3b96e;
  animation-delay: 180ms;
}

.auth-gate-progress-step:nth-child(3)::before {
  background: #ffab6a;
  animation-delay: 360ms;
}

.auth-gate-actions {
  display: grid;
  gap: 10px;
}

.auth-gate-actions-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(167, 223, 211, 0.18);
  background:
    linear-gradient(180deg, rgba(235, 249, 244, 0.08), rgba(10, 22, 26, 0.32));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-gate-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(205, 234, 226, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-gate-actions-head strong {
  color: #f4fffd;
  font-size: 0.72rem;
}

.auth-gate-actions-visual {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.auth-gate-loader-ring-compact {
  width: 52px;
  height: 52px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(42, 200, 169, 0.18);
}

.auth-gate-loader-ring-compact::after {
  inset: 8px;
}

.auth-gate-loader-bars-compact {
  flex: 0 0 auto;
  gap: 6px;
  min-height: 38px;
}

.auth-gate-loader-bars-compact span {
  width: 9px;
}

.auth-gate-loader-bars-compact span:nth-child(1) {
  height: 14px;
}

.auth-gate-loader-bars-compact span:nth-child(2) {
  height: 30px;
}

.auth-gate-loader-bars-compact span:nth-child(3) {
  height: 22px;
}

.auth-gate-loader-bars-compact span:nth-child(4) {
  height: 36px;
}

.auth-gate-loader-bars-compact span:nth-child(5) {
  height: 18px;
}

.auth-gate-loader-bars-compact span:nth-child(6) {
  height: 27px;
}

.auth-gate-actions-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-gate-actions-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(165, 221, 208, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 245, 240, 0.78);
  font-size: 0.82rem;
}

.auth-gate-actions-step::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2ac8a9;
  box-shadow: 0 0 0 0 rgba(42, 200, 169, 0.32);
  animation: authGateStepPulse 1.8s ease-in-out infinite;
}

.auth-gate-actions-step:nth-child(2)::before {
  background: #93f0de;
  animation-delay: 180ms;
}

.auth-gate-actions-step:nth-child(3)::before {
  background: #ffab6a;
  animation-delay: 360ms;
}

.auth-gate-actions-step.is-done {
  color: rgba(236, 250, 246, 0.92);
  background: rgba(126, 218, 198, 0.08);
}

.auth-gate-actions-step.is-active {
  color: #f2fffc;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(17, 31, 35, 0.28));
  border-color: rgba(173, 226, 214, 0.2);
}

.auth-gate-actions-steps .auth-gate-actions-step-button {
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(225, 229, 235, 0.92);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 248, 251, 0.97));
  color: #1f1f1f;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.18);
  animation: authGateGooglePulse 2.8s ease-in-out infinite;
}

.auth-gate-actions-steps .auth-gate-actions-step-button::before {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 31% 32%, #ffffff 0 16%, transparent 18%),
    conic-gradient(from 18deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(0, 0, 0, 0.08);
  opacity: 1;
  transform: none;
  animation: none;
}

.auth-gate-actions-steps .auth-gate-actions-step-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.auth-gate-actions-steps .auth-gate-actions-step-button:active {
  transform: translateY(0);
}

.auth-gate-primary {
  display: inline-flex;
  width: min(344px, 100%);
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #dff6f1, #b9efe1 42%, #ffd3ac 100%);
  color: #123139;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.auth-gate-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 24px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.auth-gate-primary:active {
  transform: translateY(0);
}

.auth-gate-primary:disabled {
  cursor: wait;
  filter: saturate(0.88);
  opacity: 0.82;
}

.auth-gate-primary::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, #fff 0 16%, transparent 18%),
    conic-gradient(from 20deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75% 100%);
}

.auth-gate-hint {
  max-width: 42ch;
  color: rgba(220, 239, 233, 0.78);
  font-size: 0.96rem;
  line-height: 1.45;
}

.auth-gate-hint.hidden {
  display: none;
}

.auth-gate[data-auth-state='blocked'] .auth-gate-primary {
  background:
    linear-gradient(135deg, #ffe2d8, #ffd4c8 42%, #ffe8d6 100%);
  color: #51261f;
}

@keyframes authGateSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes authGatePulse {
  0%,
  100% {
    transform: scaleY(0.72);
    opacity: 0.58;
  }
  50% {
    transform: scaleY(1.08);
    opacity: 1;
  }
}

@keyframes authGateSweep {
  0% {
    left: -38%;
    opacity: 0.76;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0.82;
  }
}

@keyframes authGateStepPulse {
  0%,
  100% {
    transform: scale(0.82);
    box-shadow: 0 0 0 0 rgba(42, 200, 169, 0);
    opacity: 0.62;
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(42, 200, 169, 0);
    opacity: 1;
  }
}

@keyframes authGateGooglePulse {
  0%,
  100% {
    box-shadow:
      0 6px 16px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(255, 255, 255, 0.18);
  }
  50% {
    box-shadow:
      0 10px 22px rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(255, 255, 255, 0.28),
      0 0 18px rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 640px) {
  .auth-gate-shell {
    min-height: 0;
    padding: 22px 18px;
  }

  .auth-gate-copy h2 {
    font-size: clamp(1.72rem, 8vw, 2.4rem);
  }

  .auth-gate-loader-visual {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-gate-loader-bars {
    min-height: 40px;
  }

  .auth-gate-progress-steps {
    grid-template-columns: 1fr;
  }

  .auth-gate-actions-steps {
    grid-template-columns: 1fr;
  }

  .auth-gate-actions-visual {
    min-height: 0;
  }

  .auth-gate-primary {
    width: 100%;
    min-width: 0;
  }
}
