/* Login redesign — pixel-faithful to Figma node 21:1044.
   750-space px (Figma 402px × 1.866). Blue gradient hero + white sheet.
   The backend-required captcha is requested in a security dialog after
   credentials are submitted, keeping the default screen true to the design. */

#wrapper.ds-login {
    position: relative;
    /* Bound to the body's explicit height so this element scrolls itself —
       body is overflow:hidden, so an unbounded (min-height) wrapper cannot
       scroll on touch devices. */
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
    /* logo 區用正色 #685C20（下半喺 sheet 後面淡出） */
    background: linear-gradient(180deg, #685c20 0%, #685c20 40%, #fefdf6 62%, #ffe8e5 100%);
    font-family: var(--ds-font);
}

/* ── Close (return) ── */
.ds-login-close {
    position: absolute; top: 40px; right: 40px; z-index: 3;
    width: 68px; height: 68px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.ds-login-close:active { background: rgba(255, 255, 255, .34); }
.ds-login-close svg {
    width: 38px; height: 38px;
    fill: none; stroke: currentColor; stroke-width: 2.4;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ── Hero ── */
.ds-login-hero {
    display: flex; flex-direction: column; align-items: center;
    padding: 70px 0 60px;
}
.ds-login-wordmark { position: relative; z-index: 1; width: 280px; height: auto; display: block; }

/* ── White sheet ── */
.ds-login-sheet {
    flex: 1 0 auto;
    margin-top: 0;
    background: var(--ds-surface);
    border-radius: 45px;
    box-shadow: 0 -10px 36px rgba(99, 85, 12, .12);
    padding: 60px 45px 80px;
    position: relative; z-index: 1;
}
.ds-login-title {
    font-size: 41px; line-height: 52px; font-weight: 600;
    letter-spacing: -1px; color: var(--ds-text);
    margin-bottom: 26px;
}

/* ── Fields ── */
.ds-field-row { margin-top: 22px; }
.ds-field-row:first-of-type { margin-top: 0; }
.ds-field {
    display: flex; align-items: center; gap: 12px;
    height: 97px; padding: 0 30px;
    background: #fafafa;
    border: 2px solid var(--ds-border);
    border-radius: 22px;
    box-sizing: border-box;
}
.ds-field input {
    flex: 1 1 auto; min-width: 0;
    height: 93px; border: none; background: transparent;
    font-size: 30px; color: var(--ds-text); font-family: var(--ds-font);
}
.ds-field input::placeholder { color: var(--ds-placeholder); }
.ds-field .num-852 { color: var(--ds-text-tertiary); font-size: 30px; flex: 0 0 auto; }
.ds-field-err { color: var(--ds-danger); font-size: 24px; min-height: 8px; margin-top: 6px; padding-left: 8px; }

/* ── Remember / forgot ── */
.ds-login-row2 { display: flex; align-items: center; margin-top: 24px; }
.ds-remember { display: inline-flex; align-items: center; gap: 12px; color: var(--ds-text); font-size: 26px; cursor: pointer; }
.ds-remember input { width: 30px; height: 30px; accent-color: var(--ds-primary); }
.ds-forgot { margin-left: auto; color: var(--ds-primary); font-size: 26px; font-weight: 500; text-decoration: none; }

/* ── Submit + register ── */
.ds-login-btn {
    display: block; width: 100%;
    height: 97px; margin-top: 34px;
    border: none; border-radius: 22px;
    background: var(--ds-primary); color: #fff;
    font-size: 32px; font-weight: 500; font-family: var(--ds-font);
    cursor: pointer;
}
.ds-login-btn:disabled, .ds-login-btn.disabled-control { background: #b5a75c; }
.ds-login-register { display: block; text-align: center; margin-top: 26px; color: var(--ds-primary); font-size: 26px; text-decoration: none; }

/* Backend-required security check. It is intentionally presented only after
   credentials are submitted so the base screen remains faithful to Figma. */
.pdbox-container.ds-captcha-dialog {
    width: 560px;
    overflow: hidden;
    border-radius: 38px;
    box-shadow: 0 24px 70px rgba(64, 56, 20, .24);
}
.ds-captcha-dialog .pdbox-body {
    padding: 48px 44px 38px;
}
.ds-captcha-dialog .pdbox-body .text {
    padding-top: 0;
    color: var(--ds-text);
    font-size: 28px;
    font-weight: 600;
    line-height: 38px;
}
.captcha-modal-container {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin-top: 28px;
}
#login-modal-captcha-img {
    width: 180px;
    height: 64px;
    display: block;
    cursor: pointer;
    border: 2px solid var(--ds-border);
    border-radius: 14px;
    background: #fff;
    object-fit: contain;
    box-sizing: border-box;
}
#login-modal-captcha-input {
    min-width: 0;
    width: 100%;
    height: 72px;
    padding: 0 18px;
    border: 2px solid var(--ds-border);
    border-radius: 16px;
    background: #fafafa;
    color: var(--ds-text);
    font: 400 25px/1 var(--ds-font);
    letter-spacing: .5px;
    box-sizing: border-box;
}
#login-modal-captcha-input:focus {
    border-color: var(--ds-primary);
    background: #fff;
    outline: none;
}
.ds-captcha-dialog .pdbox-footer { border-color: var(--ds-bg-secondary); }
.ds-captcha-dialog .pdbox-btn {
    height: 94px;
    line-height: 94px;
    border: 0;
    border-radius: 0;
    color: var(--ds-text);
    font: 500 29px/94px var(--ds-font);
}
.ds-captcha-dialog .pdbox-btn-confirm { color: var(--ds-primary); }
.ds-captcha-dialog .pdbox-btn-cancel { border-right: 2px solid var(--ds-bg-secondary); }
