:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --bg-gradient-1: #667eea;
    --bg-gradient-2: #764ba2;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --error: #ef4444;
    --success: #10b981;
    --white: #ffffff;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: block;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    padding: 0;
    position: relative;
    overflow-x: hidden;
}
.bg-circle {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
    z-index: 0;
}
.bg-circle:nth-child(1) { width: 400px; height: 400px; top: -100px; left: -100px; }
.bg-circle:nth-child(2) { width: 300px; height: 300px; bottom: -50px; right: -50px; animation-delay: -5s; }
.bg-circle:nth-child(3) { width: 200px; height: 200px; top: 50%; left: 10%; animation-delay: -10s; }
.bg-circle:nth-child(4) { width: 250px; height: 250px; bottom: 10%; right: 15%; animation-delay: -15s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(10px, -10px) scale(1.02); }
}
.login-container {
    width: 30%;
    margin: 3% auto 0;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px 40px;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}
.logo-wrapper {
    width: 72px; height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}
.logo-wrapper svg { width: 36px; height: 36px; fill: var(--white); }
.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.login-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-gray);
    margin-bottom: 32px;
}
.form-group { margin-bottom: 22px; position: relative; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute;
    left: 14px;
    width: 20px; height: 20px;
    fill: var(--text-light);
    pointer-events: none;
}
.form-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    font-size: 15px;
    color: var(--text-dark);
    background: #f9fafb;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.form-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.toggle-password svg { width: 20px; height: 20px; fill: var(--text-light); }
#password { padding-right: 46px; }
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}
.error-message {
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 4px;
}
.error-message.show { display: flex; }
.error-message svg { width: 14px; height: 14px; fill: var(--error); }
.form-input.error { border-color: var(--error); background: #fef2f2; }
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 14px;
}
.remember-me { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-gray); }
.remember-me input[type="checkbox"] { display: none; }
.custom-checkbox {
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}
.custom-checkbox svg { width: 12px; height: 12px; fill: var(--white); opacity: 0; }
.remember-me input:checked ~ .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}
.remember-me input:checked ~ .custom-checkbox svg { opacity: 1; }
.forgot-password { color: var(--primary); text-decoration: none; font-weight: 500; }
.login-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    letter-spacing: 1px;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}
.login-btn:hover { transform: translateY(-2px); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-spinner {
    display: none;
    width: 20px; height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
.login-btn.loading .btn-text { display: none; }
.login-btn.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-light);
    font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.footer-info { text-align: center; font-size: 13px; color: var(--text-light); }
.success-toast {
    position: fixed;
    top: 30px; left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--success);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    z-index: 100;
    transition: transform 0.5s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.success-toast.show { transform: translateX(-50%) translateY(0); }
.success-toast svg { width: 22px; height: 22px; fill: var(--white); }
.register-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.register-link:hover { text-decoration: underline; }
.form-hint { margin-top: 6px; font-size: 13px; color: var(--text-light); }
