:root {
  color-scheme: light;
  --login-ink: #111c2d;
  --login-muted: #59667a;
  --login-line: #b7c4d4;
  --login-blue: #0b66d6;
  --login-blue-dark: #0755b4;
  --login-cyan: #22d3ee;
  --login-emerald: #34d399;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background: #071426;
  color: var(--login-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(380px, 470px) minmax(0, 1fr);
  align-items: center;
  padding: 36px max(28px, 7vw);
  background-color: #071426 !important;
  background-image: url("../Images/login-security-20260916.png") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(2, 10, 24, 0.14);
  pointer-events: none;
}

.login-box {
  position: relative;
  grid-column: 1;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(207, 224, 244, 0.72);
  border-radius: 8px !important;
  background: rgba(247, 250, 254, 0.97);
  box-shadow: 0 28px 80px rgba(0, 8, 24, 0.45), 0 0 0 1px rgba(34, 211, 238, 0.08) !important;
  backdrop-filter: blur(18px);
  animation: login-enter 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login-header {
  position: relative;
  min-height: 136px;
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 26px 30px;
  overflow: hidden;
  background: rgba(7, 27, 50, 0.97);
  border-bottom: 1px solid rgba(34, 211, 238, 0.55);
}

.login-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30%;
  height: 2px;
  background: var(--login-emerald);
  animation: login-scan 3.8s ease-in-out infinite;
}

.login-logo {
  width: 154px;
  max-width: 100%;
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.26));
}

.login-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-product {
  color: #67e8f9;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.login-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: 0;
}

.login-test-version {
  grid-column: 1 / -1;
  margin-top: -7px;
  padding: 6px 9px;
  color: #fef3c7;
  background: rgba(120, 53, 15, 0.66);
  border: 1px solid rgba(254, 243, 199, 0.38);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
}

.login-body {
  padding: 30px 36px 28px;
  background: rgba(248, 251, 255, 0.97);
}

.login-intro {
  margin-bottom: 22px;
}

.login-intro h1 {
  margin: 0;
  color: var(--login-ink);
  font-size: 25px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0;
}

.login-intro p {
  margin: 7px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-field {
  margin-bottom: 16px;
}

.login-field > label {
  display: block;
  margin-bottom: 7px;
  color: #243247;
  font-size: 14px;
  font-weight: 800;
}

.login-input {
  width: 100%;
  min-height: 48px !important;
  display: block;
  margin: 0;
  padding: 10px 13px !important;
  border: 1px solid var(--login-line) !important;
  border-radius: 6px !important;
  outline: none;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 16px !important;
  line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.login-input::placeholder {
  color: #788599;
  opacity: 1;
}

.login-input:hover {
  border-color: #7e91aa !important;
}

.login-input:focus {
  border-color: var(--login-blue) !important;
  box-shadow: 0 0 0 3px rgba(11, 102, 214, 0.16), 0 0 22px rgba(34, 211, 238, 0.08) !important;
}

.login-password-control {
  position: relative;
}

.login-password-control .login-input {
  padding-right: 72px !important;
}

.login-password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 58px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid #cfdae7;
  border-radius: 0 4px 4px 0;
  background: #eef4fb;
  color: var(--login-blue-dark);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: #deebfa;
  color: #063f88;
  outline: none;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 3px 0 19px;
  color: #354359;
  font-size: 14px;
  cursor: pointer;
}

.remember-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--login-blue);
}

.login-actions {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 10px;
}

.login-button {
  min-width: 0;
  min-height: 46px !important;
  border-radius: 6px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.login-button.primary {
  border: 1px solid var(--login-blue) !important;
  background: var(--login-blue) !important;
  color: #ffffff !important;
  box-shadow: 0 9px 22px rgba(11, 102, 214, 0.25) !important;
}

.login-button.primary:hover,
.login-button.primary:focus-visible {
  border-color: var(--login-blue-dark) !important;
  background: var(--login-blue-dark) !important;
  box-shadow: 0 10px 26px rgba(7, 85, 180, 0.32) !important;
  outline: none;
}

.login-button.secondary {
  border: 1px solid #a8b6c8 !important;
  background: #eef3f8 !important;
  color: #223047 !important;
  box-shadow: none !important;
}

.login-button.secondary:hover,
.login-button.secondary:focus-visible {
  border-color: #8192a8 !important;
  background: #e1e9f2 !important;
  outline: none;
}

.login-message {
  margin: 0 0 18px;
  padding: 11px 12px;
  border: 1px solid #f3a6a6;
  border-left: 4px solid #b42318;
  border-radius: 6px;
  background: #fff1f1;
  color: #8f1d1d;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.login-version {
  margin-top: 18px;
  color: #718096;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

@keyframes login-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-scan {
  0%,
  100% {
    width: 24%;
    opacity: 0.75;
  }
  50% {
    width: 100%;
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: 28px 18px;
    background-position: 66% center !important;
  }

  .login-page::before {
    background: rgba(2, 10, 24, 0.38);
  }

  .login-box {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .login-page {
    align-items: center;
    padding: 16px 12px;
    background-position: 69% center !important;
  }

  .login-header {
    min-height: 110px;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 15px;
    padding: 20px;
  }

  .login-logo {
    width: 118px;
  }

  .login-product {
    font-size: 13px;
  }

  .login-title {
    font-size: 19px;
  }

  .login-body {
    padding: 23px 20px 22px;
  }

  .login-intro {
    margin-bottom: 18px;
  }

  .login-intro h1 {
    font-size: 23px;
  }
}

@media (max-height: 720px) and (min-width: 521px) {
  .login-page {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .login-header {
    min-height: 112px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .login-body {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .login-intro {
    margin-bottom: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
