/* Login page — Hongkong Storage / GWS */

:root {
  --login-ink: #12263a;
  --login-ink-soft: #4a6074;
  --login-paper: #f7f5f1;
  --login-panel: rgba(255, 252, 248, 0.92);
  --login-line: #d8dde3;
  --login-accent: #004483;
  --login-accent-hover: #003566;
  --login-danger: #b42318;
  --login-success: #067647;
  --login-shadow: 0 18px 50px rgba(18, 38, 58, 0.14);
  --login-font: "Manrope", "Segoe UI", sans-serif;
  --login-display: "Source Serif 4", Georgia, serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  min-height: 100vh;
  font-family: var(--login-font);
  color: var(--login-ink);
  background: #1a3348;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  position: relative;
  overflow-x: hidden;
}

.login-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 12% 18%, rgba(47, 122, 118, 0.35), transparent 55%),
    radial-gradient(900px 600px at 88% 82%, rgba(196, 149, 84, 0.18), transparent 50%),
    linear-gradient(155deg, #102536 0%, #1b3a52 48%, #243f4f 100%);
}

.login-atmosphere-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
}

.login-atmosphere-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -80px;
  top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  animation: loginGlow 10s ease-in-out infinite alternate;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-panel {
  background: var(--login-panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  box-shadow: var(--login-shadow);
  padding: 36px 32px 28px;
  animation: loginRise 0.65s ease-out both;
}

.login-brand {
  text-align: center;
  margin-bottom: 8px;
}

.login-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 22px;
  animation: loginFade 0.8s ease-out 0.1s both;
}

.login-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.login-logo-divider {
  width: 1px;
  height: 42px;
  background: var(--login-line);
  flex-shrink: 0;
}

.login-title {
  margin: 0;
  font-family: var(--login-display);
  font-size: clamp(1.55rem, 3.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--login-ink);
  line-height: 1.2;
}

.login-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--login-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-lead {
  margin: 18px 0 22px;
  text-align: center;
  color: var(--login-ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.login-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--login-ink);
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input::placeholder {
  color: #8a9aab;
}

.login-field input:focus {
  outline: none;
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px rgba(0, 68, 131, 0.18);
}

.login-submit {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  background: var(--login-accent);
  color: #fff;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.login-submit:hover {
  background: var(--login-accent-hover);
}

.login-submit:active {
  transform: translateY(1px);
}

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

.login-message {
  min-height: 1.25em;
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: transparent;
}

.login-message.is-error {
  color: var(--login-danger);
}

.login-message.is-success {
  color: var(--login-success);
}

.login-hint {
  margin: -8px 0 18px;
  text-align: center;
  color: var(--login-ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.login-alt-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.login-alt-link a {
  color: var(--login-accent);
  font-weight: 600;
  text-decoration: none;
}

.login-alt-link a:hover {
  text-decoration: underline;
}

.login-field input[readonly] {
  background: #f0f3f6;
  color: var(--login-ink-soft);
  cursor: default;
}

.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--login-line);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--login-ink-soft);
  font-size: 0.78rem;
}

.login-footer-dot {
  opacity: 0.6;
}

@keyframes loginRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loginFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes loginGlow {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  to {
    transform: translate(-30px, 24px) scale(1.08);
    opacity: 1;
  }
}

@media (max-width: 520px) {
  body.login-page {
    padding: 18px 14px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .login-panel {
    padding: 28px 20px 22px;
    border-radius: 14px;
  }

  .login-logos {
    flex-direction: column;
    gap: 12px;
  }

  .login-logo-divider {
    width: 56px;
    height: 1px;
  }

  .login-logo {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-panel,
  .login-logos,
  .login-atmosphere-glow {
    animation: none;
  }
}
