/* ===================================
   YOHO!YOUNG 登录页面样式
   ================================== */

/* 页面容器 */
.yh-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.yh-login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.yh-login-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(118, 75, 162, 0.05) 100%);
}

.yh-login-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
}

/* 登录容器 */
.yh-login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    margin: 0 auto;
}

/* 顶部 Logo */
.yh-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.yh-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #212529;
    font-size: 20px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-login-logo:hover {
    transform: translateY(-2px);
    color: #667eea;
}

.yh-login-logo svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-login-logo:hover svg {
    transform: rotate(5deg) scale(1.1);
}

/* 登录卡片 */
.yh-login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题 */
.yh-login-title {
    text-align: center;
    margin-bottom: 32px;
}

.yh-login-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
}

.yh-login-title p {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
}

/* 表单 */
.yh-login-form {
    margin-bottom: 0;
}

.yh-form-group {
    margin-bottom: 24px;
}

.yh-form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.yh-form-label svg {
    color: #adb5bd;
}

.yh-form-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    font-size: 15px;
    color: #212529;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-form-input::placeholder {
    color: #adb5bd;
}

.yh-form-input:focus {
    background-color: #ffffff;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.yh-form-input.yh-input-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.yh-form-input.yh-input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

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

.yh-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.yh-password-toggle:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.yh-password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* 错误提示 */
.yh-form-error {
    font-size: 13px;
    color: #dc3545;
    margin-top: 6px;
    display: none;
}

.yh-form-error.yh-error-show {
    display: block;
    animation: errorShake 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

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

.yh-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.yh-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #667eea;
}

.yh-checkbox-label {
    font-size: 14px;
    color: #495057;
}

.yh-forgot-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-forgot-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 登录按钮 */
.yh-login-btn {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-bottom: 16px;
}

.yh-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.yh-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

.yh-btn-text,
.yh-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 表单提示 */
.yh-form-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.yh-form-alert.yh-alert-error {
    background-color: #fff5f5;
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.yh-form-alert.yh-alert-success {
    background-color: #f0fdf4;
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 分隔线 */
.yh-login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
    color: #adb5bd;
    font-size: 14px;
}

.yh-login-divider::before,
.yh-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e9ecef;
}

/* 社交登录 */
.yh-social-login {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.yh-social-btn {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-social-btn:not(:disabled):hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-2px);
}

.yh-social-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.yh-social-github {
    color: #24292e;
}

.yh-social-google {
    color: #4285f4;
}

/* 注册链接 */
.yh-register-link {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

.yh-register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-register-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 页脚 */
.yh-login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 13px;
    color: #adb5bd;
}

.yh-login-footer a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.yh-login-footer a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* ===================================
   响应式适配
   ================================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    .yh-login-card {
        padding: 40px 32px;
    }
}

/* 手机端 (<768px) */
@media (max-width: 768px) {
    .yh-login-container {
        padding: 16px;
    }

    .yh-login-card {
        padding: 32px 24px;
    }

    .yh-login-title h1 {
        font-size: 24px;
    }

    .yh-login-title p {
        font-size: 14px;
    }

    .yh-form-input {
        height: 44px;
        font-size: 14px;
    }

    .yh-login-btn {
        height: 48px;
        font-size: 15px;
    }
}

/* 小屏手机 (<480px) */
@media (max-width: 480px) {
    .yh-login-container {
        padding: 12px;
    }

    .yh-login-card {
        padding: 24px 20px;
    }

    .yh-login-title {
        margin-bottom: 24px;
    }

    .yh-form-group {
        margin-bottom: 20px;
    }

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

/* ===================================
   辅助动画
   ================================== */

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 打字机效果（可选） */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}
