/**
 * HiTemp 弹窗公共基础样式
 */

/* 弹窗遮罩 */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗内容 */
.auth-modal-content {
    background: #fff;
    border-radius: 20px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* 关闭按钮 */
.auth-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.auth-modal-close svg {
    width: 16px;
    height: 16px;
}

.auth-modal-close:hover {
    background: #ff5722;
    border-color: #ff5722;
    color: #fff;
    transform: scale(1.05);
}

/* 弹窗头部 */
.auth-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-modal-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.auth-modal-header p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

/* 表单样式 */
.auth-modal-form .form-group {
    margin-bottom: 18px;
}

.auth-modal-form .input-wrapper {
    position: relative;
}

.auth-modal-form .form-input {
    width: 100%;
    height: 50px;
    padding: 0 45px 0 45px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a2e;
    background: #f9fafb;
    transition: all 0.3s ease;
    outline: none;
}

.auth-modal-form .form-input:focus {
    border-color: #ff5722;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.1);
}

.auth-modal-form .form-input::placeholder {
    color: #9ca3af;
}

.auth-modal-form .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

/* 密码显示切换 */
.auth-modal-form .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 5px;
    transition: color 0.3s ease;
}

.auth-modal-form .password-toggle:hover {
    color: #6b7280;
}

.auth-modal-form .password-toggle svg {
    width: 20px;
    height: 20px;
}

/* 验证码 */
.captcha-wrapper {
    display: flex;
    gap: 12px;
}

.captcha-wrapper .captcha-input {
    flex: 1;
}

.captcha-wrapper .captcha-box {
    width: 110px;
    height: 50px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.captcha-wrapper .captcha-box:hover {
    border-color: #ff5722;
}

.captcha-wrapper .captcha-code {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 提交按钮 */
.auth-modal-form .submit-btn {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-modal-form .submit-btn:hover {
    background: linear-gradient(135deg, #e64a19 0%, #ff5722 100%);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
    transform: translateY(-2px);
}

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

.auth-modal-form .submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-modal-form .submit-btn.loading {
    pointer-events: none;
}

.auth-modal-form .submit-btn .btn-text {
    transition: opacity 0.3s ease;
}

.auth-modal-form .submit-btn.loading .btn-text {
    opacity: 0;
}

.auth-modal-form .submit-btn .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

.auth-modal-form .submit-btn.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 弹窗底部 */
.auth-modal-footer {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 20px;
}

.auth-modal-footer a {
    color: #ff5722;
    text-decoration: none;
    font-weight: 500;
}

.auth-modal-footer a:hover {
    color: #e64a19;
}

/* 消息提示 */
.auth-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 100000;
    animation: toastIn 0.3s ease;
}

.auth-toast.error {
    background: #fff;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-toast.success {
    background: #fff;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.auth-toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

.auth-toast svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 响应式 */
@media screen and (max-width: 480px) {
    .auth-modal-content {
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .auth-modal-header h2 {
        font-size: 22px;
    }
    
    .auth-modal-form .form-input {
        height: 46px;
        font-size: 14px;
    }
    
    .captcha-wrapper .captcha-box {
        width: 100px;
        height: 46px;
    }
    
    .auth-modal-form .submit-btn {
        height: 46px;
        font-size: 15px;
    }
}

