﻿/**
 * 登录注册页样式
 *
 * @package Xuhuan
 * @since 1.0.0
 */

/* ========================================
   Common Auth Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.auth-page {
    min-height: 100vh;
    background: var(--bg-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Roboto, sans-serif;
    transition: background-color 0.3s ease;
}

.auth-container {
    display: flex;
    min-height: 100vh;
}

/* 左侧装饰区域 - 始终使用渐变色 */
.auth-sidebar {
    flex: 0 0 45%;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.auth-sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 400px;
}

.auth-logo {
    margin-bottom: 40px;
}

.auth-logo .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
}

.auth-tagline {
    margin-bottom: 48px;
}

.auth-tagline h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: white;
}

.auth-tagline p {
    font-size: 18px;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    transition: transform 0.3s, background 0.3s;
    color: white;
}

.feature-item:hover {
    transform: translateX(8px);
    background: rgba(255,255,255,0.25);
}

.feature-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* 浮动立方体动画 */
.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-cube {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    animation: float 6s ease-in-out infinite;
}

.cube-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.cube-2 {
    top: 60%;
    right: 15%;
    width: 40px;
    height: 40px;
    animation-delay: 2s;
}

.cube-3 {
    bottom: 20%;
    left: 20%;
    width: 80px;
    height: 80px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* 右侧表单区域 */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.auth-form-wrapper {
    width: 100%;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.auth-form-header {
    text-align: center;
}

.auth-form-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.auth-form-header p {
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.3s ease;
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-page .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.auth-page .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-page .form-group label .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

/* 输入框样式 */
.auth-page .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.auth-page .form-group input:hover {
    border-color: var(--primary-light);
}

.auth-page .form-group input:focus {
    outline: none;
    border-color: var(--input-border-focus);
    box-shadow: var(--input-shadow-focus);
    background: var(--input-bg);
}

.auth-page .form-group input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* 密码输入框 */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
}

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

.toggle-password .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 表单消息 */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    font-weight: 500;
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.form-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn .btn-loader {
    display: none;
}

.auth-submit-btn.loading .btn-text {
    visibility: hidden;
}

.auth-submit-btn.loading .btn-loader {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 分隔线 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 14px;
}

/* 注册/登录切换 */
.auth-alternate {
    text-align: center;
}

.auth-alternate p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.auth-link-btn {
    display: inline-block;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.auth-link-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.auth-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: var(--primary-color);
}

.auth-footer a .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 主题切换按钮 */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.auth-theme-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.auth-theme-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .auth-sidebar {
        flex: 0 0 40%;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-sidebar {
        flex: none;
        padding: 30px;
    }

    .auth-sidebar-content {
        max-width: 100%;
    }

    .auth-tagline h2 {
        font-size: 28px;
    }

    .auth-features {
        display: none;
    }

    .auth-main {
        padding: 30px 20px;
    }

    .auth-form-wrapper {
        padding: 32px 24px;
    }

    .auth-form-header h2 {
        font-size: 26px;
    }

    .auth-theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .auth-sidebar {
        min-height: 200px;
        padding: 20px;
    }

    .auth-tagline h2 {
        font-size: 24px;
    }

    .auth-tagline p {
        font-size: 14px;
    }

    .auth-main {
        padding: 20px 16px;
    }

    .auth-form-wrapper {
        padding: 24px 20px;
    }
}

/* ========================================
   Login Page
   ======================================== */

.login-page .auth-form-wrapper {
    max-width: 420px;
    padding: 48px 40px;
}

.login-page .auth-form-header {
    margin-bottom: 40px;
}

.login-page .auth-form {
    gap: 24px;
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
}

.remember-me input {
    display: none;
}

.remember-me .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s;
    background: var(--input-bg);
}

.remember-me:hover .checkmark {
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .login-page .auth-sidebar {
        min-height: 300px;
    }
}

/* ========================================
   Register Page
   ======================================== */

.register-page .auth-main {
    overflow-y: auto;
}

.register-page .auth-form-wrapper {
    max-width: 480px;
    padding: 40px 36px;
}

.register-page .auth-form-header {
    margin-bottom: 32px;
}

.register-page .auth-form {
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.auth-page .form-group label .required {
    color: var(--error-color);
}

.auth-page .form-group input.error {
    border-color: var(--error-color);
}

.auth-page .form-group input.success {
    border-color: var(--success-color);
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.field-hint.error {
    color: var(--error-color);
}

.field-hint.success {
    color: var(--success-color);
}

/* 密码强度指示器 */
.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

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

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

.strength-fill.weak {
    width: 33%;
    background: var(--error-color);
}

.strength-fill.medium {
    width: 66%;
    background: var(--warning-color);
}

.strength-fill.strong {
    width: 100%;
    background: var(--success-color);
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 60px;
}

.strength-text.weak {
    color: var(--error-color);
}

.strength-text.medium {
    color: var(--warning-color);
}

.strength-text.strong {
    color: var(--success-color);
}

/* 协议勾选 */
.form-agreement {
    margin: 8px 0;
}

.agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.agreement-check input {
    display: none;
}

.agreement-check .checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s;
    margin-top: 2px;
    background: var(--input-bg);
}

.agreement-check:hover .checkmark {
    border-color: var(--primary-color);
}

.agreement-check input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.agreement-check input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.agreement-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.agreement-text a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

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

@media (max-width: 768px) {
    .register-page .auth-sidebar {
        min-height: 280px;
    }

    .form-row {
        flex-direction: column;
    }
}
