/* Registration and password recovery — Figma auth flow.
   Auth JS hooks are intentionally kept on their original IDs. */

body:has(.ds-auth) {
    background: #f3efd1;
    overflow: hidden;
}

body:has(.ds-auth) #js-cart-badge,
body:has(.ds-auth) #aniTop,
body:has(.ds-auth) .footer,
body:has(.ds-auth) .footer-bg {
    display: none !important;
}

.ds-auth {
    position: relative;
    /* body is overflow:hidden with an explicit height (basic.js reset_win),
       so this element must be the scroll container. height (not min-height)
       bounds it — min-height let it grow past the clipped body, which made
       the page unscrollable on iOS. */
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--ds-text);
    /* logo 區用正色 #685C20 */
    background: linear-gradient(180deg, #685c20 0, #685c20 290px, #fdfbf0 510px);
    font-family: var(--ds-font);
    -webkit-font-smoothing: antialiased;
}

.ds-auth-hero {
    position: relative;
    height: 285px;
    overflow: hidden;
}

/* 舊設計右下角有個 app-symbol 貼紙；新 logo 係字標，同 wordmark 重複所以拎走 */

.ds-auth-wordmark {
    position: absolute;
    z-index: 2;
    top: 45px;
    left: 45px;
    width: 200px;
    height: auto;
}

.ds-auth-orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .11);
}
.ds-auth-orb--one { width: 390px; height: 390px; top: -235px; right: -80px; }
.ds-auth-orb--two { width: 250px; height: 250px; right: 0; bottom: -155px; }

.ds-auth-sheet {
    position: relative;
    z-index: 3;
    min-height: calc(100% - 235px);
    margin-top: -50px;
    padding: 0 45px 80px;
    border-radius: 48px 48px 0 0;
    background: var(--ds-surface);
    box-shadow: 0 -10px 34px rgba(99, 85, 13, .12);
}

.ds-auth-nav {
    height: 110px;
    display: grid;
    grid-template-columns: 110px 1fr 110px;
    align-items: center;
    margin: 0 -16px;
}

.ds-auth-back.history-back {
    width: 76px;
    height: 76px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    text-indent: 0;
    color: var(--ds-text);
}
.ds-auth-back svg {
    width: 43px;
    height: 43px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ds-auth-nav-title {
    text-align: center;
    font-size: 29px;
    line-height: 40px;
    font-weight: 600;
}
.ds-auth-nav-action {
    justify-self: end;
    color: var(--ds-primary);
    font-size: 26px;
    font-weight: 500;
}

.ds-auth .form-container,
.ds-auth .form-container.box-shadow-light {
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.ds-auth .form-container.is-hidden { display: none; }

.ds-auth-progress {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}
.ds-auth-progress span {
    height: 8px;
    border-radius: 10px;
    background: #efede3;
}
.ds-auth-progress span.is-active,
.ds-auth-progress span.is-done {
    background: var(--ds-primary);
}

.ds-auth-kicker {
    color: var(--ds-primary);
    font-size: 23px;
    line-height: 34px;
    font-weight: 600;
}
.ds-auth-title {
    margin-top: 5px;
    color: var(--ds-text);
    font-size: 43px;
    line-height: 56px;
    font-weight: 700;
    letter-spacing: -1px;
}
.ds-auth-copy {
    margin-top: 12px;
    color: var(--ds-text-tertiary);
    font-size: 25px;
    line-height: 39px;
}

.ds-auth-field-group { margin-top: 30px; }
.ds-auth-label {
    display: block;
    padding-bottom: 12px;
    color: var(--ds-text-secondary);
    font-size: 25px;
    line-height: 34px;
    font-weight: 500;
}

.ds-auth-field,
.ds-auth-identifier {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 94px;
    margin: 0;
    overflow: hidden;
    border: 2px solid var(--ds-border);
    border-radius: 22px;
    background: #fafafa;
    box-sizing: border-box;
}
.ds-auth-field:focus-within {
    border-color: var(--ds-primary-bright);
    box-shadow: 0 0 0 6px rgba(176, 155, 54, .08);
}

.ds-auth .ds-auth-field input,
.ds-auth .ds-auth-identifier input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 90px;
    padding: 0 28px;
    border: 0;
    background: transparent;
    color: var(--ds-text);
    font-family: var(--ds-font);
    font-size: 29px;
    line-height: 90px;
}
.ds-auth input::placeholder { color: var(--ds-placeholder); }

.ds-auth .number-div .num-852 {
    position: static;
    flex: 0 0 auto;
    height: 56px;
    padding: 0 24px 0 28px;
    border-right: 2px solid var(--ds-border);
    color: var(--ds-text-secondary);
    font-size: 28px;
    line-height: 56px;
}
.ds-auth .number-div input { padding-left: 24px !important; }
.ds-auth .email-div input { padding-left: 28px; }

.ds-auth .password-div input { padding: 0 86px 0 28px; }
.ds-auth-eye,
.ds-auth #password-toggle,
.ds-auth #confirm-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 82px;
    height: 90px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-text-tertiary);
    font-size: 28px;
    line-height: 90px;
}

