/* 绵宝的厨房营养餐 · 登录/注册页 v2 · 简约年轻风 */
:root {
    --auth-primary: #22c55e;
    --auth-primary-dark: #16a34a;
    --auth-primary-soft: #dcfce7;
    --auth-accent: #fb923c;
    --auth-bg: #f8faf9;
    --auth-bg-warm: #fffbeb;
    --auth-text: #1f2937;
    --auth-text-muted: #9ca3af;
    --auth-border: #e5e7eb;
    --auth-radius: 16px;
    --auth-pill: 999px;
    --auth-footer-h: 36px;
}

html.auth-html {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.auth-body {
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "PingFang SC", "SF Pro SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    background: var(--auth-bg);
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        url('../img/landing/auth-bg.png') center center / cover no-repeat,
        linear-gradient(165deg, var(--auth-bg) 0%, #f0fdf4 38%, var(--auth-bg-warm) 100%);
}

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.72) 0%,
        rgba(248, 250, 249, 0.55) 45%,
        rgba(255, 251, 235, 0.62) 100%
    );
}

.auth-body .landing-nav {
    z-index: 200;
}

.auth-body .landing-nav .brand {
    text-decoration: none;
}

.auth-body .landing-nav .brand:hover {
    text-decoration: none;
    opacity: 1;
}

.auth-main {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    margin-top: var(--nav-h, 64px);
    padding: 32px 20px 16px;
    overflow: hidden;
}

.auth-page-inner {
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    max-height: calc(100vh - var(--nav-h, 64px) - var(--auth-footer-h) - 48px);
    display: flex;
    flex-direction: column;
}

/* 登录页：卡片距顶栏更远，视觉更舒适 */
.auth-page-login {
    margin-top: 56px;
}

.auth-page-login .auth-card {
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.auth-page-login .auth-card-head {
    padding: 24px 24px 8px;
}

.auth-page-login .auth-back {
    margin-top: 16px;
}

/* 注册页字段多，顶部留白略小 */
.auth-page-register {
    margin-top: 12px;
}

.auth-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--auth-radius);
    background: #fff;
    border: 1px solid var(--auth-border);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.auth-card-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--auth-radius) - 1px);
    background: #fff;
    overflow: hidden;
}

.auth-card-head {
    flex-shrink: 0;
    padding: 20px 24px 6px;
    text-align: center;
}

.auth-card-icon {
    display: block;
    font-size: 26px;
    margin-bottom: 6px;
    line-height: 1;
}

.auth-card-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-text);
    letter-spacing: -0.02em;
}

.auth-card-sub {
    margin: 0;
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-body .user-section.login-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.auth-body .login-section .logon-tab {
    flex-shrink: 0;
    margin: 0 16px;
    display: flex;
    padding: 4px;
    border-radius: var(--auth-pill);
    background: #f3f4f6;
    border-bottom: none;
}

.auth-body .login-section .logon-tab > a {
    float: none;
    width: 50%;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--auth-pill);
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-body .login-section .logon-tab > a:hover {
    color: var(--auth-text);
    background: rgba(255, 255, 255, 0.6);
}

.auth-body .login-section .logon-tab > a.active {
    color: var(--auth-primary-dark);
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.auth-body .login-section .login-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 24px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.2) transparent;
}

.auth-body .login-section .login-main::-webkit-scrollbar {
    width: 3px;
}

.auth-body .login-section .login-main::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.2);
    border-radius: 3px;
}

.auth-body .login-section .form-group {
    margin-bottom: 12px;
}

.auth-body .login-section .form-group:last-child {
    margin-bottom: 0;
}

