
/* app/static/front/css/auth.css */
.auth-container {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 60px;
    /* 科技蓝渐变背景 */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #0066cc 100%);
    position: relative;
    overflow: hidden;
}

/* 添加动态背景效果 */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 191, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 149, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(30, 60, 114, 0.1) 0%, transparent 50%);
    animation: backgroundShift 10s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #0066cc 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.auth-header h2 {
    margin: 0;
    font-weight: 300;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.auth-body {
    padding: 40px;
    background: rgba(255, 255, 255, 0.9);
}

.form-floating {
    margin-bottom: 20px;
    position: relative;
}

.form-floating > .form-control {
    border: 2px solid rgba(30, 60, 114, 0.1);
    border-radius: 12px;
    padding: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    /* 为密码切换按钮留出空间 */
    padding-right: 50px;
}

.form-floating > .form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
    background: rgba(255, 255, 255, 1);
}

.form-floating > .form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.form-floating > .form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.form-floating > label {
    padding: 15px;
    color: #6c757d;
    font-weight: 500;
}

/* 密码切换按钮样式 */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    background: rgba(42, 82, 152, 0.1);
    color: #2a5298;
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.3);
}

/* 调整有密码切换按钮的输入框样式 */
.form-floating:has(.password-toggle) > .form-control {
    padding-right: 55px;
}

.btn-auth {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #0066cc 100%);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 82, 152, 0.4);
    color: white;
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(30, 60, 114, 0.1);
}

.auth-links a {
    color: #2a5298;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.auth-links a:hover {
    color: #1e3c72;
    text-decoration: none;
}

.auth-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    transition: all 0.3s ease;
}

.auth-links a:hover::after {
    width: 100%;
    left: 0;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border-left: 3px solid #dc3545;
}

/* 小提示文字样式 */
.text-muted {
    font-size: 12px;
    color: #6c757d !important;
    margin-top: 5px;
    padding: 3px 8px;
    background: rgba(108, 117, 125, 0.05);
    border-radius: 4px;
    border-left: 2px solid rgba(108, 117, 125, 0.3);
}

.password-requirements {
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.05) 0%, rgba(42, 82, 152, 0.05) 100%);
    border: 1px solid rgba(30, 60, 114, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #495057;
}

.password-requirements strong {
    color: #2a5298;
    font-weight: 600;
}

.password-requirements ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.password-requirements li {
    margin-bottom: 5px;
    position: relative;
}

.password-requirements li::marker {
    color: #2a5298;
}

/* 动态反馈样式 */
.dynamic-feedback {
    font-size: 12px;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dynamic-feedback.error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
}

.dynamic-feedback.warning {
    color: #f0ad4e;
    background: rgba(240, 173, 78, 0.1);
    border-left: 3px solid #f0ad4e;
}

.dynamic-feedback.success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .auth-container {
        padding-top: 100px;
        padding-bottom: 40px;
    }

    .auth-card {
        margin: 0 15px;
        max-width: none;
    }

    .auth-body {
        padding: 30px 25px;
    }

    .auth-header {
        padding: 25px;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .form-floating > .form-control {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .password-toggle {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* 加载状态样式 */
.btn-auth.loading {
    position: relative;
    color: transparent;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 聚焦状态增强 */
.form-floating.focused > .form-control {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
    background: rgba(255, 255, 255, 1);
}

.form-floating.focused > label {
    color: #2a5298;
}

/* 表单验证状态图标 */
.form-floating > .form-control.is-valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2328a745' d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem + 50px) !important; /* 额外空间给密码切换按钮 */
}

.form-floating > .form-control.is-invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23dc3545' d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem + 50px) !important; /* 额外空间给密码切换按钮 */
}

/* 没有密码切换按钮的输入框正常间距 */
.form-floating > .form-control:not(.has-toggle).is-valid {
    padding-right: calc(1.5em + 0.75rem) !important;
}

.form-floating > .form-control:not(.has-toggle).is-invalid {
    padding-right: calc(1.5em + 0.75rem) !important;
}

/* 验证反馈文字 */
.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(33, 37, 41, 0.95);
        color: #fff;
    }

    .auth-body {
        background: rgba(33, 37, 41, 0.9);
    }

    .form-floating > .form-control {
        background: rgba(52, 58, 64, 0.9);
        border-color: rgba(108, 117, 125, 0.3);
        color: #fff;
    }

    .form-floating > .form-control:focus {
        background: rgba(52, 58, 64, 1);
        border-color: #2a5298;
        color: #fff;
    }

    .form-floating > label {
        color: #adb5bd;
    }

    .password-toggle {
        color: #adb5bd;
    }

    .password-toggle:hover {
        background: rgba(42, 82, 152, 0.2);
        color: #78bfff;
    }

    .text-muted {
        color: #6c757d !important;
        background: rgba(108, 117, 125, 0.1);
    }

    .password-requirements {
        background: rgba(30, 60, 114, 0.1);
        border-color: rgba(30, 60, 114, 0.2);
        color: #adb5bd;
    }
}