/* MU Online H5 - GM Studio Obsidian Citadel Login Theme */
:root {
  --bg-void: #07080d;
  --bg-panel: #0d1018;
  --bg-card: rgba(14, 18, 28, 0.88);
  --gold-bright: #f5d88c;
  --gold-mid: #d4a84b;
  --gold-dim: rgba(212, 168, 75, 0.28);
  --crimson: #a81c22;
  --crimson-bright: #e04850;
  --text-main: #f4ecdb;
  --text-muted: #aca28c;
  --font-display: 'Cinzel', Georgia, serif;
  --font-sans: 'Quicksand', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* Fixed Obsidian Citadel Top Navbar matching portal root */
.gm-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(7, 8, 13, 0.94) 0%, rgba(7, 8, 13, 0.72) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 168, 75, 0.24);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.gm-nav-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gm-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.gm-brand img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 10px rgba(212, 168, 75, 0.45));
}

.gm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.gm-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(212, 168, 75, 0.28);
}

.gm-brand-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gm-nav-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 20, 31, 0.88);
  border: 1px solid var(--gold-dim);
  font-size: 0.74rem;
  font-weight: 700;
  color: #e8dcc4;
  white-space: nowrap;
}

.gm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2bd47d;
  box-shadow: 0 0 9px #2bd47d;
}

.gm-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  background: rgba(18, 22, 34, 0.8);
  border: 1px solid var(--gold-dim);
  color: #f0e4ca;
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.gm-nav-btn:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

/* Full-Viewport Citadel Splash Backdrop */
.sanctum-stage {
  position: relative;
  min-height: 100vh;
  padding: 96px 16px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(212, 168, 75, 0.12) 0%, rgba(168, 28, 34, 0.14) 36%, rgba(7, 8, 13, 0.82) 78%, rgba(5, 6, 10, 0.96) 100%),
    url('/assets/portal/mu-login-splash.jpg') center 22% / cover no-repeat fixed;
}

.sanctum-stage::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 8, 13, 0.58) 0%, rgba(7, 8, 13, 0.22) 38%, rgba(7, 8, 13, 0.35) 70%, rgba(7, 8, 13, 0.88) 100%);
}

/* Centered Royal Obsidian Auth Card */
.sanctum-card {
  position: relative;
  z-index: 2;
  width: min(432px, 100%);
  padding: 34px 30px 28px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(16, 20, 31, 0.93) 0%, rgba(10, 12, 19, 0.96) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(212, 168, 75, 0.42);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.85),
    0 0 42px rgba(212, 168, 75, 0.12),
    inset 0 1px 0 rgba(245, 216, 140, 0.24);
  animation: sanctumRise 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.sanctum-card::before,
.sanctum-card::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  border-color: var(--gold-bright);
  opacity: 0.72;
}

.sanctum-card::before {
  top: 10px;
  left: 10px;
  border-top: 2px solid;
  border-left: 2px solid;
  border-top-left-radius: 5px;
}

.sanctum-card::after {
  bottom: 10px;
  right: 10px;
  border-bottom: 2px solid;
  border-right: 2px solid;
  border-bottom-right-radius: 5px;
}

@keyframes sanctumRise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.crest-halo {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(212, 168, 75, 0.22), rgba(168, 28, 34, 0.22) 68%, rgba(10, 12, 19, 0.95));
  border: 1px solid rgba(245, 216, 140, 0.48);
  box-shadow: 0 0 28px rgba(212, 168, 75, 0.24), inset 0 0 12px rgba(245, 216, 140, 0.16);
}

.crest-halo img {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(245, 216, 140, 0.4));
}

.card-kicker {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-mid);
  margin-bottom: 5px;
}

.card-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 2px 16px rgba(212, 168, 75, 0.3);
}

.card-sub {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.rune-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 20px;
}

.rune-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.45), transparent);
}

.rune-divider i {
  width: 8px;
  height: 8px;
  background: var(--gold-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(245, 216, 140, 0.55);
}

.auth-alert {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(168, 28, 34, 0.24);
  border: 1px solid rgba(224, 72, 80, 0.55);
  color: #fecaca;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.auth-alert.show {
  display: block;
  animation: alertShake 0.3s ease;
}

@keyframes alertShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.field-group {
  margin-bottom: 15px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #e4d4b2;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--gold-mid);
  pointer-events: none;
  opacity: 0.85;
}

.input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 40px;
  border-radius: 10px;
  background: rgba(7, 9, 14, 0.86);
  border: 1px solid rgba(212, 168, 75, 0.26);
  color: #faf4e6;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-wrap input::placeholder {
  font-family: var(--font-sans);
  color: rgba(172, 162, 140, 0.52);
}

.input-wrap input:focus {
  background: rgba(10, 13, 21, 0.96);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.16);
}

.toggle-pass {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.toggle-pass:hover {
  color: var(--gold-bright);
  background: rgba(212, 168, 75, 0.1);
}

.submit-btn {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1.5px solid #e7be62;
  background: linear-gradient(180deg, #b82128 0%, #7d1116 62%, #52090c 100%);
  color: #fff4d8;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(184, 33, 40, 0.38),
    inset 0 1px 0 rgba(255, 226, 150, 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.84),
    0 0 34px rgba(242, 207, 126, 0.34),
    inset 0 1px 0 rgba(255, 240, 190, 0.56);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.card-foot {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cbb890;
}

.back-link {
  color: var(--gold-bright);
  transition: opacity 0.15s ease;
}

.back-link:hover {
  opacity: 0.82;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .gm-status-pill { display: none; }
  .sanctum-card { padding: 28px 20px 22px; }
}
