:root {
  --auth-navy: #082f72;
  --auth-blue: #0877e8;
  --auth-cyan: #23b8f3;
  --auth-text: #183a72;
  --auth-muted: #6d82a8;
  --auth-line: #cedcf1;
  --auth-surface: #ffffff;
  --auth-page: #edf7ff;
  --auth-shadow: 0 24px 56px rgba(19, 71, 139, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.community-member-auth-page {
  margin: 0;
  min-width: 320px;
  color: var(--auth-text);
  background: var(--auth-page);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
a { color: inherit; }
.auth-skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--auth-navy);
  transform: translateY(-150%);
}
.auth-skip-link:focus { transform: translateY(0); }

.member-auth-header {
  position: relative;
  z-index: 50;
  height: 82px;
  border-bottom: 1px solid #dce7f6;
  background: rgba(255,255,255,.98);
  box-shadow: 0 7px 22px rgba(23, 72, 139, .07);
}
.member-auth-header__inner {
  width: min(100% - 48px, 1540px);
  height: 100%;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
}
.member-auth-brand { display: flex; align-items: center; width: 208px; }
.member-auth-brand img { display: block; width: 100%; height: auto; }
.member-auth-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 22px;
  min-width: 0;
}
.member-auth-nav { display: flex; justify-content: center; align-items: center; gap: clamp(8px, 1.25vw, 24px); white-space: nowrap; min-width: 0; }
.member-auth-nav a {
  position: relative;
  padding: 9px 2px;
  color: #173c75;
  font-size: clamp(.82rem, .88vw, .98rem);
  font-weight: 800;
  text-decoration: none;
}
.member-auth-nav a::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 1px;
  left: 50%;
  height: 3px;
  border-radius: 999px;
  background: var(--auth-blue);
  transition: left .18s ease, right .18s ease;
}
.member-auth-nav a:hover::after, .member-auth-nav a:focus-visible::after { right: 0; left: 0; }
.member-auth-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.member-auth-actions form { margin: 0; }
.member-auth-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid #78b8ee;
  border-radius: 999px;
  color: #0a529f;
  background: #fff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.member-auth-action--admin { color: #fff; border-color: #1b7fe2; background: linear-gradient(180deg, #36b9f5, #1175db); }
