/* ============================================================
   OROGRAPHIC HARBOR GATE — login portal chrome
   WoW crest rings × Zelda shrine glow × Hearthstone foil fields
   Auth, form ids, and /api/login payload stay unchanged.
   ============================================================ */

.login-page {
  min-height: 100svh;
  min-height: 100dvh;
}

.login-page .skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 80;
  padding: 10px 14px;
  border: 1px solid var(--gold, #e8c56d);
  border-radius: 8px;
  background: #1a1204;
  color: var(--gold, #e8c56d);
  font: 700 12px/1 var(--font-display, "Cinzel", Georgia, serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.login-page .skip-link::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  background:
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) top left / 6px 1.5px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) top left / 1.5px 6px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) top right / 6px 1.5px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) top right / 1.5px 6px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) bottom left / 6px 1.5px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) bottom left / 1.5px 6px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) bottom right / 6px 1.5px no-repeat,
    linear-gradient(var(--gold, #e8c56d), var(--gold, #e8c56d)) bottom right / 1.5px 6px no-repeat;
}

.login-page .skip-link:focus {
  top: 12px;
  outline: 2px solid var(--gold, #e8c56d);
  outline-offset: 3px;
}

.login-page .portal-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 28px 24px 36px;
  margin: 0 auto;
}

.login-page .portal-card {
  --gate-gold: rgba(232, 197, 109, 0.55);
  text-align: center;
  padding: 36px 32px 24px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(22, 36, 58, 0.94) 0%, rgba(8, 14, 26, 0.96) 100%);
  border: 1px solid rgba(232, 197, 109, 0.34);
  box-shadow:
    0 0 0 1px rgba(232, 197, 109, 0.08),
    inset 0 1px 0 rgba(245, 217, 138, 0.14),
    0 28px 80px rgba(0, 0, 0, 0.55);
}

.login-page .portal-card::before,
.login-page .portal-card::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border: 1.5px solid var(--gold, #e8c56d);
  opacity: 0.72;
}

.login-page .portal-card::before {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}

.login-page .portal-card::after {
  top: 10px;
  right: 10px;
  border-left: 0;
  border-bottom: 0;
}

.login-page .gate-corners {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

.login-page .gate-corners::before,
.login-page .gate-corners::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--gold, #e8c56d);
  opacity: 0.72;
}

.login-page .gate-corners::before {
  left: 0;
  bottom: 0;
  border-right: 0;
  border-top: 0;
}

.login-page .gate-corners::after {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}

.login-page .portal-crest {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 4px auto 32px;
}

