/**
 * 认证页面样式 (Premium Version)
 */

/* ==================== Modal Styles ==================== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: none;
    /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal--open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: var(--z-modal) !important;
}

.auth-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.auth-modal__container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-4);
    animation: modalSlideIn 0.35s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal__close {
    position: absolute;
    top: var(--spacing-6);
    right: var(--spacing-6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 16px;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-modal__close:hover {
    background: #ffffff;
    color: var(--color-text-primary);
    transform: rotate(90deg);
}

/* Modal 内的 auth-card 不需要单独背景 */
.auth-modal .auth-card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ==================== Standalone Page Styles ==================== */
.auth-page {
    min-height: 100vh;
    background: url('../images/login_bg_premium.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 覆盖层，增加背景深邃感 */
.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* 增加遮罩确保文字可读 */
    z-index: 0;
}

/* 弹窗风格容器 */
.auth-container {
    position: relative;
    z-index: 1;
    display: flex;
    /* 改为 Flex 居中 */
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: var(--spacing-4);
}

/* 移除原有的网格和品牌区样式 */
.auth-brand {
    display: none;
}

/* 登录卡片 (Modal Style) */
.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    width: 100%;
    max-width: 480px;
    /* 限制宽度 */
    padding: var(--spacing-10);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-6);
    text-decoration: none;
}

.auth-logo img {
    height: 40px;
    /* Logo 稍微调小 */
}

.auth-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-2);
}

.auth-header p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

@media (max-width: 576px) {
    .auth-page {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: var(--z-max);
        /* 确保覆盖所有内容 */
        overflow-y: auto;
    }

    .auth-container {
        min-height: 100vh;
        padding: 0;
    }

    .auth-card {
        padding: var(--spacing-6);
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

/* 标签页 */
.auth-tabs {
    display: flex;
    padding: var(--spacing-1);
    background: #f1f5f9;
    border-radius: 12px;
    margin-bottom: var(--spacing-8);
    position: relative;
    z-index: 1;
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-3);
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
}

.auth-tab:hover {
    color: var(--color-text-primary);
}

.auth-tab--active {
    background: #FFFFFF;
    color: var(--color-text-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: var(--spacing-5);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 14px;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    transition: color 0.3s;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--color-bg-secondary);
    border: 2px solid transparent;
    /* 移除默认边框，使用背景 */
    border-radius: 12px;
    font-size: 15px;
    color: var(--color-text-primary);
    transition: all 0.3s;
}

.form-group input:hover {
    background: var(--color-bg-secondary);
}

.form-group input:focus {
    background: #FFFFFF;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-group input:focus+i,
.form-group input:focus~i {
    color: var(--color-primary-500);
}

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

.toggle-password:hover {
    color: var(--color-gray-600);
}

/* ... existing styles ... */

.auth-card {
    /* ... existing props ... */
    transition: height 0.3s ease, min-height 0.3s ease;
    /* 高度平滑过渡 */
    overflow: hidden;
    /* 隐藏溢出内容保证动画平滑 */
}

/* Tab Content Animation */
.auth-form {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 注册表单网格优化 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-5);
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 密码强度指示器 */
.password-strength {
    height: 4px;
    background: var(--color-gray-200);
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    display: none;
    /* 默认隐藏，输入密码显示 */
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-text {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    text-align: right;
    display: none;
}

/* Strength Colors */
.strength-weak {
    background-color: #ef4444;
}

.strength-medium {
    background-color: #f59e0b;
}

.strength-strong {
    background-color: #22c55e;
}

/* ... existing footer ... */
.auth-footer a {
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

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