.member-auth-action--login { color: #13508e; border-color: #8ec4ed; }
.member-auth-action--join { color: #493400; border-color: #ffb31b; background: linear-gradient(180deg, #ffe05b, #ffac16); box-shadow: inset 0 2px 0 rgba(255,255,255,.65); }
.member-auth-action:focus-visible, .member-auth-nav a:focus-visible { outline: 3px solid rgba(17, 126, 228, .3); outline-offset: 3px; }
.member-auth-menu { display: none; }

.member-auth-main { display: block; }
.community-auth-shell {
  width: min(100%, 1440px);
  min-height: 940px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 48%) minmax(0, 52%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(166, 202, 236, .35);
}
.community-auth-promo {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #0752ce, #169cea);
}
.community-auth-promo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.community-auth-side {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 72px clamp(28px, 4vw, 68px) 50px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 66%, #eef6ff 100%);
}
.community-auth-side::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 190px;
  background: url('/assets/images/community/auth/member-login/decorative/panel-sparkles.webp') center top / cover no-repeat;
  opacity: .58;
  pointer-events: none;
}
.community-auth-panel { position: relative; z-index: 1; width: min(100%, 610px); }
.community-auth-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 0 0 -2px;
}
.community-auth-tab {
  display: grid;
  place-items: center;
  min-height: 70px;
  padding: 12px 20px;
  border: 2px solid #c7d7ee;
  border-bottom: 0;
  border-radius: 32px 32px 0 0;
  color: #36517f;
  background: rgba(255,255,255,.92);
  font-size: 1.16rem;
  font-weight: 900;
  text-decoration: none;
}
.community-auth-tab:first-child { margin-right: -1px; }
.community-auth-tab[aria-current="page"] {
  z-index: 2;
  color: #fff;
  border-color: #0875e9;
  background: linear-gradient(180deg, #28bef9 0%, #0b80e7 62%, #086bd5 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.58), 0 -5px 18px rgba(5, 114, 218, .15);
}
.community-auth-tab::before { content: "★"; margin-right: 8px; color: #ffcf40; text-shadow: 0 1px 0 #9d6f00; }
.community-auth-tab:focus-visible { outline: 4px solid rgba(7, 123, 231, .28); outline-offset: 2px; }
.community-auth-card {
  position: relative;
  width: 100%;
  min-height: 650px;
  margin: 0;
  padding: 46px 42px 36px;
  border: 2px solid #cfdbef;
  border-radius: 0 0 32px 32px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--auth-shadow), inset 0 0 0 5px rgba(242, 247, 255, .9);
}
.community-auth-welcome { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 30px; }
.community-auth-avatar { display: block; width: 76px; height: 76px; object-fit: contain; }
.community-auth-welcome h1 { margin: 0 0 6px; color: #173d7a; font-size: clamp(1.35rem, 2vw, 1.72rem); line-height: 1.25; }
.community-auth-welcome p { margin: 0; color: var(--auth-muted); font-weight: 600; }
.auth-error, .auth-success {
  margin: 0 0 22px;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 700;
}
.auth-error { color: #9b1c45; border: 1px solid #ffb3cb; background: #fff0f5; }
.auth-success { color: #126444; border: 1px solid #8de0ba; background: #edfff6; }
.auth-error.validation-summary-valid { display: none; }
.auth-error ul { margin: 0; padding-left: 20px; }
.auth-field { margin-bottom: 22px; min-width: 0; }
.auth-field label { display: block; margin-bottom: 8px; color: #234779; font-weight: 900; }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%;
  min-height: 62px;
  padding: 0 67px 0 52px;
  border: 1.5px solid #c8d7eb;
  border-radius: 15px;
  color: #173761;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(31, 76, 129, .04);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-input::placeholder { color: #9aabc3; }
.auth-input:hover { border-color: #8dbce7; }
.auth-input:focus { outline: 0; border-color: #128ee7; box-shadow: 0 0 0 4px rgba(20, 145, 232, .16); }
.auth-input--plain { padding: 0 16px; }
select.auth-input { appearance: auto; }
.auth-input-icon { position: absolute; z-index: 1; top: 50%; left: 20px; color: #709cc6; font-size: .86rem; transform: translateY(-50%); pointer-events: none; }
.auth-input-icon--lock { color: #8a91c4; }
.password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 9px;
  min-width: 50px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  color: #3d6692;
  background: transparent;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { background: #eef7ff; }
.password-toggle:focus-visible { outline: 3px solid rgba(22, 142, 231, .28); }
.auth-field-error { display: block; min-height: 1.2em; margin-top: 5px; color: #ba2455; font-size: .88rem; font-weight: 700; }
.auth-field-error:empty { min-height: 0; margin: 0; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 2px 0 28px; }
.auth-row a { color: #0874d7; font-weight: 800; text-underline-offset: 3px; }
.auth-remember, .auth-terms { display: flex; align-items: flex-start; gap: 9px; color: #405b82; font-weight: 700; cursor: pointer; }
.auth-remember input, .auth-terms input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; accent-color: #168de6; }
.auth-submit {
  position: relative;
  width: 100%;
  min-height: 62px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #23baf8 0%, #0b83e5 64%, #0969cf 100%);
  box-shadow: 0 7px 0 #0755af, 0 14px 24px rgba(0, 105, 206, .24), inset 0 0 0 2px rgba(255,255,255,.66);
  font-size: 1.16rem;
  font-weight: 900;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.auth-submit:hover { filter: brightness(1.04); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(4px); box-shadow: 0 3px 0 #0755af, 0 9px 16px rgba(0, 105, 206, .2), inset 0 0 0 2px rgba(255,255,255,.66); }
.auth-submit:focus-visible { outline: 4px solid rgba(9, 122, 224, .28); outline-offset: 5px; }
.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 35px 0 20px; color: #7889a5; font-size: .9rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: #d7e0ef; }
.external-logins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.external-login { min-height: 50px; border: 1px solid #d1ddec; border-radius: 12px; color: #2a4c78; background: #fff; font-weight: 800; cursor: pointer; }
.external-login:hover { border-color: #81bce8; background: #f3faff; }
.community-auth-register-note { position: relative; z-index: 2; margin: 30px 34px 0 0; text-align: center; color: #536988; font-weight: 700; }
.community-auth-register-note a { color: #0772d5; font-weight: 900; text-underline-offset: 3px; }
.community-auth-mascot { position: absolute; z-index: 1; right: -18px; bottom: -22px; width: 92px; height: auto; pointer-events: none; }

.community-auth-card--register { min-height: 0; padding-top: 36px; }
.community-auth-shell--register { min-height: 1160px; }
.auth-register-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.auth-field--wide { grid-column: 1 / -1; }
.auth-terms { margin: 2px 0 24px; }

.member-auth-cta {
  padding: 24px;
  background: #eaf7ff;
}
.member-auth-cta__inner {
  width: min(100%, 1392px);
  min-height: 132px;
  margin-inline: auto;
  padding: 22px clamp(24px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border: 2px solid #4fb7f2;
  border-radius: 34px;
  color: #fff;
  background: #087adf url('/assets/images/community/auth/member-login/ui/cta-gradient-bg.webp') center / cover no-repeat;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.28), 0 12px 28px rgba(22, 97, 178, .16);
}
.member-auth-cta__copy { display: flex; align-items: center; gap: 22px; min-width: 0; }
.member-auth-cta__copy img { flex: 0 0 auto; width: 92px; height: 92px; object-fit: contain; }
.member-auth-cta h2 { margin: 0 0 5px; color: #ffe75c; font-size: clamp(1.22rem, 2vw, 1.72rem); line-height: 1.3; text-shadow: 0 2px 0 rgba(0, 55, 131, .55); }
.member-auth-cta p { margin: 0; font-weight: 700; }
.member-auth-cta__button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #123e77;
  background: linear-gradient(180deg, #ffe769, #ffad20);
  box-shadow: 0 5px 0 #c96e00, inset 0 2px 0 rgba(255,255,255,.8);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.member-auth-cta__button:focus-visible { outline: 4px solid rgba(255,255,255,.7); outline-offset: 4px; }

.member-auth-footer {
  position: relative;
  padding: 48px 24px 18px;
  color: #e5f3ff;
  background: #05275c url('/assets/images/community/auth/member-login/ui/footer-gradient-bg.webp') center / cover no-repeat;
}
.member-auth-footer__inner { width: min(100%, 1320px); margin-inline: auto; display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: clamp(32px, 5vw, 76px); }
.member-auth-footer__brand img { display: block; width: min(100%, 220px); height: auto; filter: drop-shadow(0 3px 7px rgba(0,0,0,.22)); }
.member-auth-footer__brand p { max-width: 330px; margin: 18px 0 0; }
.member-auth-footer h2 { margin: 0 0 15px; color: #fff; font-size: 1rem; }
.member-auth-footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.member-auth-footer nav a { color: #d7eaff; text-decoration: none; }
.member-auth-footer nav a:hover { color: #fff06a; text-decoration: underline; }
.member-auth-footer__copyright { width: min(100%, 1320px); margin: 34px auto 0; padding-top: 15px; border-top: 1px solid rgba(195, 224, 255, .22); text-align: center; color: #a9c5e6; font-size: .86rem; }
.member-auth-back-top {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  color: #fff;
  background: rgba(21, 91, 172, .86);
  box-shadow: 0 6px 18px rgba(0, 45, 106, .25);
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.member-auth-back-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 1279px) {
  .member-auth-header__inner { width: min(100% - 32px, 1200px); grid-template-columns: 180px minmax(0, 1fr); gap: 14px; }
  .member-auth-brand { width: 180px; }
  .member-auth-navigation { gap: 12px; }
  .member-auth-nav { gap: 8px; }
  .member-auth-nav a { font-size: .78rem; }
  .member-auth-action { padding-inline: 12px; font-size: .86rem; }
  .community-auth-shell { grid-template-columns: minmax(0, 44%) minmax(0, 56%); }
  .community-auth-side { padding-inline: 36px; }
}

@media (max-width: 1079px) {
  .member-auth-header { height: 74px; }
  .member-auth-header__inner { grid-template-columns: 190px minmax(0, 1fr) 48px; }
  .member-auth-brand { width: 190px; }
  .member-auth-menu {
    grid-column: 3;
    display: grid;
    place-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    border: 1px solid #9cc8ed;
    border-radius: 13px;
    background: #f4faff;
    cursor: pointer;
  }
  .member-auth-menu span { display: block; width: 23px; height: 3px; border-radius: 999px; background: #185f9f; }
  .member-auth-navigation {
    position: absolute;
    top: 74px;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - 74px);
    padding: 20px;
    overflow: auto;
    border-top: 1px solid #d7e5f3;
    background: #fff;
    box-shadow: 0 18px 30px rgba(20, 61, 112, .16);
  }
  .member-auth-navigation.is-open { display: block; }
  .member-auth-nav { display: grid; grid-template-columns: repeat(4, 1fr); white-space: normal; }
  .member-auth-nav a { padding: 12px; border-radius: 10px; background: #f1f8ff; text-align: center; font-size: .92rem; }
  .member-auth-actions { margin-top: 16px; justify-content: center; flex-wrap: wrap; }
  .community-auth-shell { min-height: 850px; }
}

@media (max-width: 767px) {
  .member-auth-header__inner { width: calc(100% - 24px); grid-template-columns: 170px minmax(0, 1fr) 46px; }
  .member-auth-brand { width: 170px; }
  .member-auth-nav { grid-template-columns: repeat(2, 1fr); }
  .community-auth-shell, .community-auth-shell--register {
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .community-auth-side { order: 1; padding: 34px 18px 40px; }
  .community-auth-promo { order: 2; height: auto; max-height: 680px; }
  .community-auth-promo { aspect-ratio: 497 / 680; }
  .community-auth-promo img { position: absolute; height: 100%; max-height: 680px; object-fit: cover; object-position: center top; background: #0966d8; }
  .community-auth-tab { min-height: 60px; border-radius: 25px 25px 0 0; font-size: 1rem; }
  .community-auth-card { min-height: 0; padding: 32px 24px 30px; }
  .community-auth-welcome { grid-template-columns: 64px minmax(0, 1fr); margin-bottom: 25px; }
  .community-auth-avatar { width: 64px; height: 64px; }
  .auth-register-grid { grid-template-columns: 1fr; }
  .auth-field--wide { grid-column: auto; }
  .member-auth-cta { padding: 14px; }
  .member-auth-cta__inner { display: grid; padding: 24px; border-radius: 26px; }
  .member-auth-cta__copy { align-items: flex-start; }
  .member-auth-cta__copy img { width: 72px; height: 72px; }
  .member-auth-cta__button { width: 100%; white-space: normal; text-align: center; }
  .member-auth-footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .member-auth-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 479px) {
  .member-auth-header { height: 68px; }
  .member-auth-header__inner { grid-template-columns: 156px minmax(0, 1fr) 44px; }
  .member-auth-brand { width: 156px; }
  .member-auth-menu { width: 42px; height: 42px; }
  .member-auth-navigation { top: 68px; max-height: calc(100vh - 68px); padding: 14px; }
  .member-auth-nav { gap: 7px; }
  .member-auth-nav a { padding: 10px 7px; font-size: .84rem; }
  .community-auth-side { padding: 24px 12px 30px; }
  .community-auth-tab { min-height: 56px; padding-inline: 8px; font-size: .92rem; }
  .community-auth-card { padding: 27px 18px 28px; border-radius: 0 0 25px 25px; }
  .community-auth-welcome { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .community-auth-avatar { width: 56px; height: 56px; }
  .community-auth-welcome h1 { font-size: 1.25rem; }
  .community-auth-welcome p { font-size: .9rem; }
  .auth-input { min-height: 58px; }
  .auth-row { align-items: flex-start; font-size: .9rem; }
  .external-logins { grid-template-columns: 1fr; }
  .community-auth-register-note { margin-right: 44px; font-size: .9rem; }
  .community-auth-mascot { right: -11px; width: 76px; }
  .member-auth-cta__copy { display: grid; text-align: center; }
  .member-auth-cta__copy img { margin-inline: auto; }
  .member-auth-footer { padding-inline: 20px; }
  .member-auth-footer__inner { grid-template-columns: 1fr; }
  .member-auth-footer__brand { grid-column: auto; }
  .member-auth-back-top { right: 12px; bottom: 12px; width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
