/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px 0;
  display: flex;
  align-items: center;
}

/* 容器样式 */
.form-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 头部样式 */
.form-header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}

.form-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* 步骤导航样式 */
.steps-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 2rem;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -2rem;
  top: 15px;
  width: 4rem;
  height: 2px;
  background: #dee2e6;
  z-index: 1;
}

.step-item.active:not(:last-child)::after,
.step-item.completed:not(:last-child)::after {
  background: #4facfe;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dee2e6;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
}

.step-item.active .step-number {
  background: #4facfe;
  color: white;
}

.step-item.completed .step-number {
  background: #28a745;
  color: white;
}

.step-item.completed .step-number::before {
  content: '✓';
  font-size: 0.8rem;
}

.step-title {
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: 500;
  text-align: center;
  transition: color 0.3s ease;
}

.step-item.active .step-title {
  color: #4facfe;
  font-weight: 600;
}

.step-item.completed .step-title {
  color: #28a745;
}

/* 表单内容样式 */
.form-content {
  padding: 2rem;
}

.step-content {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

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

.form-section {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
}

.form-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.form-section-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4facfe;
  border-radius: 50%;
  margin-right: 10px;
}

/* 表单控件样式 */
.form-label {
  font-weight: 500;
  color: #555;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.required {
  color: #dc3545;
}

.form-control {
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
  outline: none;
}

.form-control.error {
  border-color: #dc3545;
}

.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

/* Select2 样式优化 - 修复下拉时页面变宽变长的问题 */
.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  border: 2px solid #e1e5e9 !important;
  border-radius: 10px !important;
  height: 45px !important;
  padding: 0.6rem 1rem !important;
  width: 100% !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #4facfe !important;
  box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 29px !important;
  padding-left: 0 !important;
  font-size: 0.95rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 41px !important;
  right: 10px !important;
}

/* 修复下拉框展开时的问题 */
.select2-dropdown {
  border: 2px solid #4facfe !important;
  border-radius: 10px !important;
  z-index: 9999 !important;
  max-width: 100% !important;
  width: auto !important;
  /* min-width: 100% !important; */
}

.select2-results {
  max-height: 200px !important;
  overflow-y: auto !important;
}

.select2-results__options {
  max-height: 200px !important;
}

/* 确保下拉框不会超出容器 */
.select2-container--open {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

/* 防止下拉框影响页面布局 */
.select2-container--open {
  z-index: 9999 !important;
}
.select2-dropdown {
  left: 0 !important;
  right: 0 !important;
  width: 20% !important;
}

/* 修复移动端下拉框问题 */
@media (max-width: 768px) {
  .select2-dropdown {
    max-width: calc(100vw - 40px) !important;
    left: 10px !important;
    right: 10px !important;
  }

  .select2-container--open .select2-dropdown {
    width: calc(100% - 20px) !important;
  }
}

/* 确保表单容器不会因为下拉框而变形 */
.form-container {
  position: relative;
  overflow: visible;
  overflow: hidden;
}

.form-section {
  position: relative;
  overflow: visible;
}

/* 修复可能的布局问题 */
.row {
  margin-left: 0;
  margin-right: 0;
}

.col-md-6,
.col-12 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* 自定义下拉选择组件样式 */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-input {
  width: 100%;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-select-input:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
  outline: none;
}

.custom-select-input.error {
  border-color: #dc3545;
}

.custom-select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.8rem;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.custom-select.open .custom-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* 下拉选项容器 */
.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #4facfe;
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 250px;
  overflow: hidden;
  display: none;
}

.custom-select.open .custom-select-dropdown {
  display: block;
}

.custom-select.open .custom-select-input {
  border-radius: 10px 10px 0 0;
  border-color: #4facfe;
}

/* 搜索框 */
.dropdown-search {
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-search input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.dropdown-search input:focus {
  border-color: #4facfe;
  outline: none;
  box-shadow: 0 0 0 0.1rem rgba(79, 172, 254, 0.25);
}

/* 选项列表 */
.dropdown-options {
  max-height: 180px;
  overflow-y: auto;
}

.dropdown-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background-color 0.2s ease;
}

.dropdown-option:hover {
  background-color: #f8f9ff;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-no-options {
  padding: 1.5rem;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* 滚动条样式 */
.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .custom-select-dropdown {
    max-height: 200px;
  }

  .dropdown-options {
    max-height: 130px;
  }
}

/* 支付方式样式 */
.payment-options {
  display: grid;
  gap: 1rem;
}

.payment-option {
  position: relative;
  border: 2px solid #e1e5e9;
  border-radius: 15px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.payment-option:hover {
  border-color: #4facfe;
  box-shadow: 0 2px 10px rgba(79, 172, 254, 0.1);
}

.payment-option input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.payment-option input[type='checkbox']:checked + .payment-label {
  border-color: #4facfe;
  background: #f8f9ff;
}

.payment-option input[type='checkbox']:checked ~ .payment-checkmark {
  opacity: 1;
  transform: scale(1);
}

.payment-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.payment-icon {
  font-size: 2rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.payment-info {
  flex: 1;
}

.payment-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.payment-desc {
  color: #666;
  font-size: 0.9rem;
}

.payment-checkmark {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  background: #4facfe;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

/* 滚动条样式 */
.modal-body::-webkit-scrollbar,
.options-list::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.options-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb,
.options-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.options-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 1rem;
  }

  .modal-body {
    max-height: 300px;
  }

  .options-list {
    max-height: 200px;
  }

  .payment-label {
    flex-direction: column;
    text-align: center;
  }

  .payment-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

/* 按钮样式 */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
  margin-top: 2rem;
}

.btn {
  border-radius: 25px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px 0;
  }

  .form-container {
    margin: 0 auto;
    border-radius: 15px;
  }

  .form-header {
    padding: 1.5rem;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }

  .steps-nav {
    padding: 1.5rem 0.5rem;
  }

  .step-item {
    padding: 0 1rem;
  }

  .step-item:not(:last-child)::after {
    width: 2rem;
    right: -1rem;
  }

  .form-content {
    padding: 1.5rem;
  }

  .form-section {
    padding: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .btn {
    width: 100%;
  }

  .payment-label {
    flex-direction: column;
    text-align: center;
  }

  .payment-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动条样式 */
.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
