/* ============================================
   PASSWORD GATE — Glassmorphism Entry Screen
   ============================================ */

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FAF5ED 0%, #FDF0E0 25%, #E8F5EE 50%, #FFF9F0 75%, #FAF5ED 100%);
  background-size: 400% 400%;
  animation: gateGradient 12s ease infinite;
  transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s ease;
}

.password-gate.unlocked {
  opacity: 0;
  transform: scale(1.1);
  visibility: hidden;
  pointer-events: none;
}

@keyframes gateGradient {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* Particle Canvas */
.gate-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Light Rays */
.gate-rays {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.gate-rays .ray {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(232, 145, 58, 0.15), transparent);
  animation: rayFloat 8s ease-in-out infinite;
}

.gate-rays .ray:nth-child(1) {
  height: 120%;
  left: 15%;
  top: -10%;
  transform: rotate(15deg);
  animation-delay: 0s;
}

.gate-rays .ray:nth-child(2) {
  height: 100%;
  left: 35%;
  top: 0%;
  transform: rotate(-10deg);
  animation-delay: -2s;
  background: linear-gradient(180deg, transparent, rgba(27, 94, 59, 0.1), transparent);
}

.gate-rays .ray:nth-child(3) {
  height: 130%;
  right: 25%;
  top: -15%;
  transform: rotate(20deg);
  animation-delay: -4s;
}

.gate-rays .ray:nth-child(4) {
  height: 90%;
  right: 10%;
  top: 5%;
  transform: rotate(-15deg);
  animation-delay: -6s;
  background: linear-gradient(180deg, transparent, rgba(197, 165, 90, 0.12), transparent);
}

.gate-rays .ray:nth-child(5) {
  height: 110%;
  left: 55%;
  top: -5%;
  transform: rotate(8deg);
  animation-delay: -3s;
}

@keyframes rayFloat {
  0%, 100% { opacity: 0.3; transform: rotate(var(--ray-rotate, 0deg)) translateY(0); }
  50% { opacity: 0.8; transform: rotate(var(--ray-rotate, 0deg)) translateY(-20px); }
}

/* Gate Container */
.gate-container {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 480px;
  padding: 0 var(--space-xl);
}

/* Gate Logo */
.gate-logo {
  margin-bottom: var(--space-3xl);
  animation: gateFadeUp 1s ease 0.3s both;
}

.gate-logo-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 16px 48px rgba(232, 145, 58, 0.25);
  position: relative;
}

.gate-logo-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  border: 2px solid rgba(232, 145, 58, 0.2);
  animation: pulseRing 3s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0; }
}

.gate-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.gate-logo p {
  font-family: var(--font-accent);
  font-size: var(--fs-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--saffron);
}

/* Gate Card */
.gate-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  box-shadow: 0 24px 64px rgba(26, 25, 24, 0.08);
  animation: gateFadeUp 1s ease 0.6s both;
}

.gate-card h2 {
  font-size: var(--fs-h4);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.gate-card .gate-subtitle {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
}

/* Gate Input Group */
.gate-input-group {
  position: relative;
  margin-bottom: var(--space-xl);
}

.gate-input-group input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(232, 145, 58, 0.15);
  background: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-base);
}

.gate-input-group input::placeholder {
  color: var(--text-muted);
}

.gate-input-group input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(232, 145, 58, 0.1);
  background: var(--white);
}

.gate-input-group .gate-input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: color var(--transition-fast);
}

.gate-input-group input:focus + .gate-input-icon {
  color: var(--saffron);
}

/* Gate Submit */
.gate-submit {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--saffron), var(--saffron-warm));
  color: var(--white);
  font-family: var(--font-accent);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.gate-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(232, 145, 58, 0.35);
}

.gate-submit:hover::after {
  transform: translateX(100%);
}

/* Gate Error */
.gate-error {
  color: #D32F2F;
  font-size: var(--fs-small);
  margin-top: var(--space-md);
  display: none;
  animation: shakeError 0.4s ease;
}

.gate-error.visible {
  display: block;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* Gate Footer */
.gate-footer {
  margin-top: var(--space-2xl);
  animation: gateFadeUp 1s ease 0.9s both;
}

.gate-footer p {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

@keyframes gateFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .gate-card {
    padding: var(--space-2xl);
  }

  .gate-logo h1 {
    font-size: 1.5rem;
  }
}
