/* 登录注册页面专用样式 */

/* 平滑过渡动画 */
* {
    transition: all 0.2s ease-in-out;
}

/* 输入框聚焦效果 */
.input-focus:focus {
    border-color: #6b7280 !important;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1) !important;
    outline: none !important;
}

/* 现代化邮箱输入框样式 */
.email-input-container {
    position: relative;
}

.email-input-container input {
    padding-right: 6rem;
}

.email-input-container input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* 域名选择器样式 */
#selectedDomain {
    background-color: #f3f4f6;
    border-left: 1px solid #d1d5db;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1px;
    height: calc(100% - 2px);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    color: #4b5563;
    font-weight: 500;
}

#currentDomain {
    margin-right: 0.25rem;
}

#selectedDomain:hover {
    background-color: #e5e7eb;
    color: #374151;
}

#selectedDomain.active {
    background-color: #d1d5db;
    color: #1f2937;
}

/* 下拉菜单样式 */
#domainDropdown {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.domain-option {
    transition: all 0.15s ease;
    font-weight: 500;
}

.domain-option:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.domain-option.selected {
    background-color: #e5e7eb;
    color: #1f2937;
}

.domain-option:first-child {
    border-radius: 0.375rem 0.375rem 0 0;
}

.domain-option:last-child {
    border-radius: 0 0 0.375rem 0.375rem;
}

/* 点击外部关闭下拉菜单的遮罩 */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

/* 响应式设计 - 移动设备优化 */
@media (max-width: 640px) {
    .email-input-container input {
        padding-right: 5rem;
    }

    #selectedDomain {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        font-size: 0.875rem;
    }

    #domainDropdown {
        width: 8rem;
        right: 0.25rem;
    }

    .domain-option {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    #selectedDomain {
        background-color: #374151;
        border-left-color: #4b5563;
        color: #d1d5db;
    }

    #selectedDomain:hover {
        background-color: #4b5563;
        color: #f3f4f6;
    }

    #selectedDomain.active {
        background-color: #6b7280;
        color: #ffffff;
    }

    #domainDropdown {
        background-color: #374151;
        border-color: #4b5563;
    }

    .domain-option {
        color: #d1d5db;
    }

    .domain-option:hover {
        background-color: #4b5563;
        color: #f3f4f6;
    }

    .domain-option.selected {
        background-color: #6b7280;
        color: #ffffff;
    }
}

/* 验证码容器样式 */
.captcha-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.captcha-container:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.captcha-container.loading {
    background-color: #f3f4f6;
}

.captcha-container.loading::after {
    content: '加载验证码中...';
    color: #6b7280;
    font-size: 0.875rem;
}

.captcha-container.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.captcha-container.error::after {
    content: '验证码加载失败，请刷新重试';
    color: #dc2626;
    font-size: 0.875rem;
}

/* 验证码成功状态 */
.captcha-container.success {
    border-color: #10b981;
    background-color: #ecfdf5;
}

/* 验证码显示样式 */
.captcha-display {
    position: relative;
    display: inline-block;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.captcha-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.captcha-image {
    display: block;
    width: 140px;
    height: 50px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    object-fit: contain;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.captcha-refresh-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.captcha-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.captcha-refresh-btn svg {
    width: 1rem;
    height: 1rem;
}

/* 验证码模态框样式 */
.captcha-modal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.captcha-modal-content {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 验证码输入框样式 */
.captcha-modal input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* 验证码按钮样式 */
.captcha-modal button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* 响应式验证码 */
@media (max-width: 640px) {
    .captcha-modal-content {
        margin: 1rem;
        max-width: none;
    }

    .captcha-container {
        padding: 0.5rem;
        min-height: 70px;
    }

    .captcha-image {
        width: 120px;
        height: 45px;
    }

    .captcha-display {
        transform: scale(0.9);
        transform-origin: center;
    }

    .captcha-refresh-btn {
        top: 1px;
        right: 1px;
        padding: 0.125rem;
    }
}

/* 输入框错误和成功状态 */
.email-input-group .error-input {
    border-color: #ef4444;
}

.email-input-group .success-input {
    border-color: #10b981;
}

.email-input-group:has(.error-input) {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.email-input-group:has(.success-input) {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* 按钮悬停效果 */
.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* 卡片阴影 */
.card-shadow {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 背景图案 */
.subtle-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 20px 20px;
}

/* 表单切换动画 */
.form-container {
    position: relative;
    overflow: hidden;
}

.form-slide {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .card-shadow {
        margin: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    #messageContainer {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }

    .message-slide-in {
        max-width: none;
    }

    @keyframes slideInFromRight {
        0% {
            transform: translateX(100%);
            opacity: 0;
        }
        100% {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOutToRight {
        0% {
            transform: translateX(0);
            opacity: 1;
        }
        100% {
            transform: translateX(100%);
            opacity: 0;
        }
    }
}

/* 自定义复选框样式 */
.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover .checkmark {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #374151;
    border-color: #374151;
}

.custom-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* 消息提示容器 */
#messageContainer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    pointer-events: none;
}

#messageContainer > * {
    pointer-events: auto;
}

/* 消息提示滑入动画 */
.message-slide-in {
    animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message-slide-out {
    animation: slideOutToRight 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(calc(100% + 1rem));
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100% + 1rem));
        opacity: 0;
    }
}

/* 消息提示悬停效果 */
.message-slide-in:hover {
    transform: translateX(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 链接悬停效果 */
a:hover {
    text-decoration: none;
}

/* 表单验证错误样式 */
.error-input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 成功状态样式 */
.success-input {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* 密码强度指示器 */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.strength-weak {
    background-color: #ef4444;
    width: 33%;
}

.strength-medium {
    background-color: #f59e0b;
    width: 66%;
}

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