/* ========================================
   认证页面样式 - 现代简约设计
   ======================================== */

/* CSS 变量 */
:root {
    --auth-primary: #6366f1;
    --auth-primary-hover: #5558e3;
    --auth-primary-light: rgba(99, 102, 241, 0.1);
    --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-bg: #0f0f23;
    --auth-bg-card: rgba(255, 255, 255, 0.02);
    --auth-bg-input: rgba(255, 255, 255, 0.05);
    --auth-border: rgba(255, 255, 255, 0.1);
    --auth-border-focus: rgba(99, 102, 241, 0.5);
    --auth-text: #ffffff;
    --auth-text-muted: rgba(255, 255, 255, 0.6);
    --auth-text-placeholder: rgba(255, 255, 255, 0.4);
    --auth-error: #ef4444;
    --auth-success: #22c55e;
}

/* 页面基础 */
.auth-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 动态背景 */
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(2%, 2%) rotate(1deg);
    }
    66% {
        transform: translate(-1%, 1%) rotate(-1deg);
    }
}

/* 网格背景 */
.auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* 容器 */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* 卡片 */
.auth-card {
    background: var(--auth-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Logo 和品牌 */
.auth-brand {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--auth-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-brand h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.auth-brand p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    margin: -8px -12px 24px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-btn:hover {
    color: var(--auth-text);
    background: rgba(255, 255, 255, 0.05);
}

.back-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.back-btn:hover svg {
    transform: translateX(-3px);
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 输入框 */
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--auth-text);
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--auth-text-placeholder);
}

.form-input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* 验证码输入组 */
.code-input-group {
    display: flex;
    gap: 12px;
}

.code-input-group .form-input {
    flex: 1;
}

.send-code-btn {
    padding: 14px 20px;
    background: transparent;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--auth-primary-light);
    border-color: var(--auth-primary);
}

.send-code-btn:disabled {
    color: var(--auth-text-muted);
    cursor: not-allowed;
}

/* 密码输入框 */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--auth-text);
}

/* 记住我和忘记密码 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--auth-text-muted);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--auth-border);
    background: var(--auth-bg-input);
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.forgot-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--auth-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.auth-submit-btn:hover::before {
    opacity: 1;
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 加载状态 */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        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(--auth-border);
}

.auth-divider span {
    font-size: 13px;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 演示账号登录 */
.demo-login-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.demo-login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.demo-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.demo-login-btn:active {
    transform: translateY(0);
}

.demo-hint {
    text-align: center;
    font-size: 12px;
    color: var(--auth-text-muted);
    margin: 0;
}

/* 社交登录 */
.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* 飞书登录按钮 */
.social-btn.feishu-btn {
    background: linear-gradient(135deg, rgba(51, 112, 255, 0.1) 0%, rgba(0, 214, 185, 0.1) 100%);
    border-color: rgba(51, 112, 255, 0.3);
}

.social-btn.feishu-btn:hover {
    background: linear-gradient(135deg, rgba(51, 112, 255, 0.2) 0%, rgba(0, 214, 185, 0.2) 100%);
    border-color: rgba(51, 112, 255, 0.5);
    box-shadow: 0 4px 15px rgba(51, 112, 255, 0.2);
}

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-border);
}

.auth-footer p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0;
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-footer a:hover {
    opacity: 0.8;
}

/* 标签页 */
.auth-tabs {
    display: flex;
    background: var(--auth-bg-input);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--auth-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: var(--auth-text);
}

.auth-tab.active {
    background: var(--auth-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 标签内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 协议 */
.terms-checkbox {
    font-size: 13px;
}

.terms-checkbox a {
    color: var(--auth-primary);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* 消息提示 */
.auth-message {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 10px;
}

.auth-message.show {
    display: flex;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--auth-error);
}

.auth-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--auth-success);
}

/* 响应式 */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .auth-brand h1 {
        font-size: 24px;
    }

    .code-input-group {
        flex-direction: column;
    }

    .social-login {
        flex-direction: column;
    }
}

/* 浮动粒子效果 */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 11s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 12s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 16s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--auth-bg);
    border: 1px solid var(--auth-border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--auth-text);
    margin: 0 0 8px;
}

.modal-content > p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

.modal-content .form-group {
    margin-bottom: 16px;
}

/* 公司信息区块 */
.profile-section {
    margin-bottom: 8px;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--auth-border);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.secondary {
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border);
    color: var(--auth-text-muted);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--auth-text);
}

.modal-btn.primary {
    background: var(--auth-gradient);
    border: none;
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
