:root {
  color-scheme: light;
  font-family: Arial, "Noto Sans TC", sans-serif;
  color: #111;
  background: #f1f1ef;
}

* { box-sizing: border-box; }
button, input { font: inherit; }
button { color: inherit; }

.auth-body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: #f1f1ef;
}

.auth-page {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
}

.auth-intro {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  border-right: 1px solid #d8d8d4;
  padding: clamp(30px, 5vw, 72px);
  background: #e8e8e5;
}

.auth-intro-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 52% center;
}

.auth-logo {
  position: relative;
  z-index: 1;
  width: clamp(170px, 20vw, 250px);
  display: block;
}

.auth-logo img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.auth-face-head > span {
  display: block;
  color: #656560;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-access {
  min-width: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px;
  background: #fafaf9;
}

.auth-card-stage {
  width: min(470px, 100%);
  height: 570px;
  perspective: 1300px;
  transition: height 420ms cubic-bezier(.2,.8,.2,1);
}

.is-register .auth-card-stage { height: 660px; }

.auth-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(.2,.72,.2,1);
}

.is-register .auth-card { transform: rotateY(180deg); }

.auth-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d9d9d5;
  border-radius: 8px;
  padding: clamp(24px, 4vw, 42px);
  background: #fff;
  box-shadow: 0 24px 68px rgb(26 26 23 / 0.09);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.auth-face-register { transform: rotateY(180deg); }
.auth-face[aria-hidden="true"] { pointer-events: none; }

.auth-mode-switch {
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  border: 1px solid #deded9;
  padding: 3px;
  background: #f3f3f1;
}

.auth-mode-switch button {
  border: 0;
  background: transparent;
  color: #686863;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.auth-mode-switch button[aria-pressed="true"] {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgb(24 24 22 / 0.11);
}

.auth-face-head { margin: 30px 0 24px; }
.auth-face-head h2 { margin: 10px 0 8px; font-size: 28px; font-weight: 600; letter-spacing: 0; }
.auth-face-head p { margin: 0; color: #6a6a65; font-size: 13px; line-height: 1.6; }

.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 7px; color: #33332f; font-size: 12px; font-weight: 700; }
.auth-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #cbcbc5;
  border-radius: 4px;
  padding: 0 12px;
  outline: 0;
  background: #fff;
  color: #111;
  font-size: 14px;
}
.auth-form input:hover { border-color: #999992; }
.auth-form input:focus { border-color: #171715; box-shadow: 0 0 0 3px rgb(23 23 21 / 0.1); }
.auth-form input:disabled { border-color: #deded9; background: #f3f3f1; color: #888883; cursor: not-allowed; }

.auth-note { margin-top: -2px; color: #6a6a65; font-size: 11px; font-weight: 400; }
.auth-status { min-height: 18px; margin: -2px 0 0; color: #b42318; font-size: 12px; line-height: 1.5; }
.auth-status.is-registration-closed { border-left: 2px solid #b42318; padding-left: 9px; }

.auth-submit {
  width: 100%;
  min-height: 46px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 150ms ease, transform 150ms ease;
}
.auth-submit:hover { background: #33332f; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-alt { margin: auto 0 0; padding-top: 22px; color: #6a6a65; text-align: center; font-size: 12px; }
.auth-alt button { border: 0; padding: 0; background: transparent; color: #111; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.auth-shell {
  width: min(420px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: max(40px, 10vh);
}
.auth-brand { margin-bottom: 24px; }
.auth-brand strong { display: block; font-size: 22px; }
.auth-brand span { display: block; margin-top: 6px; color: #686863; font-size: 13px; }
.auth-panel { border: 1px solid #d9d9d5; border-radius: 8px; padding: 28px; background: #fff; box-shadow: 0 20px 50px rgb(26 26 23 / 0.08); }
.auth-panel h1 { margin: 0 0 20px; font-size: 23px; }
.invite-accept-panel > p:not(.auth-status) { margin: 0 0 22px; color: #686863; font-size: 14px; line-height: 1.6; }
.invite-accept-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.invite-accept-actions a { color: #343431; font-size: 13px; }
.invite-accept-actions button { min-height: 42px; border: 0; border-radius: 4px; padding: 0 16px; background: #111; color: #fff; font-weight: 700; cursor: pointer; }
.invite-accept-actions button:disabled { opacity: 0.5; cursor: wait; }

.auth-body.is-invitation-only .auth-mode-switch,
.auth-body.is-invitation-only .auth-alt,
.auth-body.is-invitation-only .auth-face[aria-hidden="true"] {
  display: none;
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-intro { height: clamp(220px, 58vw, 320px); min-height: 0; border-right: 0; border-bottom: 1px solid #d8d8d4; padding: 24px; }
  .auth-logo { width: 150px; }
  .auth-access { min-height: auto; padding: 34px 20px 54px; }
}

@media (max-width: 520px) {
  .auth-access { padding-inline: 14px; }
  .auth-card-stage { height: 540px; }
  .is-register .auth-card-stage { height: 630px; }
  .auth-face { padding: 22px; }
  .auth-face-head { margin: 24px 0 20px; }
  .auth-face-head h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-card-stage { transition: none; }
}
