/* ============================================================
   登录 / 注册页样式 - 渐变背景 + 居中卡片
   与聊天主色调一致（蓝紫 #4d6bfe / #4f46e5）
   ============================================================ */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", "Hiragino Sans GB", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1f2329;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #4d6bfe 0%, #4f46e5 60%, #6d4bf5 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰圆 */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

body::before {
    width: 420px;
    height: 420px;
    top: -160px;
    right: -120px;
}

body::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -100px;
    background: rgba(255, 255, 255, 0.06);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

a { color: inherit; text-decoration: none; }

/* 卡片 */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    padding: 38px 34px 30px;
    position: relative;
    z-index: 1;
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4d6bfe 0%, #4f46e5 100%);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(77, 107, 254, 0.4);
}

.auth-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.auth-subtitle {
    text-align: center;
    font-size: 13.5px;
    color: #8a909c;
    margin-bottom: 26px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #3a3f47;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 44px;
    border: 1.5px solid #e3e6eb;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14.5px;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder { color: #b0b5bf; }

.form-control:focus {
    border-color: #4d6bfe;
    box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.1);
}

.form-hint {
    font-size: 12px;
    color: #a0a5b0;
    margin-top: 5px;
    margin-left: 2px;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4d6bfe 0%, #4f46e5 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
    box-shadow: 0 6px 16px rgba(77, 107, 254, 0.35);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(77, 107, 254, 0.45);
}

.submit-btn:active:not(:disabled) { transform: translateY(0); }

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.submit-btn .btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* 切换链接 */
.auth-switch {
    text-align: center;
    font-size: 13.5px;
    color: #8a909c;
    margin-top: 22px;
}

.auth-switch a {
    color: #4d6bfe;
    font-weight: 500;
}

.auth-switch a:hover { color: #4f46e5; text-decoration: underline; }

/* 提示条 */
.alert {
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    line-height: 1.5;
}

.alert.show { display: block; }

.alert-error {
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    color: #c01f24;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* Toast */
.toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #1f2329;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.25s ease;
    pointer-events: auto;
    max-width: 80vw;
}

.toast.error { background: #c01f24; }
.toast.success { background: #1a9d56; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .auth-card { padding: 30px 22px 24px; }
    .auth-title { font-size: 20px; }
}
