/* 表单优化器样式 */

/* 多步骤表单进度条 */
.form-progress {
    margin-bottom: 40px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-steps .step {
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-steps .step.active {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-steps .step::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #e9ecef;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.progress-steps .step.active::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(51, 153, 153, 0.2);
}

/* 步骤内容 */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-content.active {
    display: block;
}

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

/* 步骤导航按钮 */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.step-btn {
    padding: 12px 30px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.step-btn.next-step {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.step-btn.next-step:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.step-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 智能字段优化 */
.smart-field {
    position: relative;
}

.smart-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.smart-suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* 实时验证样式 */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-control.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

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

/* 认证要求显示 */
.certification-requirements {
    background: linear-gradient(135deg, rgba(51, 153, 153, 0.05), rgba(51, 153, 153, 0.02));
    border: 1px solid rgba(51, 153, 153, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: none;
    animation: fadeIn 0.3s ease;
}

.certification-requirements h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.certification-requirements p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .form-progress {
        margin-bottom: 30px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .progress-steps .step {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .step-navigation {
        flex-direction: column;
    }
    
    .step-btn {
        width: 100%;
        justify-content: center;
    }
    
    .step-btn.next-step {
        order: -1;
        margin-left: 0;
    }
}

/* 表单组优化 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* 加载状态 */
.loading-state {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading-state.show {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功状态 */
.success-state {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05), rgba(40, 167, 69, 0.02));
    border: 1px solid rgba(40, 167, 69, 0.1);
    border-radius: 12px;
    animation: fadeIn 0.5s ease;
}

.success-state.show {
    display: block;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.5rem;
}

.success-state h3 {
    color: #28a745;
    margin-bottom: 10px;
}

.success-state p {
    color: #6c757d;
    margin-bottom: 0;
}

/* 表单字段分组 */
.field-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.field-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.field-group-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 10px;
    font-size: 0.9rem;
}

.field-group-title {
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

.tooltip-icon {
    color: var(--primary-color);
    cursor: help;
    font-size: 0.9rem;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #333;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    line-height: 1.4;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}