/* ==========================================================================
   meabot 登录 / 注册 / 改密 页面样式
   与官网 www.meabot.com 共用同一套设计变量（styles.css 的 :root）
   —— 改配色/字体请两边同步，别只改一处
   ========================================================================== */

:root {
    --brand: #5746b6;
    --brand-hover: #4a3ba0;
    --brand-soft: #f0edff;
    --brand-softer: #f7f5ff;

    --bg: #ffffff;
    --bg-warm: #fbfaf8;
    --bg-subtle: #f7f7f6;

    --text: #17151d;
    --text-body: #4c4852;
    --text-soft: #767482;
    --text-faint: #8a8990;

    --line: #eae9e7;
    --line-strong: #dedcd8;

    --success: #1a7f37;
    --success-soft: #eaf7ee;
    --danger: #b3261e;
    --danger-soft: #fdeceb;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(23, 21, 29, 0.04);
    --shadow: 0 2px 8px rgba(23, 21, 29, 0.06);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
        Arial, sans-serif;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-warm);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- 顶栏 */

.auth-nav {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}

.auth-nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.auth-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.auth-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: none;
    transition: color 160ms var(--ease);
}

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

/* ---------------------------------------------------------------- 主体 */

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 424px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px 36px 30px;
}

.auth-card.is-center {
    text-align: center;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.3;
    color: var(--text);
}

.auth-sub {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.6;
}

/* ---------------------------------------------------------------- 表单 */

.auth-form {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-body);
    letter-spacing: 0.005em;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.auth-input::placeholder {
    color: #a8a6ae;
}

.auth-input:hover {
    border-color: #cdcac5;
}

.auth-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(87, 70, 182, 0.12);
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--text-faint);
    line-height: 1.5;
}

/* ---------------------------------------------------------------- 按钮 */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 46px;
    padding: 0 20px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 160ms var(--ease), border-color 160ms var(--ease),
        color 160ms var(--ease), transform 160ms var(--ease);
}

.auth-btn:hover:not(:disabled) {
    background: var(--brand-hover);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.auth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.auth-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.auth-btn.secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--line-strong);
}

.auth-btn.secondary:hover:not(:disabled) {
    background: var(--bg-subtle);
    border-color: var(--brand);
    color: var(--brand);
}

/* 加载小圈：尺寸跟字号走，颜色跟 currentColor，白底按钮上也看得见 */
.spinner {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.85;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------- 提示 */

.auth-msg {
    margin-top: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    border-radius: var(--radius);
    text-align: left;
}

.auth-msg:empty {
    display: none;
}

.auth-msg .msg-box {
    padding: 11px 13px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.auth-msg .msg-box.error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #f6d3d0;
}

.auth-msg .msg-box.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: #cfe9d8;
}

.auth-msg a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------------------------------------------------------- 备用入口 */

.auth-alt {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--text-soft);
    text-align: center;
    line-height: 1.9;
}

.auth-alt a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms var(--ease);
}

.auth-alt a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-alt .sep {
    color: var(--line-strong);
    margin: 0 10px;
}

/* ---------------------------------------------------------------- 结果态（邮箱验证页）*/

.auth-status {
    width: 64px;
    height: 64px;
    margin: 4px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.auth-status.loading {
    color: var(--brand);
    background: var(--brand-soft);
    animation: auth-pulse 1.4s ease-in-out infinite;
}

.auth-status.success {
    color: var(--success);
    background: var(--success-soft);
}

.auth-status.error {
    color: var(--danger);
    background: var(--danger-soft);
}

@keyframes auth-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

/* ---------------------------------------------------------------- 页脚 */

.auth-foot {
    padding: 22px 24px 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 0.78rem;
    color: var(--text-faint);
}

.auth-foot a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color 160ms var(--ease);
}

.auth-foot a:hover {
    color: var(--brand);
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 520px) {
    .auth-nav-inner {
        padding: 0 18px;
        height: 58px;
    }

    .auth-main {
        padding: 32px 18px;
    }

    .auth-card {
        padding: 28px 22px 24px;
        border-radius: var(--radius);
    }

    .auth-title {
        font-size: 1.4rem;
    }
}

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .auth-status.loading {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
