/* ========================================
 * 认证页面公共样式 — 居中卡片极简风
 * 适用于 login / register / forgot-password
 * ======================================== */

:root {
    --auth-primary: #059669;
    --auth-primary-dark: #047857;
    --auth-primary-alpha: rgba(5, 150, 105, 0.1);
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "system-ui", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 40%, #d1fae5 100%);
    position: relative;
    overflow-x: hidden;
}

/* 装饰性背景圆 */
.auth-deco-circle {
    position: fixed;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.05);
    pointer-events: none;
}

.auth-deco-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
}

.auth-deco-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -40px;
}

.auth-deco-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 40%;
    left: -30px;
}

/* 居中卡片 */
.auth-card {
    width: min(420px, 90vw);
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    animation: cardFadeIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

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

/* Logo 图标区 */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.auth-logo--green {
    background: transparent;
    box-shadow: none;
}

.auth-logo--orange {
    background: transparent;
    box-shadow: none;
}

.auth-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.auth-subtitle {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 24px;
}

/* 返回链接 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--auth-primary);
}

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

.form-group.has-error .form-control {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.form-group.has-error .form-control:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-group.has-error .form-icon {
    color: #e53e3e;
}

.form-error {
    position: absolute;
    bottom: -16px;
    left: 0;
    font-size: 11px;
    color: #e53e3e;
    display: none;
}

.form-group.has-error .form-error {
    display: block;
    animation: errorShake 0.3s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    transition: all 0.2s;
    background: #ffffff;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-alpha);
}

.form-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    z-index: 1;
}

/* 验证码行内布局 */
.captcha-group {
    display: flex;
    gap: 8px;
    position: relative;
}

.captcha-group .form-control {
    flex: 1;
}

.captcha-img {
    width: 100px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s;
    object-fit: cover;
}

.captcha-img:hover {
    border-color: var(--auth-primary);
}

/* 短信验证码行内布局 */
.sms-group {
    display: flex;
    gap: 8px;
    position: relative;
}

.sms-group .form-control {
    flex: 1;
}

.btn-send-sms {
    min-width: 90px;
    height: 40px;
    border: 1px solid var(--auth-primary);
    background: #ffffff;
    color: var(--auth-primary);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    padding: 0 10px;
}

.btn-send-sms:hover:not(:disabled) {
    background: var(--auth-primary);
    color: #ffffff;
}

.btn-send-sms:disabled {
    border-color: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

/* 通用提交按钮 */
.btn-auth {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--auth-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    margin-top: 8px;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-auth:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 登录 Tab 切换 */
.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.login-tab-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.login-tab-item:hover {
    color: var(--auth-primary);
}

.login-tab-item.active {
    color: var(--auth-primary);
    border-bottom-color: var(--auth-primary);
    font-weight: 600;
}

/* 底部链接 */
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 12px;
}

.form-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.form-links a:hover {
    color: var(--auth-primary);
}

.form-links a.link-action {
    color: var(--auth-primary);
    font-weight: 500;
}

/* 底部文字链接（注册/忘记密码页） */
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #94a3b8;
}

.auth-footer a {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 页面底部版权信息 */
.auth-copyright {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: rgba(100, 116, 139, 0.5);
    z-index: 0;
}

.auth-copyright a {
    color: rgba(100, 116, 139, 0.5);
    text-decoration: none;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 420px;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
}

.toast.removing {
    animation: toastOut 0.3s ease-in forwards;
}

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

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

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
}

.toast-icon.error { background: #fed7d7; color: #e53e3e; }
.toast-icon.success { background: #c6f6d5; color: #38a169; }
.toast-icon.warning { background: #feebc8; color: #dd6b20; }
.toast-icon.info { background: #bee3f8; color: #3182ce; }

.toast-message {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
}

/* 响应式 */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }
}
