/* ── La Compañía de los Eslabones — portal de acceso ─────────────────────── */

:root {
  --void: #0b0907;
  --ink: #ece0c6;
  --muted: #9c8a68;
  --gold: #c9a14a;
  --gold-hi: #f3dca0;
  --gold-dim: #6f5824;
  --ember: #d9802f;
}

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

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  color: var(--ink);
  font: 17px/1.6 "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background:
    radial-gradient(120% 90% at 50% 8%, #1c160e 0%, #100c08 45%, #070504 100%),
    radial-gradient(80% 60% at 50% 118%, rgba(217,128,47,0.22), transparent 60%),
    var(--void);
  position: relative;
  overflow: hidden;
}

/* faint arcane texture + vignette */
.login-body::before,
.login-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.login-body::before {
  background-image:
    radial-gradient(rgba(201,161,74,0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(75% 65% at 50% 45%, #000 30%, transparent 100%);
}
.login-body::after {
  box-shadow: inset 0 0 220px 80px rgba(0,0,0,0.85);
}

/* drifting embers */
.embers { position: fixed; inset: 0; pointer-events: none; }
.embers span {
  position: absolute;
  bottom: -10vh;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px 2px rgba(217,128,47,0.55);
  opacity: 0;
  animation: rise 13s linear infinite;
}
.embers span:nth-child(1) { left: 12%; animation-duration: 15s; animation-delay: 0s; }
.embers span:nth-child(2) { left: 28%; animation-duration: 11s; animation-delay: 3s; }
.embers span:nth-child(3) { left: 47%; animation-duration: 17s; animation-delay: 6s; }
.embers span:nth-child(4) { left: 63%; animation-duration: 12s; animation-delay: 1.5s; }
.embers span:nth-child(5) { left: 78%; animation-duration: 16s; animation-delay: 4.5s; }
.embers span:nth-child(6) { left: 90%; animation-duration: 14s; animation-delay: 8s; }

@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  12%  { opacity: 0.9; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-118vh) translateX(28px) scale(0.4); opacity: 0; }
}

/* central gate */
.gate {
  position: relative;
  width: 100%;
  max-width: 430px;
  text-align: center;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  background: linear-gradient(180deg, rgba(28,22,14,0.78), rgba(14,11,7,0.86));
  border: 1px solid rgba(201,161,74,0.28);
  border-radius: 14px;
  box-shadow:
    0 30px 80px -30px rgba(0,0,0,0.9),
    0 0 0 1px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(243,220,160,0.08);
  backdrop-filter: blur(2px);
}
/* gilt corner brackets */
.gate::before, .gate::after {
  content: "";
  position: absolute;
  width: 30px; height: 30px;
  border: 2px solid rgba(201,161,74,0.55);
}
.gate::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.gate::after  { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.sigil { width: clamp(120px, 34vw, 160px); margin: 0 auto 1.2rem; }
.sigil img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(201,161,74,0.5));
  animation: pulse 4.5s ease-in-out infinite;
  transform-origin: 50% 50%;
}
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(201,161,74,0.35)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 28px rgba(201,161,74,0.75)); transform: scale(1.025); }
}

.gate-title {
  font-family: "Cinzel", "Trajan Pro", Georgia, serif;
  font-size: clamp(1.6rem, 5.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(201,161,74,0.25);
}
.gate-title span { font-size: 0.7em; font-weight: 600; }

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: 1rem auto 1.1rem;
  color: var(--gold);
}
.rule i { display: block; height: 1px; width: 64px;
  background: linear-gradient(90deg, transparent, rgba(201,161,74,0.7)); }
.rule i:last-child { transform: scaleX(-1); }
.rule .gi { width: 1.25rem; height: 1.25rem; fill: currentColor; opacity: .9; }
.gi { width: 1.1em; height: 1.1em; fill: currentColor; display: inline-block; vertical-align: -0.2em; flex: none; }

.creed {
  color: var(--muted);
  font-style: italic;
  font-size: 1.02rem;
  margin-bottom: 1.6rem;
}

.seal-alert {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: linear-gradient(180deg, rgba(120,42,28,0.55), rgba(70,24,16,0.55));
  border: 1px solid rgba(217,128,47,0.55);
  color: #f1cbb0;
  padding: .65rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.3rem;
  font-size: .95rem;
}

.gate-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.field span .gi { color: var(--gold); width: 1.05rem; height: 1.05rem; }
.field span {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: "Cinzel", Georgia, serif;
  font-size: .68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.field input {
  width: 100%;
  background: rgba(8,6,4,0.85);
  border: 1px solid rgba(201,161,74,0.30);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  padding: .7rem .85rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: #6a5c44; }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(14,10,6,0.95);
  box-shadow: 0 0 0 3px rgba(201,161,74,0.18), 0 0 14px rgba(201,161,74,0.25);
}

.gate-form button {
  position: relative;
  overflow: hidden;
  margin-top: .4rem;
  padding: .8rem 1rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: 700 .9rem "Cinzel", Georgia, serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1b1305;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #a07e35);
  box-shadow: 0 8px 22px -8px rgba(201,161,74,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.gate-form button::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.gate-form button:hover { filter: brightness(1.06); box-shadow: 0 10px 26px -8px rgba(201,161,74,0.85); }
.gate-form button:hover::after { left: 130%; }
.gate-form button:active { transform: translateY(1px); }
.gate-form button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.foot { margin-top: 1.4rem; color: #6a5c44; font-size: .8rem; letter-spacing: 0.05em; }

@media (prefers-reduced-motion: reduce) {
  .sigil img, .embers span, .gate-form button::after { animation: none; transition: none; }
  .embers { display: none; }
}
