/* ===== 登录注册页面样式 ===== */

/* 确保登录注册页面的body和html没有边距 */
.auth-page {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden;
    overflow-y: hidden;
    background: #fafafa;
    height: 100vh;
}

/* Brand header with logo and title */
.auth-brand {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: opacity 0.2s ease;
}

.auth-brand:hover {
    opacity: 0.8;
}

.auth-logo-text {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.03em;
    line-height: 1;
}

.auth-title-text {
    font-size: 28px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: -0.02em;
    line-height: 1;
}


.auth-main {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    background: #fafafa;
    position: relative;
    z-index: 1;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0;
    right: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* 注册页面使用更宽的容器 */
.register-page .auth-container {
    max-width: 700px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    padding: 32px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-subtitle {
    font-size: 15px;
    color: #6b7280;
    font-weight: 400;
    margin-top: 8px;
}

.auth-error {
    font-size: 13px;
    color: #dc2626;
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 6px;
}

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

/* 两列布局的行容器 */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
}

.form-label {
    position: relative;
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.optional-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #111;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.form-input:hover:not(:focus) {
    border-color: #9ca3af;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-textarea {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    line-height: 1.5;
    padding: 10px 12px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7280' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0;
}

.password-toggle:hover {
    color: #6b7280;
}

.password-toggle .eye-icon {
    width: 18px;
    height: 18px;
}

.password-toggle.active .eye-icon path:first-child {
    display: none;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #374151;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #000;
}

.forgot-link {
    color: #111;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #000;
    text-decoration: underline;
}

.btn-auth-submit {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #000;
    border: 1px solid #000;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 20px;
    font-family: inherit;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.btn-auth-submit:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.btn-auth-submit:active {
    transform: scale(0.98);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e5e5;
}

.auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 16px;
    color: #999;
    font-size: 13px;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.auth-link {
    color: #000;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    margin-left: 4px;
}

.auth-link:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

.link-inline {
    color: #000;
    text-decoration: underline;
    transition: color 0.2s;
}

.link-inline:hover {
    color: #333;
}

/* ===== 点击验证码 ===== */
.click-captcha-wrapper {
    position: relative;
}

.click-captcha-bubble {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    background: #000;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.click-captcha-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #000;
}

.click-captcha-bubble.show {
    display: block;
}

.click-captcha {
    position: relative;
    width: 100%;
    height: 44px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.click-captcha:hover {
    border-color: #d1d5db;
    background: #f5f5f5;
}

.click-captcha-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.3s ease;
}

/* 验证按钮 */
.click-captcha-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 2px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.click-captcha-btn::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #666;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.click-captcha-btn::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* 悬停效果 */
.click-captcha:hover .click-captcha-btn {
    border-color: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: scale(1.05);
}

.click-captcha:hover .click-captcha-btn::after {
    background: #000;
}

/* 验证中状态 - 闪烁动画 */
.click-captcha.verifying .click-captcha-btn {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.click-captcha.verifying .click-captcha-btn::before {
    opacity: 1;
    animation: verifyingSpin 0.8s linear infinite;
    border-color: #3b82f6;
    border-top-color: transparent;
}

.click-captcha.verifying .click-captcha-btn::after {
    opacity: 0;
    transform: scale(0);
}

.click-captcha.verifying .click-captcha-text {
    color: #3b82f6;
}

@keyframes verifyingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 验证成功状态 */
.click-captcha.success {
    background: #ecfdf5;
    border-color: #10b981;
    cursor: default;
}

.click-captcha.success .click-captcha-btn {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.click-captcha.success .click-captcha-btn::before {
    display: none;
}

.click-captcha.success .click-captcha-btn::after {
    opacity: 1;
    transform: scale(1);
    width: 12px;
    height: 6px;
    background: transparent;
    border: 2px solid #fff;
    border-width: 0 0 2px 2px;
    border-radius: 0;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.click-captcha.success .click-captcha-text {
    color: #059669;
    font-weight: 600;
}

/* 验证失败状态 */
.click-captcha.fail {
    background: #fef2f2;
    border-color: #ef4444;
    animation: clickCaptchaShake 0.5s ease;
}

.click-captcha.fail .click-captcha-btn {
    background: #fef2f2;
    border-color: #ef4444;
    animation: clickBtnShake 0.5s ease;
}

.click-captcha.fail .click-captcha-btn::before {
    display: none;
}

.click-captcha.fail .click-captcha-btn::after {
    opacity: 1;
    transform: scale(1);
    width: 14px;
    height: 2px;
    background: #ef4444;
    border-radius: 0;
    transform: rotate(45deg);
}

.click-captcha.fail .click-captcha-text {
    color: #dc2626;
}

.click-captcha.fail .click-captcha-text::after {
    content: ' - Failed, try again';
    font-size: 12px;
    opacity: 0.8;
}

@keyframes clickCaptchaShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

@keyframes clickBtnShake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-10deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(6deg); }
}

/* 禁用状态 */
.click-captcha.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== 响应式 ===== */

@media (max-width: 1024px) {
    .auth-logo-text {
        font-size: 28px;
    }
    
    .auth-title-text {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .auth-logo-text {
        font-size: 26px;
    }
    
    .auth-title-text {
        font-size: 22px;
    }

    .auth-brand {
        gap: 8px;
    }

    .auth-main {
        padding: 16px 0;
        height: 100vh;
    }
    
    .auth-card {
        max-height: calc(100vh - 32px);
        padding: 32px 24px;
    }

    .auth-container {
        padding: 0 16px;
        max-width: 100% !important;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 10px;
    }

    .auth-header {
        margin-bottom: 28px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-input {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 10px 12px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }

    /* 移动端：两列布局改为单列 */
    .form-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    .form-row .form-group {
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .auth-logo-text {
        font-size: 24px;
    }
    
    .auth-title-text {
        font-size: 20px;
    }

    .auth-brand {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .auth-main {
        padding: 12px 0;
        height: 100vh;
    }
    
    .auth-card {
        max-height: calc(100vh - 24px);
        padding: 28px 20px;
    }

    .auth-container {
        padding: 0 12px;
    }

    .auth-card {
        padding: 24px 16px;
        border-radius: 10px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .form-input {
        padding: 9px 10px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .btn-auth-submit {
        padding: 11px 14px;
        font-size: 14px;
    }

    .form-options {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    
    .form-options .checkbox-label span {
        font-size: 12px;
    }
    
    .form-options .forgot-link {
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* 注册页面复选框文本 */
    .auth-form > .form-group .checkbox-label span {
        font-size: 12px;
        line-height: 1.4;
    }
}
