:root {
  color-scheme: light;
  /* 第五屆海報配色（2026-10-27） */
  --ink: #163f45;
  --ink-soft: #56706f;
  --green: #2a8577;
  --green-dark: #1c6c6b;
  --green-pale: #eaf5ef;
  --mint: #b1dcd2;
  --aqua: #8fd5d2;
  --blue: #9cc8ec;
  --line: #d3e4de;
  --paper: #f7fbf9;
  --white: #ffffff;
  --error: #a23d3d;
  --shadow: 0 24px 80px rgba(21, 70, 66, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #e6f2ee;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.page-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  background: var(--paper);
}

.visual-panel {
  position: sticky;
  top: 0;
  min-height: 100svh;
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

.poster-image {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.018);
}

.visual-scrim {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(22, 95, 107, 0) 0%, rgba(22, 95, 107, 0.18) 36%, rgba(20, 78, 86, 0.78) 58%, rgba(18, 70, 78, 0.94) 100%),
    linear-gradient(90deg, rgba(22, 95, 107, 0.1), transparent 55%);
}

.visual-scrim::after {
  content: "";
  position: absolute;
  right: -25%;
  bottom: 10%;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}

.visual-topline,
.visual-footer {
  position: absolute;
  right: clamp(28px, 4vw, 64px);
  left: clamp(28px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.visual-topline {
  top: 34px;
}

.visual-topline::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -16px;
  left: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.32);
}

.visual-index {
  font-family: "Noto Serif TC", serif;
  font-size: 18px;
}

.visual-copy {
  position: absolute;
  right: clamp(28px, 4vw, 64px);
  bottom: clamp(88px, 12vh, 136px);
  left: clamp(28px, 4vw, 64px);
  max-width: 590px;
}

