/* Gate: страница входа (как topdevelopers.ru/login) */

.gate-body {
  min-height: 100vh;
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #e8f0f7;
  background: #050b14;
  position: relative;
  overflow: hidden;
}

.gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(13, 122, 95, 0.16), transparent 55%),
    radial-gradient(700px 480px at 88% 12%, rgba(42, 157, 117, 0.1), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(13, 122, 95, 0.08), transparent 55%),
    linear-gradient(165deg, #050b14 0%, #0a1626 48%, #06101c 100%);
  pointer-events: none;
}

.gate-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 18%, transparent 72%);
  opacity: 0.65;
}

.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gate-auth {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(11, 26, 46, 0.78);
  border: 1px solid rgba(13, 122, 95, 0.35);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: gate-auth-in 0.5s ease both;
}

@keyframes gate-auth-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.gate-auth .gate-field {
  display: block;
  margin: 0;
}
.gate-auth .gate-field input {
  width: 132px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(142, 160, 181, 0.28);
  background: rgba(5, 11, 20, 0.7);
  color: #e8f0f7;
  outline: none;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gate-auth .gate-field input::placeholder {
  color: rgba(142, 160, 181, 0.75);
}
.gate-auth .gate-field input:focus {
  border-color: rgba(42, 157, 117, 0.65);
  box-shadow: 0 0 0 3px rgba(13, 122, 95, 0.18);
}
.gate-auth .gate-field input[aria-invalid="true"] {
  border-color: rgba(255, 107, 107, 0.55);
}

.gate-auth .gate-submit {
  margin: 0;
  width: auto;
  flex-shrink: 0;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #04140f;
  background: linear-gradient(135deg, #3ecf9a 0%, #0d7a5f 55%, #0a5a41 100%);
  box-shadow: 0 6px 18px rgba(13, 122, 95, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.gate-auth .gate-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.gate-auth .gate-submit:active { transform: none; }

.gate-auth .gate-error {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
  font-size: 0.8rem;
}

.gate-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  padding: 80px 20px 40px;
  pointer-events: none;
}

.gate-brand {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #e8f0f7;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.gate-logo-stage {
  --scene: min(220px, 52vw);
  position: relative;
  width: min(340px, 78vw);
  height: min(340px, 78vw);
  display: grid;
  place-items: center;
  perspective: 1200px;
  perspective-origin: 50% 40%;
  animation: gate-logo-float 5.5s ease-in-out infinite;
}

/* Объёмное содержимое логотипа: ядро + орбита + спутник */
.orbita-scene {
  position: relative;
  z-index: 2;
  width: var(--scene);
  height: var(--scene);
  transform-style: preserve-3d;
  filter: drop-shadow(0 32px 48px rgba(0, 0, 0, 0.55));
}

.orbita-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(22deg) rotateZ(-12deg);
  animation: orbita-yaw 14s linear infinite;
}

.orbita-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42%;
  height: 42%;
  margin: -21% 0 0 -21%;
  border-radius: 50%;
  transform-style: preserve-3d;
  background:
    radial-gradient(circle at 32% 28%, #8ef0c8 0%, #2fd49a 22%, #129b72 52%, #0a5a41 78%, #063528 100%);
  box-shadow:
    inset -14px -18px 28px rgba(0, 20, 12, 0.55),
    inset 10px 12px 18px rgba(255, 255, 255, 0.22),
    0 0 42px rgba(46, 212, 154, 0.45),
    0 18px 36px rgba(0, 0, 0, 0.35);
  animation: orbita-core-spin 18s linear infinite;
}

.orbita-core-shine {
  position: absolute;
  top: 14%;
  left: 18%;
  width: 28%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%);
  filter: blur(0.5px);
}

.orbita-core-band {
  position: absolute;
  inset: 18% 8%;
  border-radius: 50%;
  background:
    linear-gradient(
      105deg,
      transparent 30%,
      rgba(255, 255, 255, 0.12) 42%,
      transparent 55%,
      rgba(0, 40, 28, 0.25) 68%,
      transparent 78%
    );
  mix-blend-mode: soft-light;
}

.orbita-orbit {
  position: absolute;
  inset: 8%;
  transform-style: preserve-3d;
  transform: rotateX(68deg) rotateZ(18deg);
}

.orbita-torus {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform-style: preserve-3d;
  pointer-events: none;
}

.orbita-torus-a {
  border: 10px solid transparent;
  border-top-color: #d8e2ec;
  border-right-color: #8a97a8;
  border-bottom-color: #5c6a7a;
  border-left-color: #c5d0dc;
  box-shadow:
    0 0 18px rgba(62, 207, 154, 0.25),
    inset 0 0 12px rgba(62, 207, 154, 0.18);
  filter: drop-shadow(0 0 6px rgba(180, 200, 220, 0.35));
}

.orbita-torus-b {
  inset: 3px;
  border: 4px solid rgba(232, 240, 247, 0.35);
  border-top-color: rgba(255, 255, 255, 0.65);
  border-bottom-color: rgba(80, 100, 120, 0.55);
  opacity: 0.9;
}

.orbita-torus-c {
  inset: -2px;
  border: 2px solid rgba(62, 207, 154, 0.35);
  box-shadow: 0 0 22px rgba(13, 122, 95, 0.35);
  opacity: 0.75;
}

.orbita-sat-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: orbita-sat-spin 8s linear infinite;
}

.orbita-sat {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, #e8eef5 35%, #9aa8b8 70%, #5c6a7a 100%);
  box-shadow:
    inset -3px -3px 6px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(232, 240, 247, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.4);
  transform: translateZ(6px) rotateX(-68deg);
}

.gate-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(62, 207, 154, 0.35) 0%, rgba(13, 122, 95, 0.14) 42%, transparent 70%);
  animation: gate-glow-pulse 3.6s ease-in-out infinite alternate;
  z-index: 1;
}

.gate-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  z-index: 0;
}
.gate-ring-a {
  inset: 2%;
  border-color: rgba(62, 207, 154, 0.4);
  animation: gate-ring-spin 14s linear infinite;
  box-shadow: 0 0 24px rgba(13, 122, 95, 0.16);
}
.gate-ring-b {
  inset: 10%;
  border-color: rgba(42, 157, 117, 0.3);
  border-style: dashed;
  animation: gate-ring-spin-rev 19s linear infinite;
}
.gate-ring-c {
  inset: -6%;
  border-color: rgba(232, 240, 247, 0.12);
  animation: gate-ring-pulse 5s ease-in-out infinite;
}

@keyframes gate-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes orbita-yaw {
  from { transform: rotateX(22deg) rotateZ(-12deg) rotateY(0deg); }
  to { transform: rotateX(22deg) rotateZ(-12deg) rotateY(360deg); }
}

@keyframes orbita-sat-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbita-core-spin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

@keyframes gate-glow-pulse {
  from { opacity: 0.55; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes gate-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gate-ring-spin-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes gate-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (max-width: 720px) {
  .gate-auth {
    top: 12px;
    right: 12px;
    left: 12px;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .gate-auth .gate-field { flex: 1 1 40%; }
  .gate-auth .gate-field input { width: 100%; }
  .gate-auth .gate-submit { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .gate-logo-stage,
  .orbita-world,
  .orbita-sat-track,
  .orbita-core,
  .gate-glow,
  .gate-ring,
  .gate-auth {
    animation: none !important;
  }
  .orbita-world {
    transform: rotateX(22deg) rotateZ(-12deg) rotateY(-32deg);
  }
}
