/* =========================================================
   AUTH GATE — Private Access Portal
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ivory: #f7f3ec;
  --gold: #b8945a;
  --gold-soft: #d4b176;
  --gold-deep: #8a6c3d;
  --charcoal: #1a1814;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--sans);
  background: #0d0c0a;
  color: var(--ivory);
}

.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

/* Layered animated background */
.gate-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(184,148,90,0.22), transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 0%, rgba(184,148,90,0.10), transparent 70%),
    linear-gradient(180deg, #14110d 0%, #0a0908 100%);
}
.gate-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(212,177,118,0.06) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(184,148,90,0.08) 0, transparent 40%);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(40px, -30px); }
}

/* Particles canvas */
.particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Sacred ornament ring behind logo */
.gate-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 720px; height: 720px;
  margin-top: -360px; margin-left: -360px;
  border-radius: 50%;
  border: 1px solid rgba(184,148,90,0.18);
  z-index: 1;
  pointer-events: none;
  animation: ringRotate 60s linear infinite;
}
.gate-ring::before {
  content: "";
  position: absolute;
  inset: 60px;
  border-radius: 50%;
  border: 1px dashed rgba(184,148,90,0.10);
  animation: ringRotate 80s linear infinite reverse;
}
@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

/* Top-left brand */
.gate-brand {
  position: absolute;
  top: 32px; left: 32px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--ivory);
}
.gate-brand small {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-top: -2px;
}
.gate-brand-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gate-brand-mark::before {
  content: "";
  width: 14px; height: 14px;
  border: 1.5px solid var(--ivory);
  border-radius: 50%;
}

/* Bottom-right credit */
.gate-credit {
  position: absolute;
  bottom: 32px; right: 32px;
  z-index: 4;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(247,243,236,0.45);
}

/* Center card */
.gate-card {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 24px;
  animation: cardIn 1.2s cubic-bezier(.2,.7,.2,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gate-mark {
  width: 88px; height: 88px;
  margin: 0 auto 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 60px rgba(184,148,90,0.4), inset 0 0 20px rgba(255,255,255,0.1);
}
.gate-mark::before {
  content: "";
  width: 40px; height: 40px;
  border: 2px solid var(--ivory);
  border-radius: 50%;
  position: relative;
}
.gate-mark::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(184,148,90,0.4);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0; }
}

.gate-eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.gate-eyebrow::before,
.gate-eyebrow::after {
  content: "";
  width: 24px; height: 1px;
  background: var(--gold);
}

.gate-card h1 {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  color: var(--ivory);
}
.gate-card h1 em {
  font-style: italic;
  color: var(--gold-soft);
}
.gate-card p.intro {
  color: rgba(247,243,236,0.65);
  font-size: 0.95rem;
  margin-bottom: 40px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
.gate-input-wrap {
  position: relative;
}
.gate-input {
  width: 100%;
  padding: 18px 60px 18px 24px;
  background: rgba(247,243,236,0.04);
  border: 1px solid rgba(184,148,90,0.2);
  border-radius: 100px;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-align: center;
  transition: all 240ms ease;
  outline: none;
}
.gate-input::placeholder {
  color: rgba(247,243,236,0.3);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 11px;
}
.gate-input:focus {
  border-color: var(--gold);
  background: rgba(247,243,236,0.06);
  box-shadow: 0 0 0 4px rgba(184,148,90,0.08);
}
.gate-eye {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  color: rgba(247,243,236,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 240ms;
}
.gate-eye:hover { color: var(--gold-soft); }
.gate-eye svg { width: 18px; height: 18px; }

.gate-submit {
  width: 100%;
  padding: 18px 28px;
  background: var(--ivory);
  color: var(--charcoal);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: all 240ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.gate-submit:hover {
  background: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -10px rgba(184,148,90,0.4);
}
.gate-submit:active { transform: translateY(0); }
.gate-submit::after {
  content: "→";
  font-size: 16px;
  transition: transform 240ms;
}
.gate-submit:hover::after { transform: translateX(6px); }

.gate-error {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #d97455;
  text-align: center;
  min-height: 18px;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 240ms;
  text-transform: uppercase;
}
.gate-error.show { opacity: 1; transform: translateY(0); }

.gate-hint {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(247,243,236,0.35);
  margin-top: 32px;
}

/* Shake animation on error */
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* Success transition overlay */
.gate-veil {
  position: fixed;
  inset: 0;
  background: var(--ivory);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.gate-veil.show { opacity: 1; pointer-events: auto; }

@media (max-width: 600px) {
  .gate-brand { top: 20px; left: 20px; }
  .gate-credit { bottom: 20px; right: 20px; font-size: 9px; }
  .gate-ring { width: 480px; height: 480px; margin-top: -240px; margin-left: -240px; }
}