.auth-body .login-section .control-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-body .login-section .form-control {
    height: 42px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
    box-shadow: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-body .login-section .form-control:focus {
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

/* 图形验证码：修复 landing.css 的 img{max-width:100%} 导致图片被压扁 */
.auth-body .login-section .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-collapse: separate;
}

.auth-body .login-section .input-group .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    float: none;
    display: block;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.auth-body .login-section .input-group-btn {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    vertical-align: middle;
    white-space: nowrap;
}

.auth-body .login-section .input-group-btn img {
    display: block;
    width: 120px;
    height: 42px;
    max-width: none;
    border: 1px solid var(--auth-border);
    border-left: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    object-fit: fill;
    background: #fff;
    transition: opacity 0.2s;
}

.auth-body .login-section .input-group-btn img:hover {
    opacity: 0.88;
}

.auth-page-register .login-section .input-group .form-control,
.auth-page-register .login-section .input-group-btn img {
    height: 40px;
}

.auth-body .login-section .checkbox label {
    font-size: 12px;
    color: var(--auth-text-muted);
    font-weight: normal;
}

.auth-body .login-section .btn-forgot {
    font-size: 12px;
    color: var(--auth-accent);
}

.auth-body .login-section .btn-primary {
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--auth-pill);
    background: var(--auth-primary);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.auth-body .login-section .btn-primary:hover,
.auth-body .login-section .btn-primary:focus {
    background: var(--auth-primary-dark);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

.auth-body .login-section .btn-default.no-border {
    height: 40px;
    margin-top: 10px !important;
    font-size: 13px;
    color: var(--auth-text-muted);
    background: #f9fafb;
    border: 1px solid var(--auth-border) !important;
    border-radius: var(--auth-pill);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.auth-body .login-section .btn-default.no-border:hover {
    color: var(--auth-primary-dark);
    background: var(--auth-primary-soft);
    border-color: rgba(34, 197, 94, 0.25) !important;
}

/* 注册页更紧凑 */
.auth-page-register .auth-card-head {
    padding: 16px 20px 4px;
}

.auth-page-register .auth-card-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.auth-page-register .auth-card-title {
    font-size: 18px;
}

.auth-page-register .auth-card-sub {
    font-size: 11px;
}

.auth-page-register .login-section .logon-tab {
    margin: 0 14px;
}

.auth-page-register .login-section .logon-tab > a {
    padding: 8px 6px;
    font-size: 13px;
}

.auth-page-register .login-section .login-main {
    padding: 12px 20px 16px;
}

.auth-page-register .login-section .form-group {
    margin-bottom: 10px;
}

.auth-page-register .login-section .form-control {
    height: 40px;
    font-size: 13px;
}

.auth-page-register .login-section .control-label {
    margin-bottom: 4px;
    font-size: 11px;
}

.auth-back {
    flex-shrink: 0;
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
}

.auth-back a {
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-back a:hover {
    color: var(--auth-primary-dark);
    text-decoration: none;
}

.auth-footer {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    height: var(--auth-footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--auth-border);
}

.auth-footer p {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
    color: var(--auth-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-footer a {
    color: var(--auth-text-muted);
}

.auth-body #content-container.container {
    width: 100%;
    max-width: 400px !important;
    height: 100%;
    max-height: 100%;
    padding: 0;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none;
    display: flex;
    flex-direction: column;
}

.auth-body .login-section {
    width: 100% !important;
    margin: 0 auto !important;
    float: none;
}

/* 忘记密码弹框：保持 FastAdmin 原样式，加高并去掉内部滚动条 */
.layui-layer:has(#resetpwd-form) .layui-layer-content {
    overflow: hidden !important;
}

#resetpwd-form.form-layer .form-body {
    overflow: hidden !important;
    bottom: 50px;
}

/* 弹框按钮还原 Bootstrap / FastAdmin 默认（不受 landing.css 全局 .btn 影响） */
#resetpwd-form .btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    transform: none;
    box-shadow: none;
    letter-spacing: normal;
    gap: 0;
}

#resetpwd-form .btn:hover,
#resetpwd-form .btn:focus {
    transform: none;
    text-decoration: none;
}

#resetpwd-form .btn-primary {
    color: #fff;
    background: #444c69;
    background-image: none;
    border-color: #444c69;
}

#resetpwd-form .btn-primary:hover,
#resetpwd-form .btn-primary:focus,
#resetpwd-form .btn-primary:active {
    color: #fff;
    background: #30364a;
    background-image: none;
    border-color: #2c3144;
    box-shadow: none;
    transform: none;
}

#resetpwd-form .btn-md {
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.3333333;
    border-radius: 3px;
}

#resetpwd-form .input-group-btn .btn {
    border-radius: 0 3px 3px 0;
}

#resetpwd-form .form-control {
    border-radius: 3px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    background-color: #fff;
    height: 34px;
}

@media (max-width: 576px) {
    :root {
        --auth-footer-h: 32px;
    }

    .auth-main {
        padding: 20px 14px 12px;
    }

    .auth-page-login {
        margin-top: 28px;
    }

    .auth-page-register {
        margin-top: 8px;
    }

    .auth-page-inner {
        max-width: 100%;
    }

    .auth-footer p {
        font-size: 10px;
        white-space: normal;
    }
}
