/* ============================================
   PASSWORD GATEWAY — SECURE ENTRY
   ============================================ */

.gateway {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030308;
  position: relative;
  overflow: hidden;
}

/* Animated grid background */
.gateway-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridPulse 4s ease infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Floating network nodes */
.gateway-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-blue);
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}

.node:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.node:nth-child(2) { top: 25%; right: 15%; animation-delay: 1s; }
.node:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 2s; }
.node:nth-child(4) { top: 40%; left: 60%; animation-delay: 0.5s; }
.node:nth-child(5) { bottom: 30%; right: 25%; animation-delay: 1.5s; }
.node:nth-child(6) { top: 60%; left: 30%; animation-delay: 3s; }
.node:nth-child(7) { top: 10%; left: 50%; animation-delay: 2.5s; }
.node:nth-child(8) { bottom: 15%; left: 70%; animation-delay: 0.8s; }

.node::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.08);
}

/* Radial glow */
.gateway-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06), rgba(99, 102, 241, 0.03), transparent 70%);
  pointer-events: none;
}

/* Data streams */
.data-stream {
  position: absolute;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: rgba(0, 212, 255, 0.06);
  line-height: 2;
  white-space: nowrap;
  pointer-events: none;
}

.data-stream-left {
  left: 5%;
  top: 0;
  animation: dataFlow 25s linear infinite;
}

.data-stream-right {
  right: 8%;
  top: 0;
  animation: dataFlow 30s linear infinite;
  animation-delay: -10s;
}

/* Main panel */
.gateway-panel {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 0 24px;
}

.gateway-header {
  text-align: center;
  margin-bottom: 40px;
}

.gateway-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  position: relative;
}

.gateway-logo::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 18px;
  background: #030308;
}

.gateway-logo svg {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
}

.gateway-logo-text {
  position: relative;
  z-index: 1;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gateway-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.gateway-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.gateway-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent-emerald);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 14px;
}

.gateway-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulse 2s infinite;
}

/* Form card */
.gateway-card {
  background: rgba(10, 10, 26, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.gateway-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.gateway-input-group {
  position: relative;
  margin-bottom: 24px;
}

.gateway-input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.gateway-input-label svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent-blue);
  fill: none;
  stroke-width: 2;
}

.gateway-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.15em;
  outline: none;
  transition: all 0.3s ease;
}

.gateway-input::placeholder {
  color: rgba(148, 163, 184, 0.3);
  letter-spacing: 0.3em;
}

.gateway-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08), 0 0 30px rgba(0, 212, 255, 0.1);
  background: rgba(0, 212, 255, 0.03);
}

.gateway-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.gateway-submit:hover {
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
}

.gateway-submit:active {
  transform: translateY(0);
}

/* Error state */
.gateway-error {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #ef4444;
}

.gateway-error.show {
  display: flex;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Glitch effect on error */
.glitch-active .gateway-header h1 {
  animation: glitch 0.3s ease;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-1px, -1px); filter: hue-rotate(0deg); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

.glitch-active .gateway-grid {
  animation: gridGlitch 0.5s ease;
}

@keyframes gridGlitch {
  0%, 100% { opacity: 0.5; }
  25% { opacity: 1; background-size: 48px 48px; }
  50% { opacity: 0.2; }
  75% { opacity: 0.8; background-size: 52px 52px; }
}

/* Success transition */
.gateway-success .gateway-card {
  animation: successPulse 0.8s ease;
  border-color: var(--accent-emerald);
}

@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 60px 20px rgba(16, 185, 129, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.gateway-success .gateway-submit {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
}

/* Full-screen transition overlay */
.gateway-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.gateway-transition.active {
  opacity: 1;
  pointer-events: all;
}

.gateway-transition .loader {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.1);
  border-top-color: var(--accent-blue);
  animation: spin 0.8s linear infinite;
}

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

.gateway-transition .loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gateway-transition .loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.gateway-transition .loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
  .gateway-card { padding: 28px 20px; }
  .gateway-header h1 { font-size: 1.3rem; }
}
