/**
 * 登录页 - 与后台样式统一
 * 背景 #eef1f5 | 卡片白底圆角 12px 阴影 | 主色 #3b82f6
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #eef1f5;
    color: #1f2937;
    min-height: 100vh;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 主区：居中 */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* 登录卡片：与后台 .container / .card-container 一致 */
.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 32px 28px 28px;
}

.login-card-head {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.login-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.login-card-desc {
    font-size: 13px;
    color: #6b7280;
}

/* 表单 */
.login-form {
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    height: 44px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.input-icon {
    color: #9ca3af;
    margin-right: 10px;
    font-size: 15px;
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #1f2937;
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

.password-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
}

.password-toggle:hover {
    color: #6b7280;
}

/* 验证码 */
.captcha-wrapper {
    padding-right: 6px;
}

.captcha-image {
    width: 88px;
    height: 36px;
    margin-left: 8px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

.captcha-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 3px;
}

/* 选项行 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.remember-me input:checked + .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
}

.option-text {
    margin-right: 4px;
}

.forgot-password {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.login-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.btn-text {
    display: block;
    transition: opacity 0.2s ease;
}

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loading {
    opacity: 1;
}

/* 页脚 */
.login-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #9ca3af;
}

/* Toast */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 12px 18px;
    transform: translateX(120%);
    transition: transform 0.25s ease;
    z-index: 1001;
    min-width: 240px;
}

.message-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.message-toast.success .toast-icon {
    background: #10b981;
}

.message-toast.error .toast-icon {
    background: #ef4444;
}

.message-toast.success .toast-icon::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.message-toast.error .toast-icon::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.toast-message {
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 480px) {
    .login-header {
        padding: 0 16px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .login-card-title {
        font-size: 17px;
    }
}
