:root {
  --gate-bg: #06080f;
  --gate-surface: rgba(12, 22, 38, 0.72);
  --gate-border: rgba(255, 255, 255, 0.1);
  --gate-accent: #2dd4bf;
  --gate-accent-dim: rgba(45, 212, 191, 0.15);
  --gate-text: #f4f6f8;
  --gate-muted: rgba(244, 246, 248, 0.62);
  --gate-error: #f87171;
  --gate-radius: 20px;
  font-family:
    'Pretendard Variable',
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--gate-text);
  background: var(--gate-bg);
}

body {
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: hidden;
}

.gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(165deg, #06080f 0%, #0a1220 45%, #06080f 100%);
}

.gate-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.gate-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  animation: gate-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gate-card {
  padding: 32px 28px 28px;
  border-radius: var(--gate-radius);
  border: 1px solid var(--gate-border);
  background: var(--gate-surface);
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.gate-brand img {
  height: 26px;
  width: auto;
}

.gate-brand span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gate-accent);
}

.gate-card h1 {
  margin: 0;
  font-size: clamp(22px, 5.5vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.gate-form {
  margin-top: 24px;
  text-align: center;
}

.gate-field {
  display: block;
}

.gate-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gate-muted);
  text-align: center;
}

.gate-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gate-input-wrap input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  color: var(--gate-text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--gate-border);
  border-radius: 12px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.gate-input-wrap input:focus {
  border-color: color-mix(in srgb, var(--gate-accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--gate-accent-dim);
}

.gate-input-wrap input::placeholder {
  color: rgba(244, 246, 248, 0.28);
}

.gate-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--gate-muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.gate-toggle:hover {
  color: var(--gate-text);
  background: rgba(255, 255, 255, 0.06);
}

.gate-toggle svg {
  width: 20px;
  height: 20px;
}

.gate-error {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gate-error);
  text-align: center;
}

.gate-submit {
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #041018;
  background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 48%, #14b8a6 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25);
}

.gate-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(45, 212, 191, 0.32);
}

.gate-submit:active:not(:disabled) {
  transform: translateY(0);
}

.gate-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.gate-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--gate-border);
  font-size: 12px;
  line-height: 1.5;
  color: var(--gate-muted);
  text-align: center;
}

.gate-foot a {
  color: var(--gate-accent);
  text-decoration: none;
}

.gate-foot a:hover {
  text-decoration: underline;
}

.gate-shake {
  animation: gate-shake 0.45s ease;
}

@keyframes gate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-shell,
  .gate-shake {
    animation: none;
  }
}
