/* ==========================================
   认证页面样式 - 注册/登录
   ========================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: clamp(2rem, 5vw, 4rem) 1rem;
    padding-top: 100px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

.auth-card {
    background: var(--surface-2);
    border-radius: var(--radius-xl);
    padding: clamp(2rem, 5vw, 3rem);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

/* 头部 */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-4);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* 验证码组 */
.verify-group {
    display: flex;
    gap: 0.75rem;
}

.verify-group input {
    flex: 1;
}

.btn-verify {
    padding: 0.875rem 1.5rem;
    background: var(--surface-4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-verify:hover {
    background: var(--surface-5);
    border-color: var(--accent);
    color: var(--accent);
}

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

/* 密码强度指示器 */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--surface-4);
    border-radius: 999px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--text-muted);
    transition: all 0.3s ease;
    border-radius: 999px;
}

.strength-fill.weak {
    width: 33.33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66.66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #10b981;
}

.strength-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 复选框 */
.checkbox-group {
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.125rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.checkbox-label span {
    flex: 1;
}

/* 表单行 */
.form-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.form-row .checkbox-label {
    margin: 0;
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(56, 189, 248, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* 页脚 */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* 分割线 */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.divider span {
    padding: 0 1rem;
}

/* 社交登录 */
.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--surface-3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--surface-4);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        width: 100%;
        padding: 1.5rem;
        margin: 0;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-header p {
        font-size: 0.875rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .form-input {
        padding: 0.75rem;
        font-size: 0.9375rem;
    }

    .btn-submit {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }

    .divider span {
        font-size: 0.8125rem;
    }

    .social-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .auth-footer {
        font-size: 0.875rem;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 1.5rem;
    }

    .verify-group {
        flex-direction: column;
    }

    .btn-verify {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .social-auth {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .auth-page {
        min-height: 100vh;
        min-height: 100dvh;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    /* "忘记密码？"、"服务条款"这类文字链接：加大点击区域 */
    .form-row .link,
    .auth-footer .link {
        display: inline-block;
        padding: 0.75rem 0.25rem;
        margin: -0.375rem 0;
    }
}

@media (max-width: 768px) {
    /* "我已阅读并同意…"：整行都可点，复选框放大 */
    .checkbox-label {
        min-height: 44px;
        align-items: center;
    }
    .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    .checkbox-label .link { padding: 0.5rem 0.125rem; }
}