.eyebrow,
.kicker {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.visual-copy h1 {
  max-width: 9ch;
  margin: 0 0 18px;
  font-family: "Noto Serif TC", "PMingLiU", serif;
  font-size: clamp(48px, 5.2vw, 78px);
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: 0 2px 26px rgba(4, 38, 36, 0.28);
}

.visual-copy > p:not(.eyebrow) {
  max-width: 430px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.8;
}

.group-tags {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.group-tags span {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 7px 11px;
  background: rgba(22, 95, 107, 0.32);
  backdrop-filter: blur(8px);
  font-size: 16px;
}

.visual-footer {
  bottom: 28px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.form-panel {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(164, 214, 190, 0.15), transparent 24%),
    var(--paper);
}

.form-panel::before,
.form-panel::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.form-panel::before {
  top: -140px;
  right: -190px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(47, 150, 119, 0.11);
  transform: rotate(24deg);
}

.form-panel::after {
  right: 6%;
  bottom: 12%;
  width: 180px;
  height: 180px;
  background-image:
    linear-gradient(rgba(47, 150, 119, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 150, 119, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: linear-gradient(135deg, transparent, #000 42%, transparent 82%);
}

.site-header,
.form-wrap,
.form-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(34px, 5vw, 72px);
  border-bottom: 1px solid rgba(21, 70, 66, 0.09);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  transform: rotate(-8deg);
}

.brand-mark span {
  display: block;
  border-radius: 2px 2px 1px 1px;
}

.brand-mark span:nth-child(1) {
  height: 62%;
  background: var(--mint);
}

.brand-mark span:nth-child(2) {
  height: 100%;
  background: var(--green);
}

.brand-mark span:nth-child(3) {
  height: 76%;
  background: var(--blue);
}

.brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #165f6b;
}

.brand-copy strong {
  font-family: "Noto Serif TC", serif;
  font-size: 20px;
  line-height: 1.2;
}

.brand-copy small {
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.home-button,
.visibility-button,
.toast button {
  border: 0;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}

.home-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
}

.home-button svg {
  width: 18px;
}

.form-wrap {
  width: min(100%, 560px);
  margin: auto;
  padding: 48px 38px 40px;
}

.step-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 42px;
}

.progress span {
  height: 3px;
  border-radius: 1px;
  background: #dce8e3;
}

.progress .active {
  background: var(--green);
}

.intro .kicker {
  color: var(--green-dark);
}

.intro h2 {
  margin: 9px 0 10px;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(34px, 3.2vw, 46px);
  line-height: 1.2;
}

.intro > p:last-child {
  max-width: 440px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.75;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 32px 0 28px;
  padding: 4px;
  border: 1px solid #dbe8e2;
  border-radius: 6px;
  background: #eef5f1;
}

.tab-button {
  min-height: 43px;
  border: 0;
  border-radius: 4px;
  color: #6b817e;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.tab-button.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 3px 12px rgba(29, 79, 74, 0.1);
}

.account-form {
  display: grid;
  gap: 18px;
}

.account-form[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.label-row label {
  font-size: 17px;
  font-weight: 600;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row > span {
  color: #7d918e;
  font-size: 15px;
}

.input-shell {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  border: 1px solid #cfddd7;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(47, 150, 119, 0.1);
}

.input-shell.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(162, 61, 61, 0.08);
}

.input-shell > svg {
  width: 17px;
  height: 17px;
  color: #78918d;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
}

.input-shell input::placeholder {
  color: #9caaa7;
}

.visibility-button {
  width: 32px;
  height: 32px;
  color: var(--ink-soft);
}

.visibility-button svg {
  width: 17px;
  height: 17px;
}

.field-error {
  min-height: 0;
  margin: -2px 0 0;
  color: var(--error);
  font-size: 15px;
}

.field-error:not(:empty) {
  min-height: 15px;
}

.check-row {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
  cursor: pointer;
}

.check-row.compact {
  margin-top: -3px;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid #b9cbc4;
  border-radius: 3px;
  background: var(--white);
}

.custom-check svg {
  width: 13px;
  height: 13px;
  color: transparent;
  stroke-width: 3;
}

.check-row input:checked + .custom-check {
  border-color: var(--green);
  background: var(--green);
}

.check-row input:checked + .custom-check svg {
  color: var(--white);
}

.check-row input:focus-visible + .custom-check {
  outline: 3px solid rgba(47, 150, 119, 0.16);
}

.check-row a {
  color: var(--green-dark);
  font-weight: 600;
  text-underline-offset: 2px;
}

.consent-error {
  margin-top: -14px;
  padding-left: 29px;
}

.primary-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 20px 0 22px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 12px 24px rgba(47, 150, 119, 0.17);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--green-dark);
  box-shadow: 0 14px 28px rgba(47, 150, 119, 0.24);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button svg {
  width: 18px;
  transition: transform 160ms ease;
}

.primary-button:hover svg {
  transform: translateX(3px);
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 0;
  color: #7a8f8b;
  font-size: 14px;
}

.security-note svg {
  width: 14px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(34px, 5vw, 72px);
  border-top: 1px solid rgba(21, 70, 66, 0.08);
  color: #7b908c;
  font-size: 14px;
}

.form-footer nav {
  display: flex;
  gap: 18px;
}

.form-footer a {
  text-decoration: none;
}

.form-footer a:hover {
  color: var(--green-dark);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c9dfd4;
  border-radius: 7px;
  background: rgba(251, 253, 251, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(14px);
}

.toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
}

.toast-icon svg {
  width: 17px;
}

.toast strong {
  font-size: 17px;
}

.toast p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.toast button {
  width: 32px;
  height: 32px;
}

.toast button svg {
  width: 16px;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  }

  .visual-copy h1 {
    font-size: 48px;
  }
}

@media (max-width: 940px) {
  .page-shell {
    display: block;
  }

  .visual-panel {
    position: relative;
    min-height: 440px;
  }

  .poster-image {
    object-position: center 18%;
  }

  .visual-copy {
    bottom: 70px;
  }

  .visual-copy h1 {
    max-width: none;
    font-size: 46px;
  }

  .visual-copy h1 br {
    display: none;
  }

  .visual-footer {
    bottom: 20px;
  }

  .form-panel {
    min-height: auto;
  }

  .form-wrap {
    padding-top: 52px;
    padding-bottom: 56px;
  }
}

@media (max-width: 560px) {
  .visual-panel {
    min-height: 380px;
  }

  .visual-scrim {
    background: linear-gradient(180deg, rgba(18, 70, 78, 0.2) 0%, rgba(18, 70, 78, 0.72) 32%, rgba(18, 70, 78, 0.9) 100%);
  }

  .visual-topline,
  .visual-copy,
  .visual-footer {
    right: 22px;
    left: 22px;
  }

  .visual-topline {
    top: 24px;
  }

  .visual-copy {
    bottom: 58px;
  }

  .visual-copy h1 {
    margin: 10px 0 10px;
    font-size: 36px;
  }

  .visual-copy > p:not(.eyebrow) {
    font-size: 17px;
  }

  .group-tags {
    margin-top: 14px;
  }

  .visual-footer span:last-child {
    display: none;
  }

  .site-header {
    min-height: 76px;
    padding: 18px 22px;
  }

  .form-wrap {
    padding: 36px 22px 44px;
  }

  .progress {
    margin-bottom: 34px;
  }

  .intro h2 {
    font-size: 32px;
  }

  .tabs {
    margin-top: 27px;
  }

  .form-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 22px 24px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- 後端接入新增：驗證碼按鈕、重設密碼、錯誤提示、忙碌狀態 ---- */
.code-button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green-dark);
  background: var(--white);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.code-button:hover:not(:disabled) { background: var(--green-pale); }
.code-button:disabled { border-color: var(--line); color: #9caaa7; cursor: default; }
.reset-intro { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.reset-back { justify-self: center; margin-top: 4px; }
.primary-button:disabled { opacity: .65; cursor: progress; transform: none; box-shadow: none; }
.toast.is-error .toast-icon { background: var(--error); }

/* 触屏：放大可点区域（不影响桌面） */
@media (pointer: coarse) {
  .code-button { min-height: 44px; }
  .visibility-button { min-width: 44px; min-height: 44px; }
  .check-row { min-height: 40px; align-items: center; }
  .toast button { min-width: 44px; min-height: 44px; }
  .form-footer a, footer a { display: inline-flex; align-items: center; min-height: 40px; }
}
