/* PRC GATE Login Screen */
.login-page {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.16), transparent 30%),
    radial-gradient(circle at 22% 68%, rgba(14, 165, 233, 0.10), transparent 28%),
    radial-gradient(circle at 78% 28%, rgba(59, 130, 246, 0.10), transparent 30%),
    linear-gradient(120deg, #03101d 0%, #071827 42%, #061022 100%);
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/assets/gate_emblem_large.png');
  background-repeat: no-repeat;
  background-position: center calc(50% + 28px);
  background-size: min(72vw, 920px) auto;
  opacity: 0.095;
  pointer-events: none;
  z-index: 0;
  filter:
    drop-shadow(0 0 20px rgba(56, 189, 248, 0.16))
    drop-shadow(0 0 54px rgba(37, 99, 235, 0.07));
  mix-blend-mode: screen;
}

.login-page::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    radial-gradient(circle at 50% 52%, transparent 0 20%, rgba(2, 6, 23, 0.22) 52%, rgba(2, 6, 23, 0.58) 100%);
  background-size: 4px 4px, 4px 4px, auto;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding-top: max(0px, env(safe-area-inset-top));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.login-card,
.login-card-surface {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 20, 34, 0.82), rgba(3, 12, 24, 0.70)),
    rgba(4, 12, 24, 0.66);
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 1.35rem;
  padding: 1.28rem 1.35rem 1.18rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 24px 52px rgba(0, 0, 0, 0.46),
    0 0 36px rgba(56, 189, 248, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}

.login-card::before,
.login-card-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 211, 252, 0.22), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.16), transparent 26%);
  opacity: 0.72;
}

.login-card::after,
.login-card-surface::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(186, 230, 253, 0.78), rgba(34, 197, 94, 0.28), transparent);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.44);
}

.login-card > *,
.login-card-surface > * {
  position: relative;
  z-index: 1;
}

.login-classification {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 28px;
  padding: 0.34rem 0.65rem;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(34, 197, 94, 0.90));
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.115em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(22, 163, 74, 0.18),
    0 0 14px rgba(34, 197, 94, 0.12);
}

.login-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  padding: 1.02rem 0.2rem 1.02rem;
  text-align: center;
}

.login-command-kicker {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.login-title {
  margin: 0.1rem 0 0;
  color: #f3f9ff;
  font-size: clamp(3.45rem, 12vw, 4.7rem);
  font-weight: 950;
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 24px rgba(56, 189, 248, 0.24);
}

.login-subtitle {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.login-system-name {
  max-width: 310px;
  margin: 0.1rem 0 0;
  color: #e8f6ff;
  font-size: clamp(0.88rem, 2.8vw, 1.02rem);
  font-weight: 950;
  letter-spacing: 0.082em;
  line-height: 1.08;
  text-transform: uppercase;
}

.login-org-line,
.login-beta-line {
  display: none;
}

.login-identity-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  margin-top: 0.78rem;
  padding: 0.45rem 0.56rem;
  gap: 0.5rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.075);
}

.login-identity-strip span {
  color: #b4c6e4;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.105em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.login-identity-strip span:first-child {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-identity-strip span:last-child {
  color: #dff6ff;
  padding-left: 0.58rem;
  border-left: 1px solid rgba(125, 211, 252, 0.22);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.88rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.login-form label {
  color: #b4c6e4;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.105em;
  line-height: 1;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0.78rem 0.92rem;
  border: 1px solid rgba(160, 176, 192, 0.26);
  border-radius: 0.78rem;
  background: rgba(2, 8, 18, 0.54);
  color: #ffffff;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 6px 18px rgba(0,0,0,0.12);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}

.login-form input:focus,
.login-form input:focus-visible {
  outline: 3px solid #00a3ff !important;
  outline-offset: 2px !important;
  border-color: rgba(56, 189, 248, 0.58);
  box-shadow:
    0 0 0 6px rgba(0, 163, 255, 0.23),
    inset 0 1px 0 rgba(255,255,255,0.12) !important;
}

.login-button {
  min-height: 52px;
  width: 100%;
  margin-top: 0.08rem;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 0.82rem;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.95), rgba(34, 197, 94, 0.92));
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 10px 22px rgba(22, 163, 74, 0.20),
    0 0 18px rgba(34, 197, 94, 0.15);
  transition:
    transform 0.16s ease,
    border-radius 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.16s ease;
  will-change: transform, border-radius;
}

.login-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 12px 28px rgba(22, 163, 74, 0.24),
    0 0 22px rgba(34, 197, 94, 0.20);
}

.login-button:active {
  transform: scaleX(0.965) scaleY(1.035) translateY(0) !important;
  border-radius: 38% 62% 42% 58% / 58% 42% 62% 38% !important;
}

.login-button:focus-visible {
  outline: 3px solid #00a3ff !important;
  outline-offset: 2px !important;
  box-shadow:
    0 0 0 6px rgba(0, 163, 255, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 12px 28px rgba(22, 163, 74, 0.24) !important;
}

.login-footer-note {
  margin-top: 0.95rem;
  color: #a0b0c0;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.095em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

#login-message {
  min-height: 22px;
}

.theme-light .login-page::before {
  opacity: 0.055;
  mix-blend-mode: multiply;
  filter: grayscale(0.15) drop-shadow(0 0 14px rgba(2, 132, 199, 0.08));
}

.theme-light .login-title {
  text-shadow: 0 1px 18px rgba(255,255,255,0.72);
}

.theme-light .login-identity-strip span:last-child {
  color: #075985;
}

@media (max-width: 520px) {
  .login-shell {
    max-width: 100%;
  }

  .login-card,
  .login-card-surface {
    padding: 1.08rem;
  }

  .login-title {
    font-size: clamp(3rem, 18vw, 4.25rem);
  }

  .login-identity-strip {
    grid-template-columns: 1fr;
    border-radius: 0.9rem;
  }

  .login-identity-strip span,
  .login-identity-strip span:first-child,
  .login-identity-strip span:last-child {
    text-align: center;
    white-space: normal;
    border-left: 0;
    padding-left: 0;
  }

  .login-classification,
  .login-footer-note {
    font-size: 0.56rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-button,
  .login-button:hover,
  .login-button:active,
  .login-card,
  .login-card-surface {
    transform: none !important;
    border-radius: var(--radius-md) !important;
    transition: none !important;
    animation: none !important;
    filter: none !important;
  }
}
