/* CoreNAI User Authentication Styles */
/* 基于 CoreBiz 模板设计规范 */

/* 全局颜色变量 - 基于 CoreNai Logo 色调 */
:root {
  --background-color: #fdfaf5; /* 主背景色 */
  --default-color: #5c4d3e; /* 主要文本色 */
  --heading-color: #382c1f; /* 标题色 */
  --accent-color: #6e5b4b; /* 品牌强调色 */
  --surface-color: #ffffff; /* 模块表面色 */
  --contrast-color: #ffffff; /* 对比色 */
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
}

/* 基础布局样式 */
body {
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.auth-container {
    max-width: 480px;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    flex: 1;
    margin-bottom: 60px;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    color: var(--default-color);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    font-family: var(--heading-font);
}

/* Bootstrap 5 表单样式增强 */
.col-form-label {
    color: var(--default-color);
    font-weight: 500;
    font-family: var(--heading-font);
}

.form-control {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--surface-color);
    color: var(--default-color);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(110, 91, 75, 0.25);
    outline: none;
}

/* 按钮样式 - 遵循 CoreBiz 设计 */
.btn-auth {
    background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    color: var(--contrast-color);
    font-weight: 500;
    width: 100%;
    transition: transform 0.3s ease;
    font-size: 16px;
    cursor: pointer;
    font-family: var(--heading-font);
}

.btn-auth:hover {
    transform: translateY(-2px);
    color: var(--contrast-color);
    box-shadow: 0 5px 15px rgba(110, 91, 75, 0.3);
}

.btn-auth:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* 确保所有按钮都有完整的圆角 */
.btn {
    border-radius: 10px !important;
}

/* 只有在input-group中的按钮左边才是直角 */
.input-group .btn {
    border-radius: 0 10px 10px 0 !important;
}

/* 确保input-group中的输入框右边是直角 */
.input-group .form-control {
    border-radius: 10px 0 0 10px !important;
}

/* 验证错误样式 */
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%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);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--danger-color);
}

/* 消息提示样式 - 遵循 CoreBiz 设计 */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 0.375rem;
    font-family: var(--default-font);
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 链接样式 */
.auth-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-links p {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 14px;
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin: 0 10px;
    font-size: 14px;
    transition: 0.3s;
}

.auth-links a:hover {
    text-decoration: underline;
    color: color-mix(in srgb, var(--accent-color), transparent 25%);
}

/* 微信登录样式 */
.divider-text {
    position: relative;
    text-align: center;
    margin: 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.divider-text::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #dee2e6;
    z-index: 1;
}

.divider-text::after {
    content: attr(data-text);
    position: relative;
    background-color: var(--surface-color);
    padding: 0 15px;
    z-index: 2;
}

#qrcodeDiv {
    display: inline-block;
    padding: 15px;
    background: var(--surface-color);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 复选框样式 */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.form-check-input {
    margin-right: 8px;
    border-color: #ddd;
}

.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(110, 91, 75, 0.25);
}

.form-check-label {
    color: var(--default-color);
    font-size: 14px;
    cursor: pointer;
}

.auth-header {
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--heading-color);
    margin-bottom: 10px;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-header h1 i {
    color: var(--accent-color);
}

.auth-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-subtitle p {
    display: inline-block;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
}

/* 响应式优化 */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        padding: 30px 20px;
        margin: 1rem;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
}

/* 加载动画 */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 验证码模态框样式 */
.captcha-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.captcha-modal-content {
    background-color: var(--surface-color);
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 350px;
    text-align: center;
}

.captcha-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.captcha-modal-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: var(--heading-color);
}

.captcha-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.captcha-modal-close:hover {
    color: #333;
}

.captcha-container {
    margin: 20px 0;
}

/* OAuth用户信息样式 */
.oauth-user-info {
    margin-bottom: 2rem;
}

.oauth-user-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color);
}

.oauth-platform-name {
    font-size: 0.9rem;
    color: #666;
}

/* 页面底部版权信息 */
.auth-page-footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    width: 100%;
    position: absolute;
    bottom: 0;
}

.auth-page-footer .copyright {
    color: rgba(255, 255, 255, 0.7);
}