/* AI見積フォーム専用スタイル */

/* メッセージボックス */
.message-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
}

.message-box i {
  font-size: 2rem;
  flex-shrink: 0;
}

.message-box p {
  margin: 0;
  line-height: 1.6;
}

.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.success-message i {
  color: #28a745;
}

.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.error-message i {
  color: #dc3545;
}

/* レイアウト修正（サイドナビとの共存） */
@media screen and (min-width: 960px) {
  .quote-form-container {
    float: right;
    width: 75%;
  }
}

.quote-form-container {
  padding: 20px;
  max-width: 100%;
}

/* イントロ */
.quote-intro {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #c9a227;
}

.quote-description {
  color: #555;
  line-height: 1.8;
}

/* フォームセクション */
.form-section {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.form-section-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #c9a227;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title i {
  color: #c9a227;
}

/* 画像ギャラリー */
.generated-image-gallery {
  margin-bottom: 20px;
}

.gallery-label,
.preview-label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
}

.gallery-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-item {
  position: relative;
  width: 100px;
  height: 100px;
  border: 3px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-item:hover {
  border-color: #c9a227;
}

.gallery-item.selected {
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.gallery-item.selected .gallery-number {
  background: #c9a227;
}

.gallery-check {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: #c9a227;
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.gallery-item.selected .gallery-check {
  display: flex;
}

/* 選択中の画像プレビュー */
.selected-images-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.selected-preview-item {
  position: relative;
  width: 120px;
  border: 2px solid #c9a227;
  border-radius: 8px;
  overflow: hidden;
  background: #f9f9f9;
}

.selected-preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.selected-preview-item .image-label {
  display: block;
  padding: 6px;
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  background: #f0f0f0;
}

.selected-preview-item .remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
}

.selected-image-preview {
  margin-bottom: 20px;
}

/* 追加ファイルセクション */
.additional-file-section {
  margin-top: 20px;
}

.remove-image-btn,
.remove-file-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.2s;
}

.remove-image-btn:hover,
.remove-file-btn:hover {
  background: #c0392b;
}

.additional-file-area {
  width: 150px;
}

.file-upload-box {
  width: 100%;
  height: 150px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
  text-align: center;
  padding: 10px;
}

.file-upload-box:hover {
  border-color: #c9a227;
  background: rgba(201, 162, 39, 0.05);
}

.file-upload-box i {
  font-size: 2rem;
  color: #c9a227;
}

.file-upload-box span {
  font-size: 0.85rem;
  color: #666;
}

.additional-file-preview {
  position: relative;
  width: 100%;
  padding: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.file-info i {
  font-size: 1.5rem;
  color: #666;
}

.file-info span {
  font-size: 0.85rem;
  color: #333;
}

/* フォームグループ */
.quote-form-container .form-group {
  margin-bottom: 20px;
}

.quote-form-container .form-label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.quote-form-container .form-label.required::after {
  content: ' *';
  color: #e74c3c;
}

.form-input,
.quote-form-container .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-input:focus,
.quote-form-container .form-textarea:focus {
  outline: none;
  border-color: #c9a227;
}

.quote-form-container .form-textarea {
  resize: vertical;
  height: auto;
  min-height: 180px;
}

.quote-form-container .form-hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 8px;
}

/* 送信ボタン */
.form-actions {
  text-align: center;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 48px;
  border: none;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
  color: #fff;
  transition: all 0.2s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

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

/* 個人情報 */
.privacy-notice {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.privacy-notice a {
  color: #3470b6;
}

/* 戻るリンク */
.quote-form-container .back-link {
  text-align: center;
}

.quote-form-container .back-link a {
  color: #3470b6;
  text-decoration: none;
}

.quote-form-container .back-link a:hover {
  text-decoration: underline;
}

/* レスポンシブ */
@media (max-width: 600px) {
  .quote-form-container {
    padding: 10px;
  }

  .form-section {
    padding: 15px;
  }

  .additional-file-area {
    width: 100%;
  }

  .file-upload-box {
    height: 100px;
  }

  .btn-submit {
    width: 100%;
  }

  .selected-images-container {
    justify-content: center;
  }

  .selected-preview-item {
    width: 100px;
  }

  .selected-preview-item img {
    height: 80px;
  }

  .form-input,
  .quote-form-container .form-textarea {
    font-size: 16px; /* iOS zoom防止 */
  }
}