.ds-auth-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 16px;
}
.ds-auth-captcha {
    height: 94px;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--ds-border);
    border-radius: 22px;
    background: #fcfbf8;
}
.ds-auth-captcha img {
    width: 100%;
    height: 90px;
    margin: 0;
    object-fit: contain;
}

.ds-auth .error-text {
    min-height: 10px;
    padding: 7px 4px 0;
    color: var(--ds-danger);
    font-size: 22px;
    line-height: 30px;
}
.ds-auth .error-word { font-size: inherit !important; line-height: inherit; padding: 0 !important; }
/* 推薦碼：標籤「（選填）」後綴 + 校驗成功提示（同 error-text 對稱，佔位一致唔會跳動） */
.ds-auth .ds-auth-optional {
    margin-left: 8px;
    color: var(--ds-text-tertiary);
    font-size: 21px;
    font-weight: 400;
}
.ds-auth .ds-auth-hint {
    min-height: 10px;
    padding: 7px 4px 0;
    color: var(--ds-primary-bright);
    font-size: 22px;
    line-height: 30px;
}
/* 推薦碼一律大階顯示，避免用戶睇落以為打錯 */
.ds-auth #referral-code { text-transform: uppercase; letter-spacing: 4px; }
.ds-auth .password-strength {
    min-height: 20px;
    padding: 7px 4px 0;
    font-size: 21px;
    line-height: 29px;
}

.ds-auth-privacy,
.ds-auth .mask-word {
    margin-top: 24px;
    color: var(--ds-text-tertiary);
    font-size: 22px;
    line-height: 34px;
}
.ds-auth-privacy a { color: var(--ds-primary); }

.ds-auth-primary,
.ds-auth .btn-confirm {
    display: block;
    width: 100%;
    height: 94px;
    margin-top: 30px;
    border: 0;
    border-radius: 22px;
    background: var(--ds-primary);
    color: #fff;
    font-family: var(--ds-font);
    font-size: 30px;
    line-height: 94px;
    font-weight: 600;
    box-shadow: none;
}
.ds-auth-primary:disabled,
.ds-auth-primary.disabled-control,
.ds-auth .btn-confirm:disabled,
.ds-auth .btn-confirm.disabled-control {
    background: #d3c98f;
    color: rgba(255, 255, 255, .9);
}

.ds-auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    color: var(--ds-text-tertiary);
    font-size: 24px;
}
.ds-auth-switch a,
.ds-auth .button-signup-email {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-primary);
    font-size: 24px;
    line-height: 36px;
    font-weight: 500;
}

.ds-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: 78px;
    margin: 28px 0 0;
    padding: 7px;
    border-radius: 22px;
    background: var(--ds-bg-secondary);
}
.ds-auth-tabs .get-code-type-tab {
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 17px;
    background: transparent;
    color: var(--ds-text-tertiary);
    font-family: var(--ds-font);
    font-size: 25px;
}
.ds-auth-tabs .get-code-type-tab.active {
    background: #fff;
    color: var(--ds-primary);
    font-weight: 600;
    box-shadow: var(--ds-shadow-100);
}
.ds-auth-tabs .get-code-type-tab::before { display: none; }

.ds-auth-identifier {
    margin-top: 28px;
    background: var(--ds-primary-tint);
    border-color: #f1ecca;
}
.ds-auth-identifier .fa {
    flex: 0 0 60px;
    color: var(--ds-primary);
    font-size: 30px;
    text-align: right;
}
.ds-auth-identifier input[disabled] {
    opacity: 1;
    color: var(--ds-text-secondary);
    -webkit-text-fill-color: var(--ds-text-secondary);
}
.ds-auth-otp-head {
    display: flex;
    align-items: center;
    margin-top: 30px;
}
.ds-auth-otp-head .ds-auth-label { padding: 0; }
.ds-auth-text-button {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-primary);
    font-family: var(--ds-font);
    font-size: 23px;
}
.ds-auth-text-button:disabled,
.ds-auth-text-button.disabled-control { color: var(--ds-placeholder); }

.ds-auth #code-input-group,
.ds-auth-otp {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 14px;
}
.ds-auth #code-input-group .code-input {
    width: 100%;
    min-width: 0;
    height: 84px;
    padding: 0;
    border: 2px solid var(--ds-border);
    border-radius: 19px;
    background: #fafafa;
    color: var(--ds-text);
    font-family: var(--ds-font-num);
    font-size: 34px;
    line-height: 80px;
    text-align: center;
}
.ds-auth #code-input-group .code-input:focus {
    border-color: var(--ds-primary-bright);
    box-shadow: 0 0 0 5px rgba(176, 155, 54, .08);
}
.ds-auth #code-success .mask-word { margin-top: 13px; }

.ds-auth .fa-spinner {
    display: block;
    margin: 18px auto 0;
    color: var(--ds-primary);
    text-align: center;
}
.ds-auth .is-hidden { display: none !important; }

@media (max-height: 700px) {
    .ds-auth-hero { height: 235px; }
    .ds-auth-wordmark { top: 50px; }
    .ds-auth-sheet { margin-top: -44px; }
}
