/* Gate: login / invite — no portal chrome */

.gate-body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  color: var(--cream);
  background: #050b14;
  position: relative;
  overflow: hidden;
}

.gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(46, 230, 200, 0.1), transparent 55%),
    radial-gradient(700px 480px at 88% 12%, rgba(212, 175, 55, 0.1), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(46, 230, 200, 0.06), 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-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 5;
  width: min(320px, calc(100% - 40px));
}
.gate-messages li {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(46, 230, 200, 0.1);
  border: 1px solid rgba(46, 230, 200, 0.25);
  font-size: 14px;
  margin-bottom: 8px;
}
.gate-messages li.error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
}

/* Compact auth — top right */
.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(212, 175, 55, 0.2);
  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: var(--cream);
  outline: none;
  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(46, 230, 200, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 230, 200, 0.12);
}
.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-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #06101c;
  background: linear-gradient(135deg, #f0d78c 0%, #d4af37 55%, #b8922e 100%);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.gate-auth .gate-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.gate-auth .gate-submit:active {
  transform: none;
}

.gate-auth .gate-error {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  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;
}

/* Centered animated logo */
.gate-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 80px 20px 40px;
  pointer-events: none;
}

.gate-logo-stage {
  position: relative;
  width: min(280px, 62vw);
  height: min(280px, 62vw);
  display: grid;
  place-items: center;
  animation: gate-logo-float 5.5s ease-in-out infinite;
}

.gate-logo {
  position: relative;
  z-index: 2;
  width: min(168px, 38vw);
  height: min(168px, 38vw);
  border-radius: 50%;
  animation:
    gate-logo-spin 36s linear infinite,
    gate-logo-pulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.35));
}

.gate-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(240, 215, 140, 0.35) 0%, rgba(46, 230, 200, 0.12) 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(212, 175, 55, 0.35);
  animation: gate-ring-spin 14s linear infinite;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.12);
}
.gate-ring-b {
  inset: 10%;
  border-color: rgba(46, 230, 200, 0.28);
  border-style: dashed;
  animation: gate-ring-spin-rev 19s linear infinite;
}
.gate-ring-c {
  inset: -6%;
  border-color: rgba(240, 215, 140, 0.14);
  animation: gate-ring-pulse 5s ease-in-out infinite;
}

@keyframes gate-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes gate-logo-spin {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes gate-logo-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.28));
  }
  50% {
    filter: drop-shadow(0 0 32px rgba(46, 230, 200, 0.45));
  }
}

@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;
  }
}

/* Invite keeps card layout */
.gate-panel {
  width: min(400px, calc(100% - 40px));
  margin: 10vh auto;
  padding: 36px 28px 32px;
  border-radius: 20px;
  background: rgba(11, 26, 46, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  text-align: center;
  animation: gate-auth-in 0.55s ease both;
}
.gate-panel .gate-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  animation: none;
  filter: none;
}
.gate-panel .gate-brand {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold-2);
}
.gate-panel .gate-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream);
}
.gate-panel .gate-lead {
  margin: 0 0 26px;
  color: var(--mute);
  font-size: 0.92rem;
  line-height: 1.5;
}
.gate-panel .gate-form {
  display: grid;
  gap: 14px;
  text-align: left;
}
.gate-panel .gate-field span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.gate-panel .gate-field input,
.gate-panel .gate-form input[type="text"],
.gate-panel .gate-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(142, 160, 181, 0.28);
  background: rgba(5, 11, 20, 0.65);
  color: var(--cream);
}
.gate-panel .gate-submit {
  margin-top: 6px;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #06101c;
  background: linear-gradient(135deg, #f0d78c 0%, #d4af37 55%, #b8922e 100%);
}
.gate-panel a { color: var(--teal); }
.gate-panel a:hover { color: var(--gold-2); }
.gate-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@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%;
  }
  .gate-messages {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-logo-stage,
  .gate-logo-stage .gate-logo,
  .gate-glow,
  .gate-ring,
  .gate-logo-stage::before,
  .gate-auth,
  .gate-panel {
    animation: none !important;
  }
}
