/**
 * 登录 / 注册 — 主站门户内嵌（含头部 / 底部）
 * 依赖：home.css（固定顶栏）+ portal 挂载的 home-mall.css
 */

.auth-shell {
    --auth-surface: var(--surface, #fff);
    --auth-border: var(--border-strong, #d5dde5);
    --auth-radius: var(--radius, 6px);
    --auth-radius-sm: var(--radius-sm, 4px);
    margin-top: var(--mall-header-h, 164px);
    padding: var(--mall-block, 20px) 0 var(--mall-section, 40px);
    background: var(--bg, #f3f6f9);
    min-height: calc(100vh - var(--mall-header-h, 164px) - 320px);
}

.auth-shell__inner {
    max-width: var(--content, 1200px);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--pad-x, 24px);
    box-sizing: border-box;
}

.auth-shell .mall-list__crumb {
    margin-bottom: 16px;
}

/* 双栏：左宣传 + 右表单 */
.auth-board {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
    background: var(--auth-surface);
    border: 1px solid var(--border, #e8edf2);
    border-radius: var(--auth-radius);
    box-shadow: var(--shadow, 0 1px 3px rgba(15, 32, 48, .05));
    overflow: hidden;
    min-height: 480px;
}

.auth-board__promo {
    position: relative;
    color: #fff;
    background: linear-gradient(155deg, var(--brand, #00a0e9) 0%, var(--brand-dark, #0088cc) 48%, var(--brand-deep, #006ba3) 100%);
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.auth-board__promo::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 60% 35%, rgba(255, 255, 255, .2), transparent 60%),
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: auto, 44px 32px, 44px 32px;
    opacity: .55;
}

.auth-board__promo-body {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-board__kicker {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    color: rgba(255, 255, 255, .82);
}

.auth-board__title {
    margin: 0 0 12px;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .01em;
}

.auth-board__desc {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
}

.auth-board__points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-board__points li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: rgba(255, 255, 255, .9);
}

.auth-board__points li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .22);
}

.auth-board__panel {
    padding: 36px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--auth-surface);
}

.auth-board__eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand, #00a0e9);
}

.auth-board__panel h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    color: var(--text, #1f2933);
    letter-spacing: .01em;
    line-height: 1.25;
}

.auth-board__subtitle {
    margin: 0 0 28px;
    color: var(--text-muted, #6b7785);
    font-size: 14px;
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.auth-field__head label {
    margin-bottom: 0;
}

.auth-field__link {
    font-size: 12px;
    font-weight: 500;
    color: var(--brand, #00a0e9) !important;
    text-decoration: none;
    white-space: nowrap;
}

.auth-field__link:hover {
    color: var(--brand-dark, #0088cc) !important;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text, #1f2933);
}

.auth-field .req { color: var(--danger, #ff4d4f); }

.auth-field input,
.auth-field select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    font: inherit;
    font-size: 14px;
    color: var(--text, #1f2933);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.auth-field input::placeholder {
    color: #8492a6;
}

.auth-field input:hover,
.auth-field select:hover {
    border-color: #b8c4d0;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--brand, #00a0e9);
    box-shadow: 0 0 0 3px rgba(0, 160, 233, .14);
}

.auth-field .help-block {
    margin-top: 6px;
    font-size: 12px;
    color: var(--danger, #ff4d4f);
}

.auth-captcha {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.auth-captcha input { flex: 1; min-width: 0; }

.auth-captcha__img,
.auth-captcha img {
    height: 44px;
    width: auto;
    max-width: none;
    display: block;
    flex-shrink: 0;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-border);
    cursor: pointer;
    background: var(--auth-surface);
    transition: opacity .2s;
}

.auth-captcha__img:hover,
.auth-captcha img:hover {
    opacity: .85;
}

.btn-auth {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: var(--brand, #00a0e9);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.btn-auth:hover { background: var(--brand-dark, #0088cc); }
.btn-auth:active { transform: translateY(1px); }

.auth-switch {
    margin: 24px 0 0;
    text-align: center;
    color: var(--text-muted, #6b7785);
    font-size: 14px;
}

.auth-switch a {
    color: var(--brand, #00a0e9);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { color: var(--brand-dark, #0088cc); }

.role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    cursor: pointer;
    font: inherit;
    color: var(--text, #1f2933);
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.role-card i {
    font-size: 20px;
    color: var(--brand, #00a0e9);
}

.role-card span {
    font-size: 13px;
    font-weight: 500;
}

.role-card:hover {
    border-color: rgba(0, 160, 233, .45);
    background: var(--brand-light, #e8f6fc);
}

.role-card.active {
    border-color: var(--brand, #00a0e9);
    background: var(--brand-light, #e8f6fc);
    box-shadow: inset 0 0 0 1px var(--brand, #00a0e9);
}

.auth-board--wide .auth-board__panel {
    max-width: none;
}

@media (max-width: 900px) {
    .auth-board {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-board__promo {
        min-height: 160px;
        padding: 24px;
        justify-content: center;
    }

    .auth-board__desc,
    .auth-board__points {
        display: none;
    }

    .auth-board__title {
        font-size: 22px;
        margin-bottom: 0;
    }

    .auth-board__panel {
        padding: 28px 24px 32px;
    }

    .auth-board__panel h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .auth-shell {
        padding: var(--mall-block) 0 32px;
    }

    .auth-shell__inner {
        padding: 0 var(--pad-x-sm);
    }

    .auth-board__panel {
        padding: 24px 16px 28px;
    }

    .auth-form input:not([type="checkbox"]):not([type="radio"]),
    .auth-form .btn-auth {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .role-cards {
        gap: 8px;
    }

    .auth-board__promo {
        min-height: 120px;
        padding: 20px 16px;
    }
}
