:root {
  --login-navy: #0b1f44;
  --login-ink: #20324d;
  --login-muted: #6d7d91;
  --login-green: #009b67;
  --login-green-dark: #087a52;
  --login-mint: #e9f7f1;
  --login-canvas: #f3f7f6;
  --login-line: #dbe6e2;
  --login-danger: #c63f4a;
}

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

body {
  min-width: 320px;
  color: var(--login-ink);
  background: var(--login-canvas);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.page-wrapper {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: transparent;
}

.page-wrapper::before,
.page-wrapper::after {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(0, 155, 103, .13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.page-wrapper::before {
  top: -320px;
  left: -240px;
  width: 720px;
  height: 720px;
}

.page-wrapper::after {
  right: -250px;
  bottom: -420px;
  width: 760px;
  height: 760px;
}

.main {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: clamp(22px, 4vw, 58px);
}

.layout-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  width: min(1220px, 100%);
  min-height: min(720px, calc(100svh - 72px));
  overflow: visible;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.layout-card::after {
  display: none;
}

.brand-panel {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(34px, 5vw, 70px) clamp(32px, 5vw, 72px) clamp(30px, 4vw, 56px) 10px;
  color: var(--login-navy);
  background: transparent;
}

.brand-panel::before {
  top: auto;
  right: 8%;
  bottom: 10%;
  left: auto;
  width: 86px;
  height: 86px;
  background-image: radial-gradient(circle, rgba(0, 155, 103, .23) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: .55;
}

.brand-header {
  gap: 14px;
}

.brand-logo-wrap {
  width: 64px;
  height: 64px;
  background: #fff;
  border: 1px solid var(--login-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(11, 31, 68, .07);
  backdrop-filter: none;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(42, 78, 194, .18));
  transition: transform .24s ease;
}

.brand-header:hover .brand-logo {
  transform: translateY(-2px) rotate(-2deg);
}

.brand-lockup {
  min-width: 0;
}

.brand-company-name {
  color: var(--login-navy);
  font-size: 27px;
  font-weight: 950;
  letter-spacing: .12em;
  line-height: 1;
}

.brand-title-main {
  margin-top: 6px;
  color: var(--login-navy);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .02em;
}

.brand-title-sub {
  margin-top: 4px;
  color: var(--login-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
}

.brand-body {
  margin-top: clamp(42px, 6vh, 72px);
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--login-green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.brand-eyebrow::before {
  width: 28px;
  height: 2px;
  background: var(--login-green);
  content: "";
}

.brand-body > p {
  max-width: 580px;
  margin: 20px 0 0;
  color: var(--login-muted);
  font-size: 15px;
  line-height: 1.85;
}

.brand-news {
  max-width: 610px;
  margin-top: 34px;
}

.brand-news-title {
  margin-bottom: 10px;
  color: var(--login-navy);
  font-size: 12px;
}

.brand-news-title i {
  color: var(--login-green);
}

#announcementList {
  height: clamp(190px, 30vh, 300px);
  max-height: clamp(190px, 30vh, 300px);
  padding-right: 5px;
  overflow-y: auto;
  scrollbar-color: rgba(0, 127, 85, .38) rgba(0, 127, 85, .08);
  scrollbar-width: thin;
}

#announcementList::-webkit-scrollbar {
  width: 7px;
}

#announcementList::-webkit-scrollbar-track {
  background: rgba(0, 127, 85, .08);
  border-radius: 999px;
}

#announcementList::-webkit-scrollbar-thumb {
  background: rgba(0, 127, 85, .38);
  border-radius: 999px;
}

.news-item {
  margin-top: 0;
  padding: 13px 15px 13px 20px;
  color: var(--login-ink);
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--login-line);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
}

.news-item + .news-item {
  margin-top: 8px;
}

.news-item::before {
  top: 12px;
  bottom: 12px;
  left: 9px;
  width: 3px;
  background: var(--login-green);
}

.news-date {
  margin-bottom: 3px;
  color: var(--login-green-dark);
  font-size: 11px;
  font-weight: 800;
}

.news-text {
  color: var(--login-ink);
  font-size: 11px;
  line-height: 1.6;
}

.brand-footer {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  color: var(--login-muted);
  font-size: 11px;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--login-green-dark);
  font-weight: 750;
}

.system-status i {
  width: 8px;
  height: 8px;
  background: var(--login-green);
  border: 2px solid #c8ebdc;
  border-radius: 50%;
  box-sizing: content-box;
}

.login-panel {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  margin: 18px 0;
  padding: clamp(42px, 5vw, 70px) clamp(34px, 4vw, 58px);
  background: #fff;
  border: 1px solid var(--login-line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(11, 31, 68, .11);
}

.login-header {
  margin-bottom: 26px;
}

.login-mobile-brand {
  display: none;
}

.login-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--login-green-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
}

