/* 登入、註冊、忘記密碼、補綁信箱、重設密碼、封鎖提示（views/web/auth.ejs、/sx/auth/auth.js）。
   外觀：靶道牆（Tina 2026-11-12 定）。共用元件（牆 .w4、金屬牌 .plate、主按鈕 .btn.p、尺寸單位 --u）在 /sx/member/wall.css，
   這裡只排卡片，並把 auth.js 產生的欄位、按鈕、進度線、通知對話框套上同一套樣子。
   排列沿用正式站註冊頁 3 步（Tina 2026-11-11 選樣本 B）：語言在卡片右上、三段進度線、步驟名當標題、「已有帳號？登入」在下方連結列。

/* auth.js 會把 body 縮放成 1920 寬的設計稿（body.style.zoom）。新外觀改用 wall.css 的 --u 依視窗等比，
   字級另有下限（內文 18px、小標籤 14px），所以這裡把縮放關掉，不然會縮兩次、頭盔裡字太小。 */
body.auth { zoom: 1 !important; overflow: auto; --pt: #ece8df; --pt2: #b9b4a8; --pl: rgba(236, 232, 223, .35); }
/* 頁面固定一個畫面高，捲動發生在 .aw 裡：這樣卡片上方的空白才縮得動（見下方 .aw） */
.auth .page { height: 100%; }
/* 卡片位置：上緣固定在「登入卡上下置中」的高度（Tina 2026-11-12 選「固定上緣」）。各頁放得下時，換頁卡片只往下長，標誌不動；
   錯誤字的位置先留好（見 .auth-error），出錯也不會長高。
   --lh 是登入卡高度的估算：照 1280×500～2560×1440 七個尺寸實量（中文 592～1016、英文少 4 像素）用兩條直線取大，誤差約 6 像素內（位置差一半，大約置中）。
   登入卡內容改了要重量。上方的空白用 ::before 撐，可以縮：卡片太高放不下時才往上讓到剛好放得下，再不夠才捲（註冊頁不捲動，Tina 11/11）。 */
.aw { flex: 1; display: flex; flex-direction: column; align-items: center; --pad: max(16px, calc(48 * var(--u))); padding: 0 16px; min-height: 0; overflow-y: auto;
  --lh: max(590px, calc(343px + 380 * var(--u)), calc(66px + 711 * var(--u))); }
.aw::before { content: ""; flex: 0 1 max(var(--pad), calc((100vh - var(--lh)) / 2)); min-height: 8px; }
/* 下方留白也會縮：卡片放不下時上下留白一起縮（最少各 8 像素），還不夠才捲 */
.aw::after { content: ""; flex: 0 1 var(--pad); min-height: 8px; }

/* ---------- 卡片：噴砂黑金屬牌＋四顆內六角螺絲 ---------- */
#login.plate { display: block; flex: none; width: max(520px, calc(680 * var(--u))); max-width: 100%; padding: max(24px, calc(40 * var(--u))) max(28px, calc(56 * var(--u))); --cc: max(10px, calc(16 * var(--u))); }
.scw { position: absolute; width: max(10px, calc(12 * var(--u))); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a5a29a, #4a4844 60%, #262523); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .12); }
.scw::after { content: ""; position: absolute; inset: 28%; background: #1a1918; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.scw.a, .scw.c { left: max(14px, calc(20 * var(--u))); }
.scw.b, .scw.d { right: max(14px, calc(20 * var(--u))); }
.scw.a, .scw.b { top: max(14px, calc(20 * var(--u))); }
.scw.c, .scw.d { bottom: max(14px, calc(20 * var(--u))); }

/* 卡片上緣：標誌＋語言切換 */
.ctop { display: flex; align-items: center; justify-content: space-between; margin-bottom: max(14px, calc(22 * var(--u))); }
.ctop .home { display: block; }
.ctop .lg { height: max(34px, calc(46 * var(--u))); display: block; }
/* 語言：只留地球＋小箭頭，點開選 English／中文（Tina 2026-11-12 15:55 選，跟官網、會員中心同一種）。可點範圍 48 高（頭盔） */
.langw { position: relative; }
.lang { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 8px; margin-right: -8px; background: none; border: 0; font-family: var(--font); color: var(--text2); cursor: pointer; }
.lang .globe { width: max(18px, calc(22 * var(--u))); height: max(18px, calc(22 * var(--u))); }
.lang .chev { width: 12px; height: 12px; opacity: .8; transition: transform .15s; }
.lang:hover, .lang[aria-expanded="true"] { background: rgba(255, 255, 255, .08); color: var(--text); }
.lang[aria-expanded="true"] .chev { transform: rotate(180deg); }
.langm { position: absolute; right: -8px; top: calc(100% + 8px); z-index: 20; min-width: 160px; background: #1d1c17; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .55); }
.langm[hidden] { display: none; }
.langm button { display: flex; align-items: center; width: 100%; min-height: 52px; padding: 0 16px; background: none; border: 0; color: var(--text); font-family: var(--font); font-size: var(--f-body); text-align: left; cursor: pointer; white-space: nowrap; }
.langm button:hover { background: rgba(255, 255, 255, .06); }
.langm button.on { box-shadow: inset 3px 0 0 var(--red); font-weight: 700; }

/* ---------- 表單 ---------- */
.auth-form { display: grid; gap: max(12px, calc(18 * var(--u))); }
/* 標題：官網水泥字（同 wall.css .tt） */
/* 字重：Tina 2026-11-12 要再重一點（選樣本 A）。中文換粗體；英文已是最粗（wght 700），字身由 75 放寬到 85 看起來比較厚 */
.auth-form h1 { font-size: max(36px, calc(56 * var(--u))); font-weight: 700; font-variation-settings: "wght" 700, "wdth" 85; line-height: .95; white-space: nowrap;
  background: url(../img/title-concrete.jpg) 0 0/440px auto repeat; -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-mask-image: url(../img/title-concrete-mask.png); mask-image: url(../img/title-concrete-mask.png);
  -webkit-mask-size: 440px auto; mask-size: 440px auto; -webkit-mask-repeat: repeat; mask-repeat: repeat;
  padding-top: .2em; margin-bottom: -.2em; position: relative; top: -.2em; }
.auth-hint { color: var(--pt2); font-size: var(--f-body); }
.auth-hint b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
/* 欄位之間：每個欄位下方已留一行錯誤字的位置（見 .auth-error），那一行兼當間距，所以這裡只留一點 */
.auth-fields { display: grid; gap: max(8px, calc(12 * var(--u))); }

.auth-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.auth-field > label { font-size: var(--f-lbl); letter-spacing: .14em; text-transform: uppercase; color: var(--pt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-row { display: flex; gap: 12px; align-items: stretch; }
/* 輸入框：亮銀拉絲不鏽鋼、黑字（Tina 2026-11-12 選樣本 B，同會員中心槍卡的金屬）。
   金屬面畫在外層 .auth-input，輸入框本身透明：瀏覽器自動填入時會強制拿掉輸入框自己的底圖、塗成淺藍白，
   畫在外層才不會被拿掉（自動填入的處理見下方）。 */
.auth-input { position: relative; flex: 1; min-width: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .18) 0 1px, rgba(0, 0, 0, .03) 1px 2px, transparent 2px 3px), linear-gradient(180deg, #d9dce0 0%, #c6cacf 50%, #bcc0c5 100%); }
.auth-input input, .auth-input select { display: block; width: 100%; height: max(44px, calc(56 * var(--u))); padding: 0 max(12px, calc(16 * var(--u))); background: transparent; border: 1px solid #050506; border-radius: 0;
  color: #17181a; caret-color: #17181a; font-family: var(--font); font-size: var(--f-body); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4), inset 0 -1px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(255, 255, 255, .09); }
.auth-input input::placeholder { color: #6a6e73; }
.auth-input input:focus, .auth-input select:focus { outline: 2px solid #f2c25a; outline-offset: 2px; }
.auth-input select { appearance: none; padding-right: 40px; cursor: pointer;
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9'><path d='M1 1l6 6 6-6' fill='none' stroke='%2317181a' stroke-width='2'/></svg>") right 14px center/14px 9px no-repeat; }
.auth-input select option { color: #17181a; background: #e4e6e9; }
.auth-input input[type="date"] { color-scheme: light; }
.auth-input input[aria-invalid="true"] { border-color: #b3261e; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4), 0 0 0 1px #b3261e; }
/* 自動填入：瀏覽器會強制把框塗成淺藍白、拿掉底圖（內建且強制，直接改底色蓋不掉）。
   把瀏覽器塗的底色裁進字形裡（background-clip: text），再被深色字蓋住，框維持透明、露出外層金屬。
   不只靠「底色變化延到 10 萬秒」：表單重畫或卡片重新顯示時轉場不會跑，淺藍白會直接出現（另一案 2026-10-13 踩過），轉場只當備援。 */
.auth-input input:-webkit-autofill, .auth-input input:-webkit-autofill:hover, .auth-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: #17181a; caret-color: #17181a; -webkit-background-clip: text; background-clip: text;
  transition: background-color 100000s 0s, color 100000s 0s; }
.auth-error { font-size: var(--f-lbl); color: #ff8a80; min-height: 1.35em; }
/* 錯誤字的位置先留好（Tina 2026-11-12）：沒錯誤時這一行照樣佔位、只是看不到，出錯時卡片不會長高、不會跳 */
.auth-error[hidden] { display: block; visibility: hidden; }

/* 顯示密碼的眼睛：疊在輸入框右側 */
.auth-input input.has-eye { padding-right: 52px; }
.auth-eye { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #3d4146; background: none; border: 0; padding: 0; cursor: pointer; }
.auth-eye:hover, .auth-eye[aria-pressed="true"] { color: #17181a; }
.auth-eye svg { width: 22px; height: 22px; display: block; }
.auth-eye .eye-off { display: none; }
.auth-eye[aria-pressed="false"] .eye-on { display: none; }
.auth-eye[aria-pressed="false"] .eye-off { display: block; }

/* 驗證碼圖片（伺服器產生的白底圖，點一下換一張）：跟輸入框同高 */
.auth-captcha { flex: none; height: max(44px, calc(56 * var(--u))); padding: 0; border: 1px solid #050506; background: #fff; cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, .09); }
.auth-captcha img { display: block; height: 100%; width: auto; }

/* 寄送驗證碼：槍灰金屬次要按鈕（同 wall.css .btn.s） */
.auth-send { flex: none; height: max(44px, calc(56 * var(--u))); padding: 0 max(14px, calc(20 * var(--u))); font-family: var(--font); font-size: var(--f-body); letter-spacing: .04em; text-transform: uppercase; font-variation-settings: "wght" 700, "wdth" 85; white-space: nowrap; cursor: pointer;
  color: var(--text); border: 1px solid #121211; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 3px), linear-gradient(180deg, #5a5853 0%, #3c3b37 45%, #2c2b28 55%, #38372f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -2px 0 rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .35); text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.auth-send:disabled { opacity: .5; cursor: default; }

.auth-form > .btn { width: 100%; margin-top: 4px; }
.auth-form .btn:disabled { opacity: .6; cursor: default; }
.auth-foot { text-align: center; color: var(--pt2); font-size: var(--f-body); }
.auth-foot a { color: var(--text); border-bottom: 2px solid var(--pl); }

/* ---------- 註冊 3 步：三段進度線（完成灰、目前紅，Tina 11/11）＋「Step 1 of 3」，步驟名當標題 ---------- */
.auth-form.auth-steps { gap: max(12px, calc(18 * var(--u))); }
.auth-progress { display: flex; align-items: center; gap: max(16px, calc(24 * var(--u))); }
.auth-bars { flex: 1; display: flex; gap: 6px; }
.auth-bars i { flex: 1; height: 4px; background: rgba(236, 230, 216, .18); }
.auth-bars i.ok { background: var(--text2); }
.auth-bars i.now { background: var(--red); }
.auth-stepno { flex: none; font-size: var(--f-lbl); letter-spacing: .12em; color: var(--pt2); text-transform: uppercase; white-space: nowrap; }
/* 只給螢幕報讀的字（標題裡的「步驟 1／3」） */
.auth-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 姓＋名、性別＋生日同一列 */
.auth-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: max(12px, calc(16 * var(--u))); }
/* 上一步（文字連結）＋主按鈕 */
.auth-acts { display: flex; align-items: center; gap: max(16px, calc(28 * var(--u))); margin-top: 4px; }
.auth-acts .btn { flex: 1; }
.auth-link { flex: none; background: none; border: 0; border-bottom: 2px solid var(--pl); padding: 0 0 2px; font-family: var(--font); font-size: var(--f-body); color: var(--pt2); cursor: pointer; white-space: nowrap; }
.auth-link:hover:not(:disabled) { color: var(--text); }
.auth-link:disabled { opacity: .5; cursor: default; }
/* 第 3 步：寄到哪、重新寄送、改信箱 */
.auth-resend { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* 驗證碼框：大字、置中、字距拉開，好對照信裡的數字 */
.auth-code .auth-input input { height: max(56px, calc(68 * var(--u))); font-family: var(--mono); font-size: max(24px, calc(30 * var(--u))); letter-spacing: .4em; text-align: center; }

/* ---------- 封鎖提示：大字訊息 ---------- */
.auth-blocked { font-size: max(24px, calc(32 * var(--u))); line-height: 1.4; font-weight: 600; color: var(--text); }

/* ---------- 卡片下方：回官網｜登入與忘記密碼切換（或「已有帳號？登入」）、VR 版本號 ---------- */
.links { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: max(16px, calc(22 * var(--u))); padding-top: max(12px, calc(16 * var(--u))); border-top: 1px solid rgba(236, 232, 223, .14); font-size: var(--f-body); white-space: nowrap; }
.links a, .links button { color: var(--text); border: 0; border-bottom: 2px solid var(--pl); background: none; padding: 0 0 2px; font-family: var(--font); font-size: var(--f-body); cursor: pointer; }
.links #auth-extra:empty { display: none; }
/* VR 版本號：收進卡片底邊、下面兩顆螺絲中間，小字、淡，不佔卡片高度（Tina 2026-11-12 要更低調，選樣本 C）。
   卡片 .plate 本身有定位，這裡貼著它的底邊放 */
.auth-version { position: absolute; left: 0; right: 0; bottom: max(10px, calc(16 * var(--u))); margin: 0; text-align: center;
  font: 12px var(--mono); letter-spacing: .06em; color: var(--pt2); opacity: .4; pointer-events: none; }

/* 矮的視窗（頭盔 1280×720）：上下留白縮小，註冊第 1 步出錯時卡片也放得進一個畫面 */
@media (max-height: 760px) {
  .aw { --pad: 12px; }
  .links { margin-top: 12px; padding-top: 10px; }
}

/* ---------- 通知對話框（取代 alert；只能按確定關閉）：同一塊噴砂黑金屬牌 ---------- */
.auth-notice { position: fixed; inset: 0; z-index: 10100; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); }
.auth-notice-box { position: relative; width: max(440px, calc(560 * var(--u))); max-width: calc(100% - 32px); padding: max(24px, calc(36 * var(--u))) max(28px, calc(40 * var(--u))); color: var(--pt);
  --cc: max(8px, calc(12 * var(--u))); clip-path: polygon(var(--cc) 0, calc(100% - var(--cc)) 0, 100% var(--cc), 100% calc(100% - var(--cc)), calc(100% - var(--cc)) 100%, var(--cc) 100%, 0 calc(100% - var(--cc)), 0 var(--cc));
  background: linear-gradient(180deg, #323335 0%, #26272a 50%, #1f2023 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .7); }
.auth-notice-title { font-size: var(--f-lbl); letter-spacing: .14em; text-transform: uppercase; color: var(--pt2); }
.auth-notice-text { margin-top: 14px; font-size: max(18px, calc(22 * var(--u))); line-height: 1.5; overflow-wrap: anywhere; }
.auth-notice-acts { margin-top: max(20px, calc(28 * var(--u))); display: flex; justify-content: flex-end; }
