/* 登入頁與首次改密碼頁共用 */
:root { --ink: #14213d; --ink-2: #24345c; --panel: #fff; --muted: #6b7489; --line: #e1e5ee; --soft: #f5f6fa; --gold: #d4a53c; --gold-2: #e9c46a; --bad: #d93025; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(212,165,60,.22), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(64,96,170,.35), transparent 60%),
    linear-gradient(160deg, #1b2b52 0%, var(--ink) 55%, #0d1730 100%);
  overflow-x: hidden;
}
/* 背景淡淡的長條圖 */
.bg-bars { position: fixed; inset: auto 0 0 0; height: 46vh; display: flex; align-items: flex-end; gap: 1.6vw; padding: 0 4vw; opacity: .07; pointer-events: none; z-index: 0; }
.bg-bars i { flex: 1; background: linear-gradient(180deg, var(--gold-2), transparent); border-radius: 6px 6px 0 0; }

.card {
  position: relative; z-index: 1; width: min(400px, 100%); background: var(--panel); border-radius: 22px;
  padding: 40px 34px 30px; display: grid; gap: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(3,8,24,.55), 0 0 0 1px rgba(255,255,255,.06);
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold)); }
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.logo { width: 52px; height: 52px; color: var(--gold); flex: none; filter: drop-shadow(0 6px 14px rgba(212,165,60,.35)); }
h1 { margin: 0; font-size: 24px; letter-spacing: .04em; }
.lead { margin: -6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: #3a4560; }
.box { position: relative; display: flex; align-items: center; }
.box > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: #9aa3b8; pointer-events: none; transition: color .15s; }
.box input {
  width: 100%; font: inherit; font-size: 15px; padding: 13px 44px 13px 42px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--soft); color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s;
}
.box input::placeholder { color: #a8b0c2; }
.box input:focus { outline: none; border-color: var(--ink); background: var(--panel); box-shadow: 0 0 0 4px rgba(20,33,61,.08); }
.box:focus-within > svg { color: var(--ink); }
.eye { position: absolute; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #9aa3b8; display: grid; place-items: center; cursor: pointer; padding: 0; }
.eye:hover { color: var(--ink); background: #eceff5; }
.eye svg { width: 18px; height: 18px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: #3a4560; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #c3c9d6; border-radius: 5px; background: var(--panel); display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.caps { font-size: 12px; color: #b26a00; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.hint.ok { color: #1e8e3e; }

.err { display: none; align-items: center; gap: 8px; color: var(--bad); background: #fdecea; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.err.show { display: flex; }
.err::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.go {
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: .1em; padding: 14px; border: 0; border-radius: 12px; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, var(--ink-2), var(--ink)); box-shadow: 0 10px 22px rgba(20,33,61,.28);
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, box-shadow .12s, opacity .12s;
}
.go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(20,33,61,.34); }
.go:active:not(:disabled) { transform: translateY(0); }
.go:disabled { opacity: .65; cursor: default; }
.go:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.go .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.go.busy .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 4px; cursor: pointer; justify-self: center; }
.link:hover { color: var(--ink); text-decoration: underline; }
.foot { position: relative; z-index: 1; margin-top: 18px; text-align: center; font-size: 12px; color: rgba(255,255,255,.4); letter-spacing: .08em; }
.wrap { display: grid; justify-items: center; width: 100%; }
@media (max-width: 420px) { .card { padding: 34px 22px 24px; } h1 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .go, .go:hover { transition: none; transform: none; } .go .spin { animation-duration: 2s; } }
