:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.12);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #dbe2ea;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family:
    Inter,
    "Noto Sans TC",
    "PingFang TC",
    "Microsoft JhengHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f8fafc;
  color: var(--text-main);
}

button,
input {
  font: inherit;
}

/* =========================
   整體雙欄版型
========================= */
.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.65fr);
  min-height: 100vh;
}

/* =========================
   左側視覺區塊
========================= */
.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #0f172a;
}

.login-visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.03);
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(5, 15, 30, 0.9) 0%,
      rgba(5, 15, 30, 0.72) 42%,
      rgba(5, 15, 30, 0.28) 100%
    );
}

.login-visual-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  max-width: 760px;
  padding: 72px;
  color: #ffffff;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.login-visual-title {
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.05em;
}

.login-visual-title span {
  color: #93c5fd;
}

.login-visual-description {
  max-width: 580px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.85;
}

.login-feature-list {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
}

.feature-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.9);
}

.login-visual-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.footer-line {
  display: block;
  width: 42px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

#loginSlogan {
  transition: opacity 0.35s ease;
}

/* =========================
   右側登入表單
========================= */
.login-form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #ffffff;
}

.login-form-container {
  width: 100%;
  max-width: 420px;
}

/* =========================
   右側品牌標誌
========================= */
.login-brand-logo {
  margin-bottom: 34px;
}

.login-brand-logo-main {
  margin: 0;
  color: #0f172a;
  font-size: 54px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.login-brand-logo-sub {
  margin-top: 8px;
  color: #0284c7;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.login-brand-logo-divider {
  width: 86px;
  height: 3px;
  margin-top: 18px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #0284c7 0%,
    #38bdf8 100%
  );
}

.login-brand-logo-caption {
  margin-top: 14px;
  color: #64748b;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.32em;
}

.login-form-title {
  margin: 0;
  color: var(--text-main);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.login-form-description {
  margin: 12px 0 32px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: #ffffff;
  color: var(--text-main);
  font-size: 15px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* =========================
   密碼小眼睛
========================= */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.password-toggle:hover {
  background: #eff6ff;
  color: var(--primary);
}

.password-toggle:focus-visible {
  outline: 3px solid var(--primary-soft);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.d-none {
  display: none;
}

/* =========================
   錯誤訊息
========================= */
.login-alert {
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  line-height: 1.6;
}

.login-alert ul {
  padding-left: 18px;
  margin: 0;
}

/* =========================
   登入按鈕
========================= */
.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 14px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.login-submit:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

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

.login-footer {
  margin-top: 28px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
}

/* =========================
   平板版
========================= */
@media (max-width: 991px) {
  .login-page {
    display: block;
  }

  .login-visual {
    min-height: 390px;
  }

  .login-visual-content {
    min-height: 390px;
    padding: 42px 30px;
  }

  .login-visual-title {
    font-size: 46px;
  }

  .login-form-section {
    padding: 42px 24px;
  }
}

/* =========================
   手機版
========================= */
@media (max-width: 576px) {
  .login-visual {
    display: none;
  }

  .login-form-section {
    min-height: 100vh;
    padding: 32px 22px;
  }

  .login-brand-logo {
    margin-bottom: 30px;
  }

  .login-brand-logo-main {
    font-size: 46px;
  }

  .login-brand-logo-sub {
    font-size: 24px;
  }

  .login-brand-logo-caption {
    font-size: 13px;
    letter-spacing: 0.26em;
  }

  .login-form-title {
    font-size: 30px;
  }
}