/**
 * PPT学习站 - 登录页专用样式
 * 文件路径: css/login.css
 */

/* ==================== 1. 页面布局 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    position: relative;
    overflow: hidden;
}

/* ==================== 2. 装饰背景 ==================== */
.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation: floatShape1 20s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    left: -100px;
    animation: floatShape2 25s ease-in-out infinite;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape3 18s ease-in-out infinite;
}

@keyframes floatShape1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 30px) scale(1.05);
    }

    66% {
        transform: translate(20px, -20px) scale(0.95);
    }
}

@keyframes floatShape2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.08);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.92);
    }
}

@keyframes floatShape3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.05;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.1;
    }
}

/* ==================== 3. 登录容器 ==================== */
.login-container {
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
}

/* ==================== 4. 左侧欢迎区 ==================== */
.login-welcome {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: var(--space-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

/* 欢迎区装饰 */
.login-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: welcomePulse 8s ease-in-out infinite;
}

@keyframes welcomePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* 欢迎区内层 */
.login-welcome-inner {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
}

.login-welcome-icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
    display: inline-block;
    animation: iconBounce 3s ease-in-out infinite;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.login-welcome h1 {
    font-size: var(--text-3xl);
    color: white;
    margin-bottom: var(--space-md);
    line-height: 1.4;
    font-weight: 800;
}

.login-welcome h1 .highlight {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 16px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(4px);
}

.login-welcome-desc {
    font-size: var(--text-base);
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

/* 特点列表 */
.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    text-align: left;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: background var(--transition-fast);
}

.login-feature:hover {
    background: rgba(255, 255, 255, 0.25);
}

.login-feature-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ==================== 5. 右侧表单区 ==================== */
.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    min-width: 0;
}

.login-form-card {
    width: 100%;
    max-width: 380px;
}

/* 表单头部 */
.login-form-header {
    margin-bottom: var(--space-xl);
}

.login-form-header h2 {
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.login-form-header p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

/* 表单样式覆盖 */
.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-form .form-input {
    padding: 14px 16px;
    font-size: var(--text-base);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.login-form .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* 学号解析提示 */
.form-hint {
    display: none;
    font-size: var(--text-xs);
    color: var(--primary);
    margin-top: var(--space-xs);
    padding: 4px 10px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 16px;
    font-size: var(--text-lg);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    position: relative;
    overflow: hidden;
}

.login-btn::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;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn-text,
.login-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ==================== 6. 底部提示 ==================== */
.login-tips {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.login-tip {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: 6px 0;
}

.login-tip span:first-child {
    flex-shrink: 0;
}

/* ==================== 7. 表单错误状态 ==================== */
.login-form .form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.login-form .form-error {
    display: none;
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--space-xs);
    padding-left: 2px;
}

.login-form .form-error.show {
    display: block;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ==================== 8. 响应式 ==================== */

/* 平板 */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .login-welcome {
        padding: var(--space-xl) var(--space-lg);
    }

    .login-welcome-icon {
        font-size: 48px;
        margin-bottom: var(--space-md);
    }

    .login-welcome h1 {
        font-size: var(--text-2xl);
    }

    .login-welcome-desc {
        font-size: var(--text-sm);
        margin-bottom: var(--space-md);
    }

    .login-features {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xs);
    }

    .login-feature {
        padding: 8px 10px;
        font-size: var(--text-xs);
    }

    .login-form-wrapper {
        padding: var(--space-lg);
    }
}

/* 手机 */
@media (max-width: 560px) {
    .login-page {
        padding: calc(var(--header-height) + var(--space-md)) var(--space-md) var(--space-md);
        align-items: flex-start;
    }

    .login-container {
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
    }

    .login-welcome {
        padding: var(--space-lg) var(--space-md);
    }

    .login-welcome h1 {
        font-size: var(--text-xl);
    }

    .login-welcome h1 .highlight {
        padding: 2px 10px;
    }

    .login-welcome-desc {
        display: none;
    }

    .login-features {
        grid-template-columns: 1fr;
    }

    .login-form-wrapper {
        padding: var(--space-md);
    }

    .login-form-header h2 {
        font-size: var(--text-xl);
    }

    .login-btn {
        padding: 14px;
        font-size: var(--text-base);
    }

    .login-tips {
        margin-top: var(--space-md);
        padding-top: var(--space-md);
    }
}

/* 超小屏 */
@media (max-width: 380px) {
    .login-welcome-icon {
        font-size: 36px;
    }

    .login-welcome h1 {
        font-size: var(--text-lg);
    }

    .login-features {
        display: none;
    }

    .login-form .form-input {
        padding: 12px 14px;
        font-size: var(--text-sm);
    }
}

/* ==================== 9. 深色模式微调 ==================== */
[data-theme="dark"] .login-container {
    border-color: var(--border-color);
}

[data-theme="dark"] .login-welcome {
    background: linear-gradient(135deg, #C44E22, #CC2E48);
}

[data-theme="dark"] .login-form .form-input {
    background: var(--bg-body);
}

[data-theme="dark"] .form-hint {
    background: rgba(255, 107, 53, 0.1);
}

/* ==================== 10. 登录成功动画 ==================== */
.login-success-animation {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    animation: successFadeIn 0.4s ease;
}

[data-theme="dark"] .login-success-animation {
    background: rgba(15, 15, 26, 0.95);
}

.login-success-animation .success-icon {
    font-size: 72px;
    animation: successBounce 0.6s ease 0.2s both;
}

.login-success-animation .success-text {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    animation: successFadeUp 0.5s ease 0.4s both;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes successBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes successFadeUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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