/* ============================================
   🔒 Gate page — login before entering site
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.gate {
  position: relative;
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(236, 72, 153, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(251, 191, 36, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #1a0033 0%, #0a0420 50%, #150829 100%);
  background-size: 200% 200%;
  animation: bgShift 12s ease-in-out infinite;
  overflow: hidden;
  padding: 24px;
}

@keyframes bgShift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* Rays from center */
.gate-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200vmax;
  height: 200vmax;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: rayRotate 60s linear infinite;
}

.gate-rays span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 100%;
  background: linear-gradient(to top, transparent, rgba(251, 191, 36, 0.35), rgba(255, 220, 100, 0.5), transparent);
  transform: translate(-50%, -100%) rotate(calc(var(--i) * 45deg));
  filter: blur(1px);
  opacity: 0.6;
}

.gate-rays span:nth-child(2n) {
  background: linear-gradient(to top, transparent, rgba(236, 72, 153, 0.4), rgba(255, 200, 220, 0.55), transparent);
}

@keyframes rayRotate {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

#gate-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Glass card */
.gate-card {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 44px 36px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(236, 72, 153, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: cardEntry 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntry {
  from { opacity: 0; transform: translateY(40px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-rose {
  font-size: 4rem;
  display: inline-block;
  filter: drop-shadow(0 0 24px rgba(251, 191, 36, 0.8));
  animation: roseSwing 3s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes roseSwing {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.05); }
}

.gate-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #fbbf24 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.5));
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.gate-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin-bottom: 28px;
  font-weight: 500;
}

.gate-author {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: 1.4em;
  background: linear-gradient(100deg, #06b6d4, #22d3ee, #a78bfa, #06b6d4);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.6));
  animation: signFlow 5s ease-in-out infinite;
  padding: 0 4px;
}

@keyframes signFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.gate-prompt {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gate-lock {
  display: inline-block;
  font-size: 1.1em;
  animation: lockJiggle 2.5s ease-in-out infinite;
}

@keyframes lockJiggle {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-12deg); }
  94% { transform: rotate(12deg); }
  96% { transform: rotate(-8deg); }
  98% { transform: rotate(8deg); }
}

/* Input + toggle */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input-wrap {
  position: relative;
}

.gate-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.7;
}

#gate-input,
#gate-email {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 50px 14px 46px;
  border-radius: 14px;
  outline: none;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  text-align: left;
}

#gate-input {
  letter-spacing: 0.15em;
  text-align: center;
  padding: 14px 50px 14px 46px;
}

#gate-input::placeholder,
#gate-email::placeholder {
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
  font-weight: 500;
}

#gate-input:focus,
#gate-email:focus {
  border-color: #ec4899;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.2);
}

#gate-input:disabled,
#gate-email:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gate.is-shake #gate-input,
.gate.is-shake #gate-email {
  border-color: #ef4444;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.gate-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.gate-toggle:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.gate-submit {
  background: linear-gradient(135deg, #ec4899 0%, #f97316 50%, #fbbf24 100%);
  color: white;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
}

.gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.55);
}

.gate-submit:active {
  transform: translateY(0);
}

.gate-arrow {
  transition: transform 0.2s;
}

.gate-submit:hover .gate-arrow {
  transform: translateX(4px);
}

.gate-error {
  color: #fca5a5;
  font-size: 0.92rem;
  margin-top: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  height: 0;
  overflow: hidden;
}

.gate.is-shake .gate-error {
  opacity: 1;
  height: auto;
}

.gate-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.gate-footer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  z-index: 5;
  white-space: nowrap;
}

/* Success animation */
.gate.is-success .gate-card {
  animation: successPulse 0.6s ease forwards;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); box-shadow: 0 0 80px rgba(16, 185, 129, 0.6); }
  100% { transform: scale(0.8); opacity: 0; }
}

.gate.is-success {
  animation: gateExit 0.8s ease 0.3s forwards;
}

@keyframes gateExit {
  to { opacity: 0; }
}

@media (max-width: 480px) {
  .gate-card { padding: 36px 24px 28px; }
  .gate-title { font-size: 1.6rem; }
  .gate-rose { font-size: 3.2rem; }
}