.login-subtitle > span {
  width: 7px;
  height: 7px;
  background: var(--login-green);
  border-radius: 50%;
}

.login-title {
  margin: 0;
  color: var(--login-navy);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.login-tip {
  margin: 9px 0 0;
  color: var(--login-muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-card-inner {
  margin-top: 0;
}

.alert {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.form-row {
  margin-bottom: 17px;
}

.form-label {
  margin-bottom: 7px;
  color: var(--login-ink);
  font-size: 13px;
  font-weight: 800;
}

.form-label i {
  width: 16px;
  color: var(--login-green-dark);
  text-align: center;
}

.input-wrap input {
  height: 48px;
  padding: 11px 44px 11px 14px;
  color: var(--login-navy);
  background: #fbfdfc;
  border: 1px solid #cfded8;
  border-radius: 9px;
  font-size: 14px;
}

.input-wrap input:hover {
  border-color: #a9c9bc;
}

.input-wrap input:focus {
  background: #fff;
  border-color: var(--login-green);
  box-shadow: 0 0 0 3px rgba(0, 155, 103, .12);
}

.input-icon-right,
.password-toggle {
  right: 14px;
  color: #8a9aab;
}

.password-toggle {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--login-green-dark);
  background: var(--login-mint);
  outline: none;
}

.helper-text {
  margin-top: 6px;
  color: #8493a5;
  font-size: 10px;
}

.login-options {
  align-items: flex-start;
  margin: 4px 0 22px;
  color: var(--login-muted);
  font-size: 11px;
}

.login-options > span {
  text-align: right;
}

.login-options input[type="checkbox"] {
  accent-color: var(--login-green);
}

.login-btn {
  height: 48px;
  margin-top: 0;
  color: #fff;
  background: var(--login-green);
  border-radius: 9px;
  box-shadow: 0 10px 22px rgba(0, 155, 103, .18);
  font-size: 14px;
  font-weight: 850;
}

.login-btn:hover {
  background: var(--login-green-dark);
  box-shadow: 0 13px 26px rgba(0, 122, 82, .22);
  filter: none;
}

.login-btn:focus-visible {
  outline: 3px solid rgba(0, 155, 103, .22);
  outline-offset: 3px;
}

.login-extra {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
  color: #8a98a9;
  font-size: 10px;
}

.login-extra span + span::before {
  margin: 0 8px;
  color: #b8c3ce;
  content: "·";
}

.brand-panel > div,
.login-panel {
  animation: login-rise .48s ease-out both;
}

.login-panel {
  animation-delay: .08s;
}

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

@media (max-width: 1024px) {
  .layout-card {
    grid-template-columns: minmax(0, 1fr) minmax(390px, .86fr);
  }

  .brand-panel {
    padding-right: 34px;
  }

}

@media (max-width: 820px) {
  .main {
    align-items: flex-start;
    padding: 18px;
  }

  .layout-card {
    display: block;
    width: min(520px, 100%);
    min-height: 0;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    margin: 0;
    padding: 38px 34px;
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    color: var(--login-navy);
    font-size: 14px;
    font-weight: 850;
  }

  .login-mobile-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }
}

/* Short desktop displays (for example 1366x768) must keep the full form visible. */
@media (min-width: 821px) and (max-height: 820px) {
  .main {
    align-items: flex-start;
    padding: 16px clamp(20px, 3vw, 38px);
  }

  .layout-card {
    min-height: calc(100svh - 32px);
  }

  .brand-panel {
    padding: 24px 34px 20px 10px;
  }

  .brand-body {
    margin-top: 22px;
  }

  .brand-body > p {
    margin-top: 12px;
    line-height: 1.65;
  }

  .brand-news {
    margin-top: 18px;
  }

  #announcementList {
    height: clamp(150px, 24vh, 210px);
    max-height: clamp(150px, 24vh, 210px);
  }

  .brand-footer {
    margin-top: 14px;
  }

  .login-panel {
    margin: 0;
    padding: 26px 34px;
  }

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

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

  .form-row {
    margin-bottom: 12px;
  }

  .login-options {
    margin: 2px 0 14px;
  }

  .login-extra {
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .main {
    min-height: 100svh;
    padding: 10px;
  }

  .login-panel {
    min-height: calc(100svh - 20px);
    padding: 28px 20px;
    border-radius: 18px;
  }

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

  .login-options {
    flex-direction: column;
    gap: 8px;
  }

  .login-options > span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-panel > div,
  .login-panel,
  .login-btn {
    animation: none !important;
    transition: none !important;
  }
}
