/**
 * Auth Pages Styles - 登录注册页面样式
 * 按需加载：仅在启用自定义认证页面时加载
 */

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 28px 16px;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #10b981 100%);
    z-index: 0;
}

.auth-particles {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 120px 120px;
    animation: authFloat 20s ease-in-out infinite;
}

@keyframes authFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 38px 30px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    margin-bottom: 16px;
}

.auth-logo img {
    max-height: 50px;
    width: auto;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.auth-subtitle {
    color: #64748b;
    margin: 0;
    font-size: 0.9rem;
}

.auth-page .auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 3px;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
}

.auth-page .auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #666);
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-page .auth-tab:hover {
    color: var(--text-primary, #333);
}

.auth-page .auth-tab.active {
    background: var(--bg-primary, #fff);
    color: var(--color-primary, #2563eb);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-page .auth-form.hidden {
    display: none;
}

.auth-page .auth-weixin-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 52px;
    height: 52px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.auth-page .auth-weixin-toggle::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 52px solid #22c55e;
    border-left: 52px solid transparent;
}

.auth-page .auth-weixin-toggle::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 52px solid rgba(255, 255, 255, 0.16);
    border-left: 52px solid transparent;
    transform: translate(-6px, 6px);
}

.auth-page .auth-weixin-toggle .corner-icon {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}

.auth-page .auth-weixin-toggle .weixin-icon {
    box-shadow: inset 0 0 0 2px #16a34a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316a34a'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='3' height='3'/%3E%3Crect x='18' y='14' width='3' height='3'/%3E%3Crect x='14' y='18' width='3' height='3'/%3E%3Crect x='18' y='18' width='3' height='3'/%3E%3C/svg%3E");
}

.auth-page .auth-weixin-toggle .pc-icon {
    display: none;
    box-shadow: inset 0 0 0 2px #0f172a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f172a'%3E%3Crect x='3' y='4' width='18' height='12' rx='1'/%3E%3Crect x='8' y='18' width='8' height='2'/%3E%3Crect x='6' y='20' width='12' height='2'/%3E%3C/svg%3E");
}

.auth-page .auth-card.weixin-active .auth-weixin-toggle::before {
    border-top-color: #94a3b8;
}

.auth-page .auth-card.weixin-active .auth-weixin-toggle .weixin-icon {
    display: none;
}

.auth-page .auth-card.weixin-active .auth-weixin-toggle .pc-icon {
    display: block;
}

.auth-page .auth-social {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    text-align: center;
}

.auth-page .auth-social .social-title {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.auth-page .auth-social .social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
    background: #ecfdf3;
    color: #16a34a;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-page .auth-social .qs-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.auth-page .auth-social .social-btn:hover {
    background: #dcfce7;
}

.auth-page .auth-social .social-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
}

.auth-page .auth-social .social-icon::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    right: 3px;
    top: 4px;
}

.auth-page .auth-weixin-back {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    color: #1e3a8a;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.auth-page .auth-weixin-back:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #93c5fd;
}

.auth-page .sms-code-group {
    position: relative;
}

.auth-page .sms-code-group input {
    padding-right: 110px !important;
}

.auth-page .sms-send-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 7px 12px;
    border: none;
    background: linear-gradient(135deg, var(--color-primary, #2563eb) 0%, #7c3aed 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.auth-page .sms-send-btn:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-page .sms-send-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    box-shadow: none;
}

/* Form Styles */
.auth-form .form-group {
    position: relative;
    margin-bottom: 14px;
}

.auth-form .form-group>label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
}

.auth-form .form-group input[type="text"],
.auth-form .form-group input[type="email"],
.auth-form .form-group input[type="password"],
.auth-form .form-group input[type="tel"] {
    width: 100%;
    padding: 14px 46px 14px 46px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #fff;
    box-sizing: border-box;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.auth-form .form-group input::placeholder {
    color: #94a3b8;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: #64748b;
}

/* Form Row */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0ea5e9;
}

/* Agreement Group - Fix for overlap */
.auth-form .agreement-group {
    margin: 16px 0 20px 0 !important;
    position: relative;
    z-index: 2;
}

/* Fix for unclickable - override generic label styles */
.auth-form .form-group>label.agreement-label {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    pointer-events: auto;
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.agreement-text a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link {
    color: #0ea5e9;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
    border-radius: 2px;
}

.strength-bar span.weak {
    background: #ef4444;
}

.strength-bar span.medium {
    background: #f59e0b;
}

.strength-bar span.strong {
    background: #10b981;
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 20px;
}

.strength-text.weak {
    color: #ef4444;
}

.strength-text.medium {
    color: #f59e0b;
}

.strength-text.strong {
    color: #10b981;
}

/* Slider Captcha */
.captcha-group {
    margin-bottom: 16px;
}

.slider-captcha {
    user-select: none;
    -webkit-user-select: none;
}

.captcha-track {
    position: relative;
    height: 44px;
    background: linear-gradient(to right, #e2e8f0, #f1f5f9);
    border-radius: 24px;
    overflow: hidden;
}

.captcha-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: grab;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    transition: left 0.3s, background 0.3s;
}

.captcha-slider:active {
    cursor: grabbing;
}

.captcha-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 44px;
    background: linear-gradient(to right, rgba(14, 165, 233, 0.3), rgba(16, 185, 129, 0.3));
    border-radius: 24px;
    transition: width 0.3s;
}

.captcha-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1;
}

.slider-captcha.verified .captcha-track {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
}

.slider-captcha.verified .captcha-slider {
    background: linear-gradient(135deg, #10b981, #059669);
}

.slider-captcha.verified .captcha-progress {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.2));
}

.slider-captcha.verified .captcha-text {
    color: #10b981;
    font-weight: 600;
}

/* Form Message */
.form-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    display: none;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Submit Button */
.auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    /* display: flex; - Removed to fix overlap issue */
    /* align-items: center; */
    /* justify-content: center; */
    /* gap: 8px; */
    display: inline-block;
    margin-top: 8px;
    text-align: center;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.4);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-loading .spinner {
    width: 20px;
    height: 20px;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 5px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    margin: 0;
    color: #64748b;
}

.auth-footer a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s;
}

.auth-footer a:hover {
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .auth-page {
        padding: 16px 12px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-form .form-group input[type="text"],
    .auth-form .form-group input[type="email"],
    .auth-form .form-group input[type="password"],
    .auth-form .form-group input[type="tel"] {
        padding: 12px 42px 12px 42px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .captcha-slider {
        width: 40px;
        height: 40px;
    }

    .captcha-track {
        height: 40px;
    }

    .captcha-progress {
        width: 40px;
    }
}
