/* wx-auth-modal-refine.css
   官網全站登入／註冊彈窗（partials/wx_auth_modals.php 的 #loginModal、#registerModal）精緻版外觀（老闆 10/30）。
   只管外觀；登入、註冊、LINE 跳轉的程式在 assets/js/wx-auth-modals.js（首頁 index.php 另有同名函式），本檔不碰。
   配色走官網冷色系（老闆 10/30：電玩店不要暖色、不要深灰、不要白底，要跟「開始購物吧！」同色系的藍）：
   上方色塊與主按鈕都用官網按鈕色 --pos-btn-bg（吃老闆在 POS 設定的官網配色，改配色會跟著變）。LINE 維持最下方圓鈕（老闆 10/30 指定）。
   本檔由 partial 載入，排在 wx-auth-modals.css 與首頁 index.php 內嵌樣式之後；選擇器多一層 .wx-auth-refined 壓過舊規則。
   完善會員資料（#profileCompleteModal）不套。 */

.wx-auth-refined {
    --wxa-ink: var(--pos-text-color, #1e293b); --wxa-mute: #64748b; --wxa-faint: #94a3b8;
    --wxa-line: #e2e8f0; --wxa-field: #f5f7fa; --wxa-field-line: #dde3ea;
    --wxa-btn: var(--pos-btn-bg, var(--button-color, #587493));
    --wxa-line-green: #06c755;
}

/* 遮罩：冷色半透明＋霧化；手機左右各留 16px */
.wm-modal.wx-auth-refined {
    padding: 16px;
    background-color: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* 卡片：高度不超出畫面、超出在卡片內捲（§2.5）；開啟只淡入、不位移（§2.6） */
:is(#loginModal, #registerModal).wx-auth-refined .wm-modal-content {
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.5);
    animation: wxaFadeIn 0.18s ease-out;
}
@keyframes wxaFadeIn { from { opacity: 0; } to { opacity: 1; } }
.wx-auth-refined .wm-modal-content * { box-sizing: border-box; }

/* 上方：跟「開始購物吧！」按鈕同色的莫蘭迪藍（老闆 10/30 指定；不要米色、深灰、白底），左上微亮；白色店名＋標題 */
.wx-auth-refined .auth-hero {
    position: relative;
    padding: 24px 24px 22px;
    background-color: var(--wxa-btn);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
}
.wx-auth-refined p.auth-hero__kicker {
    margin: 0 0 2px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    line-height: 1.6;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-modal-title {
    margin: 0;
    padding-right: 44px;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-align: left;
}

/* 關閉鈕：藍底上的半透明白圓 */
:is(#loginModal, #registerModal).wx-auth-refined .wm-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
:is(#loginModal, #registerModal).wx-auth-refined .wm-modal-close:hover,
:is(#loginModal, #registerModal).wx-auth-refined .wm-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.26);
    color: #fff;
    outline: none;
}

/* 下半：表單 */
.wx-auth-refined .auth-body {
    padding: 22px 24px 22px;
}

/* 「Email 或手機號碼」跟框內提示字重複（§2.7）：畫面不顯示，留給讀屏 */
#loginModal.wx-auth-refined .login-field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 輸入框：淡灰底圓角框，取代原本底線；字 16px（iPhone 點了不放大） */
:is(#loginModal, #registerModal).wx-auth-refined .login-underline-wrap {
    margin: 0 0 12px;
}
:is(#loginModal, #registerModal).wx-auth-refined .login-underline-wrap:not(.login-underline-wrap--pwd) input,
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper {
    width: 100%;
    height: 50px;
    margin: 0;
    border: 1px solid var(--wxa-field-line) !important;
    border-radius: 12px !important;
    background: var(--wxa-field) !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
:is(#loginModal, #registerModal).wx-auth-refined .login-underline-wrap:not(.login-underline-wrap--pwd) input {
    display: block;
    padding: 0 16px !important;
    color: var(--wxa-ink);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper {
    display: flex;
    align-items: center;
    padding: 0 4px 0 16px;
    min-height: 0;
}
:is(#loginModal, #registerModal).wx-auth-refined .login-underline-wrap:not(.login-underline-wrap--pwd) input:focus,
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper:focus-within {
    border-color: var(--wxa-btn) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(88, 116, 147, 0.16) !important;
}
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--wxa-ink);
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    outline: none !important;
    box-shadow: none !important;
}
:is(#loginModal, #registerModal).wx-auth-refined input::placeholder {
    color: var(--wxa-faint);
    font-weight: 500;
    opacity: 1;
}
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper .login-pwd-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--wxa-faint);
    cursor: pointer;
}
:is(#loginModal, #registerModal).wx-auth-refined .password-wrapper .login-pwd-toggle:hover {
    color: var(--wxa-btn);
}

/* 忘記密碼：靠右小字；展開的寄信框換成淡灰 */
#loginModal.wx-auth-refined .auth-forgot-link {
    display: block;
    width: fit-content;
    margin: 10px 2px 16px auto;
    padding: 0;
    color: var(--wxa-mute);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(100, 116, 139, 0.45);
    text-underline-offset: 3px;
}
#loginModal.wx-auth-refined .auth-forgot-link:hover {
    color: var(--wxa-ink);
}
#loginModal.wx-auth-refined .auth-forgot-box {
    margin: 0 0 16px;
    border-left: 3px solid var(--wxa-btn);
    border-radius: 12px;
    background: #f1f5f9;
}

/* 主按鈕：官網按鈕色（跟商品卡、購物車按鈕同色）；滑過只變深、不放大 */
:is(#loginModal, #registerModal).wx-auth-refined .submit-btn {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 0 !important;
    border-radius: 14px;
    background: var(--wxa-btn) !important;
    color: var(--btn-text-color, #fff) !important;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 18px -6px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    transform: none;
    filter: none;
    transition: filter 0.15s ease;
}
:is(#loginModal, #registerModal).wx-auth-refined .submit-btn:hover,
:is(#loginModal, #registerModal).wx-auth-refined .submit-btn:focus-visible {
    transform: none;
    filter: brightness(0.92);
    outline: none;
}
#registerModal.wx-auth-refined .submit-btn {
    margin-top: 4px;
}

/* 切換登入／註冊 */
:is(#loginModal, #registerModal).wx-auth-refined .auth-modal-switch-row {
    margin: 18px 0 0;
    color: var(--wxa-mute);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-modal-switch-link {
    display: inline;
    margin: 0;
    padding: 0 0 0 2px;
    border: 0;
    background: none;
    color: var(--wxa-btn);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-modal-switch-link:hover {
    filter: brightness(0.85);
}

/* 最下方：「其他登入方式」分隔線＋LINE 圓鈕（正式站 https 另有 Google／Facebook 圓鈕） */
.wx-auth-refined .auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: var(--wxa-faint);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.wx-auth-refined .auth-or::before,
.wx-auth-refined .auth-or::after {
    content: "";
    flex: 1 1 0;
    height: 1px;
    background: var(--wxa-line);
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-modal-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    transition: filter 0.15s ease;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link:hover,
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link:focus-visible {
    transform: none;
    filter: brightness(0.96);
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link--line {
    border: 0;
    background: var(--wxa-line-green);
    box-shadow: 0 6px 14px -4px rgba(6, 150, 70, 0.45);
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link--line svg {
    width: 34px;
    height: 34px;
}
:is(#loginModal, #registerModal).wx-auth-refined .auth-social-link--google {
    border-color: var(--wxa-line);
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18);
}

@media (max-width: 480px) {
    .wx-auth-refined .auth-hero { padding: 22px 20px 20px; }
    .wx-auth-refined .auth-body { padding: 20px 20px 20px; }
    :is(#loginModal, #registerModal).wx-auth-refined .auth-modal-title { font-size: 24px; }
    :is(#loginModal, #registerModal).wx-auth-refined .wm-modal-close { top: 14px; right: 14px; }
}
