/* 車査定ウィジェット全体のスタイル */
.car-assessment-widget {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(102, 126, 234, 0.15);
  overflow: hidden;
  padding: 3px;
}

/* フォームヘッダー */
.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-header-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.form-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.form-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* フォームのスタイル */
.car-assessment-form {
  padding: 32px 24px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.car-assessment-form .form-group {
  margin-bottom: 24px;
}

.car-assessment-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
  letter-spacing: 0.025em;
}

/* セレクトボックスのラッパー */
.select-wrapper {
  position: relative;
}

.select-wrapper .select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.select-wrapper select:focus ~ .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* インプットのラッパー */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

/* フォームコントロール共通 */
.car-assessment-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  background: #ffffff;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  color: #1f2937;
  box-sizing: border-box;
}

.car-assessment-form select.form-control {
  padding-right: 44px;
  cursor: pointer;
}

.car-assessment-form .form-control:hover {
  border-color: #d1d5db;
}

.car-assessment-form .form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.car-assessment-form .form-control::placeholder {
  color: #9ca3af;
}

/* ラジオボタン */
.radio-group {
  display: flex;
  gap: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding-left: 28px;
  user-select: none;
  color: #374151;
  font-size: 15px;
  transition: color 0.2s ease;
}

.radio-label:hover {
  color: #1f2937;
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-circle {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: white;
  transition: all 0.2s ease;
}

.radio-label:hover .radio-circle {
  border-color: #9ca3af;
}

.radio-label input[type="radio"]:checked ~ .radio-circle {
  border-color: #667eea;
}

.radio-label input[type="radio"]:checked ~ .radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
}

.radio-label input[type="radio"]:checked ~ .radio-text {
  color: #1f2937;
  font-weight: 600;
}

/* 査定ボタン */
.btn-assessment {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-assessment::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-assessment:hover::before {
  opacity: 1;
}

.btn-assessment:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.btn-assessment .btn-text,
.btn-assessment .btn-icon {
  position: relative;
  z-index: 1;
}

.btn-assessment:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-assessment .btn-icon {
  transition: transform 0.2s ease;
}

.btn-assessment:hover .btn-icon {
  transform: translateX(4px);
}

.btn-assessment:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* ローディング表示 */
.assessment-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 16px;
  font-weight: 500;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: #fff;
  font-weight: 500;
}

/* 査定結果 */
.assessment-result {
  background: white;
  animation: slideIn 0.3s ease;
  margin-top: 10px;
  border-radius: 14px;
}

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

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.result-header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 700;
}

.close-result {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
}

.close-result:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.result-content {
  padding: 24px;
}

/* 車両詳細 */
.car-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.car-detail-item {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.detail-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}

.detail-value {
  display: block;
  font-size: 15px;
  color: #1f2937;
  font-weight: 600;
}

/* 価格表示 */
.price-range {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.price-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
  font-weight: 500;
}

.price-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  
}

.min-price, .max-price {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.price-separator {
  font-size: 20px;
  opacity: 0.7;
}

/* CTAセクション */
.cta-section {
  text-align: center;
  margin-bottom: 20px;
}

.cta-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: #ef4444;
  color: white !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transition: all 0.2s ease;
  margin-top: 0 !important;
}

.cta-button:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.cta-free-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #cb0000;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* 免責事項 */
.disclaimer-section {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.disclaimer-text {
  font-size: 12px;
  color: #92400e;
  text-align: left;
  margin: 0;
  line-height: 1.6;
  margin-bottom: 0 !important;
}

/* レポートリンク */
.report-link-section {
  text-align: center;
}

.report-link {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.report-link:hover {
  color: #764ba2;
  text-decoration: underline;
}

.assessment-notification {
  padding: 16px;
  color: #fff;
}

.repair-notice {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 12px;
  font-weight: 500;
}

/* エラー表示 */
.error-message-container {
  text-align: center;
  padding: 16px 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  margin-bottom: 24px;
}

.error-icon {
  margin-bottom: 16px;
}

.error-icon svg {
  color: #dc2626;
  width: 48px;
  height: 48px;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 8px 0;
}

.error-message {
  font-size: 14px;
  color: #7f1d1d;
  line-height: 1.6;
  margin-bottom: 0 !important;
}

.car-info-error {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.car-info-error .info-item {
  padding: 4px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #991b1b;
}

/* エラー時のCTAセクション */
.error-cta-text {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 16px;
}

/* CTAボタンのアニメーション */
.cta-button.animated {
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.cta-emphasis {
  font-size: 14px;
  font-weight: 600;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
  .car-assessment-form {
    padding: 16px;
  }
  
  .form-title {
    font-size: 20px;
  }

  .form-header {
    margin-bottom: 16px;
  }

  .car-assessment-form .form-group {
    margin-bottom: 8px;
  }
  
  .car-details {
    grid-template-columns: 1fr;
    margin-bottom: 16px;
  }
  
  .price-values {
    flex-direction: column;
    gap: 8px;
  }

  .price-range {
    margin-bottom: 16px;
  }
  
  .min-price, .max-price {
    font-size: 28px;
  }
  
  .price-separator {
    transform: rotate(90deg);
  }
  
  .cta-button {
    width: 100%;
    padding: 14px 8px;
    font-size: 15px;
  }

  .result-header {
    padding: 16px;
  }

  .result-content {
    padding: 16px;
  }

  .report-link {
    font-size: 12px;
  }
}

