/* ==========================================================
   Sakura Tide v36 - 后台登录页面专用样式
========================================================== */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    position: relative;
}

.login-card {
    width: 100%;
    padding: 40px 32px 32px;
    position: relative;
}

/* 登录头部 */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* 表单 */
.login-form,
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-label i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* 密码输入框 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    width: 100%;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-main);
}

/* 验证码 */
.captcha-label {
    margin-bottom: 0;
}

.captcha-wrapper {
    display: flex;
    gap: 12px;
}

.captcha-input {
    flex: 1;
}

.captcha-canvas {
    width: 120px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.captcha-canvas:hover {
    border-color: rgba(100, 181, 246, 0.4);
    transform: scale(1.02);
}

.captcha-canvas:active {
    transform: scale(0.98);
}

/* 错误和信息提示 */
.login-error,
.login-info {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.login-error {
    background: rgba(230, 57, 124, 0.1);
    border: 1px solid rgba(230, 57, 124, 0.2);
    color: #e6397c;
}

.login-error.show {
    display: flex;
}

.login-info {
    background: rgba(100, 181, 246, 0.1);
    border: 1px solid rgba(100, 181, 246, 0.2);
    color: var(--secondary);
}

.login-info.show {
    display: flex;
}

/* 登录按钮 */
.btn-login,
.btn-setup {
    width: 100%;
    padding: 14px 24px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #1A1A1D 0%, #E6397C 50%, #1A1A1D 100%);
    background-size: 200% 200%;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: gradientShift 4s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover,
.btn-setup:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(230, 57, 124, 0.5);
}

.btn-login:disabled,
.btn-setup:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading i {
    font-size: 1.1rem;
}

/* 页脚链接 */
.login-footer {
    text-align: center;
    margin-top: 8px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

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

/* 首次设置 */
.setup-notice {
    text-align: center;
    padding: 20px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 14px;
    margin-bottom: 20px;
}

.setup-notice i {
    font-size: 1.5rem;
    color: #ffc107;
    margin-bottom: 8px;
    display: block;
}

.setup-notice p {
    font-size: 1rem;
    font-weight: 600;
    color: #ffc107;
    margin: 8px 0 4px;
}

.setup-notice small {
    font-size: 0.8rem;
    color: rgba(255, 193, 7, 0.7);
}

/* 密码强度 */
.password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--glass-bg);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
    background: #e6397c;
}

.strength-fill.weak { width: 25%; background: #e6397c; }
.strength-fill.fair { width: 50%; background: #ff9800; }
.strength-fill.good { width: 75%; background: #8bc34a; }
.strength-fill.strong { width: 100%; background: #4caf50; }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 50px;
}

/* 密码匹配提示 */
.password-match {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--text-muted);
}

.password-match.match {
    color: #4caf50;
}

.password-match.no-match {
    color: #e6397c;
}

/* 复选框 */
.setup-terms {
    margin: 8px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.5);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.checkbox-text {
    user-select: none;
}

/* 页脚 */
.login-page-footer {
    margin-top: 32px;
    text-align: center;
}

.login-page-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* 通知提示 */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 14px 20px;
    border-radius: 14px;
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 360px;
}

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

.toast i {
    font-size: 1.1rem;
}

.toast.success i { color: #4caf50; }
.toast.error i { color: #e6397c; }
.toast.info i { color: var(--secondary); }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 24px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .captcha-wrapper {
        flex-direction: column;
    }

    .captcha-canvas {
        width: 100%;
        height: 48px;
    }
}
