:root {
  --bg: #0a0a0c;
  --text: #f4f4f6;
  --muted: #8b8b9a;
  --dim: #5c5c6b;
  --accent: #c9a962;
  --accent-glow: rgba(201, 169, 98, 0.3);
  --error: #e85d75;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Playfair Display", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body,
.vault-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: grid;
  place-items: center;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(201, 169, 98, 0.08), transparent 70%);
  pointer-events: none;
}

.gate-grain {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.gate {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.gate-inner {
  text-align: center;
  padding: 48px 32px;
  background: rgba(22, 22, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.gate-mark {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.gate-title {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.gate-sub {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

.gate-form {
  margin-top: 36px;
  text-align: left;
}

.gate-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.gate-input-wrap {
  position: relative;
}

.gate-input-wrap input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: rgba(10, 10, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-input-wrap input:focus {
  border-color: rgba(201, 169, 98, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.gate-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.gate-toggle:hover { color: var(--muted); }
.gate-toggle svg { width: 18px; height: 18px; }

.gate-error {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--error);
}

.gate-error.hidden { display: none; }

.gate-submit {
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #0a0a0c;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.gate-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.gate-submit:active { transform: translateY(0); }
.gate-submit svg { width: 18px; height: 18px; }
.gate-submit:disabled { opacity: 0.6; cursor: wait; }

.gate-back {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.8125rem;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s;
}

.gate-back:hover { color: var(--accent); }

.gate-inner.shake {
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}