/* 旅居侠商家端 — 认证页高级视觉（登录 / 注册 / 忘记密码共用） */

:root {
    --auth-brand: #0c4a3e;
    --auth-brand-light: #0f766e;
    --auth-brand-mid: #14b8a6;
    --auth-accent: #d4a853;
    --auth-accent-soft: rgba(212, 168, 83, 0.15);
    --auth-surface: #ffffff;
    --auth-muted: #64748b;
    --auth-border: rgba(15, 118, 110, 0.12);
    --auth-shadow: 0 25px 50px -12px rgba(12, 74, 62, 0.18);
    --auth-radius: 20px;
    --auth-font: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.auth-body-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--auth-font);
    background: #f0f4f3;
    overflow-x: hidden;
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(380px, 520px);
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

/* —— 左侧品牌区 —— */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    background: linear-gradient(145deg, #063d34 0%, var(--auth-brand) 35%, var(--auth-brand-light) 100%);
    overflow: hidden;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(212, 168, 83, 0.22), transparent 50%),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(20, 184, 166, 0.25), transparent 55%);
    pointer-events: none;
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -120px;
    bottom: -80px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(2rem, 6vh, 3.5rem);
}

.auth-brand-logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.auth-brand-logo h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.auth-brand-logo span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.75;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 2px;
}

.auth-brand-tagline {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    line-height: 1.35;
    max-width: 16em;
    margin: 0 0 1rem;
}

.auth-brand-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.88;
    max-width: 22em;
    margin: 0 0 2rem;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    opacity: 0.92;
}

.auth-brand-features i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--auth-accent);
    flex-shrink: 0;
}

.auth-brand-foot {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 2rem;
}

/* —— 右侧登录区 —— */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: linear-gradient(180deg, #f8faf9 0%, #eef4f2 100%);
    overflow-y: auto;
}

.auth-panel {
    width: 100%;
    max-width: 440px;
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    border: 1px solid var(--auth-border);
    overflow: visible;
}

.auth-panel-head {
    padding: 1.75rem 1.75rem 0;
    text-align: center;
}

.auth-panel-head .auth-mobile-logo {
    display: none;
}

.auth-panel-head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.auth-panel-head p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-panel-body {
    padding: 1.25rem 1.75rem 1.5rem;
}

.auth-panel-footer {
    padding: 1rem 1.75rem 1.25rem;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 var(--auth-radius) var(--auth-radius);
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-panel-footer a {
    color: var(--auth-brand-light);
    font-weight: 700;
    text-decoration: none;
}

.auth-panel-footer a:hover {
    color: var(--auth-brand);
    text-decoration: underline;
}

.auth-panel-footer .beian-info {
    margin-top: 10px;
    font-size: 11px;
    line-height: 1.65;
    color: #94a3b8;
}

.auth-panel-footer .beian-info a {
    color: #64748b;
    font-weight: 500;
}

/* 登录方式 Tab */
.auth-method-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: #f1f5f4;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.auth-method-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--auth-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-method-tab:hover {
    color: var(--auth-brand);
}

.auth-method-tab.active {
    background: #fff;
    color: var(--auth-brand);
    box-shadow: 0 2px 8px rgba(12, 74, 62, 0.1);
}

.auth-method-panel {
    display: none;
    animation: authFadeIn 0.35s ease;
}

.auth-method-panel.active {
    display: block;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 二维码区 — 不固定死高度，保证完整显示 */
.qrcode-login-area {
    max-width: 100%;
    margin: 0 auto;
}

.qrcode-intro {
    text-align: center;
    margin-bottom: 1rem;
}

.qrcode-intro h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.qrcode-intro p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--auth-muted);
}

.qrcode-shell {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.qrcode-stage {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.qrcode-loading,
.qrcode-expired {
    text-align: center;
    padding: 1rem;
}

.qrcode-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--auth-brand-light) !important;
}

.qrcode-image-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode-image-wrap .qr-img-box {
    width: min(220px, 72vw);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.qrcode-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

.qrcode-status-bar {
    width: 100%;
    margin-top: 0;
    padding: 12px 16px;
    text-align: center;
    background: #f1f5f4;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: var(--auth-muted);
}

.qrcode-status-bar i {
    color: var(--auth-brand-light);
    margin-right: 6px;
}

.qrcode-status-bar p {
    margin: 4px 0 0;
    font-size: 0.8rem;
}

.qrcode-expired i {
    font-size: 2.5rem;
    color: #f59e0b;
}

.qrcode-expired .btn-refresh-qr {
    margin-top: 12px;
    padding: 8px 20px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--auth-brand-light), var(--auth-brand));
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.qrcode-expired .btn-refresh-qr:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.qrcode-wechat-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.qrcode-wechat-hint i {
    color: #07c160;
    font-size: 1.1rem;
}

/* 表单 */
.auth-form-premium .field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.auth-form-premium .field-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.auth-form-premium .field-wrap:focus-within {
    border-color: var(--auth-brand-mid);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.auth-form-premium .field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    background: #f8fafc;
    color: var(--auth-brand-light);
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.auth-form-premium .field-input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
    min-width: 0;
}

.auth-form-premium .field-toggle {
    border: none;
    background: #f8fafc;
    color: #64748b;
    padding: 0 14px;
    cursor: pointer;
}

.auth-form-premium .field-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: -8px 0 12px 4px;
}

.auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-form-row .form-check-label {
    font-size: 0.85rem;
    color: #475569;
}

.auth-form-row .form-check-input:checked {
    background-color: var(--auth-brand-light);
    border-color: var(--auth-brand-light);
}

.auth-link-forgot {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-brand-light);
    text-decoration: none;
}

.auth-link-forgot:hover {
    color: var(--auth-brand);
}

.btn-auth-submit {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-brand-light) 0%, var(--auth-brand) 100%);
    box-shadow: 0 8px 20px rgba(12, 74, 62, 0.25);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(12, 74, 62, 0.3);
    color: #fff;
}

.btn-auth-send-code {
    border: none;
    background: var(--auth-accent-soft);
    color: var(--auth-brand);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0 14px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-auth-send-code:hover:not(:disabled) {
    background: rgba(15, 118, 110, 0.12);
}

.btn-auth-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-alert-tip {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.15);
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.auth-alert-tip i {
    color: var(--auth-brand-light);
}

/* Flash 提示 */
.auth-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.auth-toast-stack .toast {
    pointer-events: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    max-width: 360px;
    margin-left: auto;
}

/* 兼容旧 auth-divider（注册页等） */
.auth-divider {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 0 12px;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* 平板 / 手机：单列，内容完整可滚动 */
@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-brand {
        padding: 1.5rem 1.25rem;
        min-height: auto;
    }

    .auth-brand-tagline,
    .auth-brand-desc,
    .auth-brand-features,
    .auth-brand-foot {
        display: none;
    }

    .auth-brand-logo {
        margin-bottom: 0;
        justify-content: center;
    }

    .auth-panel-head .auth-mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 1rem;
    }

    .auth-panel-head .auth-mobile-logo img {
        height: 40px;
    }

    .auth-panel-head .auth-mobile-logo span {
        font-weight: 800;
        font-size: 1.2rem;
        color: var(--auth-brand);
    }

    .auth-main {
        padding: 1rem 1rem 1.5rem;
        justify-content: flex-start;
    }

    .auth-panel {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .auth-panel-head,
    .auth-panel-body,
    .auth-panel-footer {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .auth-method-tab {
        font-size: 0.8rem;
        padding: 8px 6px;
    }
}