.login-page .crest-orbit,
.login-page .crest-orbit-inner {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-page .crest-orbit {
  inset: -16px;
  border: 1px dashed rgba(232, 197, 109, 0.46);
  box-shadow: 0 0 22px rgba(232, 197, 109, 0.14);
  animation: gate-orbit 28s linear infinite;
}

.login-page .crest-orbit-inner {
  inset: -7px;
  border: 1px solid rgba(232, 197, 109, 0.22);
  animation: gate-orbit-rev 18s linear infinite;
}

.login-page .crest-runes {
  position: absolute;
  inset: -16px;
  animation: gate-orbit 28s linear infinite;
}

.login-page .crest-runes span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 9px;
  margin-left: -1.5px;
  border-radius: 1px;
  background: linear-gradient(180deg, #f5d98a, #c9a227);
  transform-origin: 50% calc(48px + 16px);
  box-shadow: 0 0 8px rgba(232, 197, 109, 0.45);
}

.login-page .crest-runes span:nth-child(1) { transform: rotate(0deg); }
.login-page .crest-runes span:nth-child(2) { transform: rotate(45deg); }
.login-page .crest-runes span:nth-child(3) { transform: rotate(90deg); }
.login-page .crest-runes span:nth-child(4) { transform: rotate(135deg); }
.login-page .crest-runes span:nth-child(5) { transform: rotate(180deg); }
.login-page .crest-runes span:nth-child(6) { transform: rotate(225deg); }
.login-page .crest-runes span:nth-child(7) { transform: rotate(270deg); }
.login-page .crest-runes span:nth-child(8) { transform: rotate(315deg); }

.login-page .portal-crest-core {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  margin: 0;
  border: 2px solid rgba(232, 197, 109, 0.58);
  box-shadow:
    0 0 0 4px rgba(8, 14, 26, 0.85),
    0 0 28px rgba(201, 162, 39, 0.32),
    0 0 40px rgba(33, 108, 204, 0.18);
  animation: gate-pulse 4.8s ease-in-out infinite;
}

.login-page .crest-gem {
  position: absolute;
  left: 50%;
  bottom: -11px;
  z-index: 2;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #f5d98a, #c9a227 55%, #8a6a12);
  box-shadow:
    0 0 0 2px rgba(8, 14, 26, 0.9),
    0 0 14px rgba(232, 197, 109, 0.6);
}

.login-page .eyebrow {
  color: var(--teal, #4ecdc4);
  font-family: var(--font-ui, "Marcellus SC", Georgia, serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.login-page h1 {
  margin-bottom: 10px;
}

.login-page .subhead {
  margin: 0 auto 4px;
  max-width: 34ch;
  font-size: 1rem;
}

.login-page .portal-form {
  gap: 16px;
  margin-top: 22px;
}

.login-page .field,
.login-page .portal-form .field {
  gap: 7px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(232, 197, 109, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(58, 48, 32, 0.92) 0%, rgba(18, 16, 12, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(245, 217, 138, 0.22),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35),
    0 8px 18px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.login-page .field span,
.login-page .portal-form .field span {
  color: var(--gold, #e8c56d);
  font-family: var(--font-ui, "Marcellus SC", Georgia, serif);
  letter-spacing: 0.14em;
}

.login-page .field input,
.login-page .portal-form .field input {
  background: linear-gradient(180deg, #2a2418, #14110c);
  border: 1px solid rgba(232, 197, 109, 0.32);
  border-radius: 4px;
  padding: 11px 12px;
  color: var(--text-data, #e8eaf0);
  min-height: 42px;
  font-family: var(--font-body, "Cormorant Garamond", Georgia, serif);
  font-size: 1.05rem;
}

.login-page .field input::placeholder,
.login-page .portal-form .field input::placeholder {
  color: rgba(244, 221, 164, 0.32);
}

.login-page .field:focus-within,
.login-page .portal-form .field:focus-within {
  border-color: rgba(232, 197, 109, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(245, 217, 138, 0.28),
    0 0 0 1px rgba(232, 197, 109, 0.28),
    0 0 22px rgba(232, 197, 109, 0.16);
}

.login-page .field input:focus,
.login-page .portal-form .field input:focus {
  border-color: var(--gold, #e8c56d);
  box-shadow: 0 0 0 1px rgba(232, 197, 109, 0.28);
}

.login-page .primary-action,
.login-page .portal-form .primary-action {
  position: relative;
  font-family: var(--font-display, "Cinzel", Georgia, serif);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-height: 48px;
  margin-top: 2px;
  border: 1px solid rgba(255, 224, 160, 0.45);
  background: linear-gradient(180deg, #f5d98a 0%, #c9a227 48%, #8a6a12 100%);
  color: #1a0f00;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 24px rgba(201, 162, 39, 0.28);
}

.login-page .primary-action::before,
.login-page .portal-form .primary-action::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
  background:
    linear-gradient(#1a0f00, #1a0f00) top left / 8px 1.5px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) top left / 1.5px 8px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) top right / 8px 1.5px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) top right / 1.5px 8px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) bottom left / 8px 1.5px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) bottom left / 1.5px 8px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) bottom right / 8px 1.5px no-repeat,
    linear-gradient(#1a0f00, #1a0f00) bottom right / 1.5px 8px no-repeat;
}

.login-page .primary-action:hover:not(:disabled),
.login-page .portal-form .primary-action:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 12px 28px rgba(201, 162, 39, 0.42);
}

.login-page .primary-action:focus-visible {
  outline: 2px solid var(--gold, #e8c56d);
  outline-offset: 3px;
}

.login-page .error {
  display: none;
  min-height: 0;
}

.login-page .error:not([hidden]):not(:empty) {
  display: block;
  position: relative;
  margin-top: 14px;
  padding: 13px 16px 13px 46px;
  text-align: left;
  font-family: var(--font-body, "Cormorant Garamond", Georgia, serif);
  font-size: 1rem;
  line-height: 1.45;
  color: #ffd4d4;
  border: 1px solid rgba(255, 140, 120, 0.55);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(140, 28, 28, 0.82), rgba(52, 16, 16, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 196, 160, 0.12),
    0 10px 24px rgba(80, 0, 0, 0.32);
  animation: gate-toast-in 0.35s ease;
}

.login-page .error::before {
  content: "!";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 196, 160, 0.55);
  background: rgba(80, 12, 12, 0.7);
  color: #ffd4d4;
  font-family: var(--font-display, "Cinzel", Georgia, serif);
  font-size: 0.78rem;
  font-weight: 700;
}

.login-page .portal-card.gate-denied {
  animation: gate-shake 0.42s ease;
}

.login-page .portal-footnote {
  margin: 16px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

@keyframes gate-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gate-orbit-rev {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes gate-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(8, 14, 26, 0.85),
      0 0 24px rgba(201, 162, 39, 0.28),
      0 0 36px rgba(33, 108, 204, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(8, 14, 26, 0.85),
      0 0 36px rgba(201, 162, 39, 0.48),
      0 0 52px rgba(33, 108, 204, 0.22);
  }
}

@keyframes gate-toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  .login-page .portal-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 16px 14px 24px;
  }

  .login-page .portal-card {
    width: 100%;
    padding: 26px 16px 18px;
  }

  .login-page .portal-crest {
    width: 80px;
    height: 80px;
    margin-bottom: 26px;
  }

  .login-page .portal-crest-core {
    width: 80px;
    height: 80px;
  }

  .login-page .crest-runes span {
    transform-origin: 50% calc(40px + 16px);
  }

  .login-page h1 {
    font-size: 1.7rem;
  }

  .login-page .subhead {
    font-size: 0.95rem;
    max-width: none;
  }

  .login-page .field input,
  .login-page .portal-form .field input {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page .crest-orbit,
  .login-page .crest-orbit-inner,
  .login-page .crest-runes,
  .login-page .portal-crest-core,
  .login-page .error:not([hidden]):not(:empty),
  .login-page .portal-card.gate-denied {
    animation: none;
  }
}
