/* 认证页面样式 - 现代化美化版本 */

/* 使用与主样式一致的CSS变量 */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-xl: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --transition-normal: 0.3s ease-out;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.auth-container::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="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-xl) var(--spacing-xl);
    width: 100%;
    max-width: 420px;
    animation: cardSlideUp 0.6s ease-out;
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.auth-header h1 {
    color: #1F2937;
    margin-bottom: var(--spacing-lg);
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.auth-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.auth-header p {
    color: #6B7280;
    font-size: 15px;
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
    margin-top: var(--spacing-md);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    transition: all var(--transition-normal);
    background: #F9FAFB;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-group input.input-error {
    border-color: #EF4444;
    background: #FEF2F2;
}

.form-group input.input-error:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.auth-button.loading .button-text {
    display: none;
}

.auth-button.loading .loading-spinner {
    display: inline-block;
}

.error-message {
    color: #EF4444;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message::before {
    content: '';
    font-size: 12px;
}

.success-message {
    color: #10B981;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.success-message::before {
    content: '';
    font-size: 12px;
}

.help-text {
    color: #9CA3AF;
    font-size: 12px;
    margin-top: 6px;
    font-style: italic;
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #E5E7EB;
}

.auth-footer p {
    margin: var(--spacing-lg) 0;
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: color var(--transition-normal);
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

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

.auth-footer a:hover::after {
    width: 100%;
}

/* 用户状态显示 - 右上角紧凑版 */
.user-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #F9FAFB;
    border-radius: 10px;
    border: 1.5px solid #E5E7EB;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    max-width: 280px;
}

.user-status:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.15);
    border-color: var(--primary-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .nickname {
    font-weight: 600;
    color: #1F2937;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .quota {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: white;
    border: 1.5px solid #E5E7EB;
    color: #6B7280;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    color: #374151;
    transform: translateY(-1px);
}

/* 试用状态显示 - 右上角紧凑版 */
.trial-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 900;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1.5px solid #F59E0B;
    border-radius: 10px;
    padding: 12px 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    text-align: center;
    min-width: 200px;
    max-width: 280px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.trial-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
}

.trial-status .title {
    font-weight: 600;
    color: #92400E;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.trial-status .title::before {
    content: '⏱️';
    font-size: 12px;
}

.trial-status .message {
    font-size: 12px;
    color: #A16207;
    font-weight: 500;
    margin-bottom: 10px;
}

/* 试用状态说明文字 */
.trial-status .benefit-text {
    font-size: 11px;
    color: #A16207;
    text-align: center;
    font-weight: 500;
    margin-bottom: 0;
    line-height: 1.3;
}

/* 试用状态认证选项 */
.trial-status .auth-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.trial-status .auth-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 70px;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    font-size: 12px;
}

.trial-status .auth-link::before {
    position: relative;
    z-index: 2;
}

.trial-status .register-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
}

.trial-status .register-link::before {
    content: '✨';
    font-size: 10px;
}

.trial-status .register-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.25);
}

.trial-status .login-link {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
}

.trial-status .login-link::before {
    content: '🔑';
    font-size: 10px;
}

.trial-status .login-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(107, 114, 128, 0.25);
}

.trial-status .separator {
    color: #A16207;
    font-weight: 500;
    font-size: 11px;
    margin: 0 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .trial-status {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        padding: 10px 12px;
    }

    .trial-status .title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .trial-status .message {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .trial-status .auth-options {
        gap: 6px;
    }

    .trial-status .auth-link {
        padding: 5px 10px;
        font-size: 11px;
        min-width: 60px;
    }

    .trial-status .separator {
        font-size: 10px;
    }

    .trial-status .benefit-text {
        font-size: 10px;
    }
}
