/**
 * Custom Contact Form - フロントエンドスタイル (完全版)
 * 入力・確認・完了 すべてのデザインを含みます
 */

/* ==========================================
   1. 共通設定・コンテナ
   ========================================== */
.ccf-form-wrapper * {
  box-sizing: border-box;
}

.ccf-form-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.ccf-form-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   2. 入力画面 (Input) のレイアウト
   ========================================== */
.ccf-form-fields {
  display: grid;
  gap: 24px;
  margin-bottom: 30px;
}

/* 項目グループ（外枠） */
.ccf-field-group {
  display: flex;
  flex-direction: column;
  width: 100% !important;
}

/* 「50%」設定の時だけ外枠を半減 */
.ccf-field-group.ccf-width-half {
  width: calc(50% - 12px) !important;
}

/* 入力フィールドのデザイン */
.ccf-form-container .ccf-input,
.ccf-form-container .ccf-textarea,
.ccf-form-container .ccf-select {
  width: 80%; /* 標準幅 */
  max-width: 100%;
  padding: 12px 16px;
  font-size: 16px; /* フォントサイズ統一 */
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  line-height: 1.5;
}

/* メッセージ表示エリア (枠線なし) */
.ccf-form-container .ccf-message-content {
  width: 80%;
  max-width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  line-height: 1.8;
  color: #4b5563;
  font-size: 15px;
}

/* 幅指定クラス */
.ccf-form-container .ccf-field-group.ccf-width-full .ccf-input,
.ccf-form-container .ccf-field-group.ccf-width-full .ccf-select,
.ccf-form-container .ccf-field-group.ccf-width-full .ccf-textarea,
.ccf-form-container .ccf-field-group.ccf-width-full .ccf-message-content {
  width: 100% !important;
}

.ccf-form-container .ccf-field-group.ccf-width-small .ccf-input,
.ccf-form-container .ccf-field-group.ccf-width-small .ccf-select {
  width: 120px !important;
}

.ccf-form-container .ccf-field-group.ccf-width-medium .ccf-input,
.ccf-form-container .ccf-field-group.ccf-width-medium .ccf-select {
  width: 200px !important;
}

.ccf-form-container .ccf-field-group.ccf-width-large .ccf-input,
.ccf-form-container .ccf-field-group.ccf-width-large .ccf-select {
  width: 300px !important;
}

/* ラベルデザイン */
.ccf-label {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: #374151;
  font-size: 16px;
  margin-bottom: 8px;
}

/* 必須・任意バッジ */
.ccf-required {
  background-color: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
  line-height: 1;
  white-space: nowrap;
}

.ccf-any {
  background-color: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 10px;
  line-height: 1;
  white-space: nowrap;
}

/* 接尾辞 */
.ccf-field-with-suffix {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.ccf-field-group.ccf-field-with-suffix {
  flex-direction: row;
  flex-wrap: wrap;
}
.ccf-input-wrapper-with-suffix {
  display: flex;
  align-items: center;
  width: 100%;
}
.ccf-field-suffix {
  margin-left: 8px;
  font-weight: 500;
}

/* ラジオ・チェックボックス */
.ccf-radio-group,
.ccf-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 5px 0;
}
.ccf-radio-label,
.ccf-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 16px;
}
.ccf-radio-label input,
.ccf-checkbox-label input {
  width: auto !important;
  margin: 0;
  transform: scale(1.1);
}

/* ==========================================
   3. 確認画面 (Confirm) のレイアウト ★ここを大幅追加
   ========================================== */
.ccf-confirm-title {
  text-align: center;
  margin-bottom: 30px;
}
.ccf-confirm-title h2 {
  font-size: 24px;
  color: #111827;
  margin-bottom: 10px;
}
.ccf-confirm-title p {
  color: #6b7280;
  font-size: 14px;
}

.ccf-confirm-content {
  border-top: 1px solid #e5e7eb;
  margin-bottom: 30px;
}

/* 行のデザイン */
.ccf-confirm-row {
  display: grid;
  grid-template-columns: 200px 1fr; /* 左200px(ラベル) : 右フリー(内容) */
  border-bottom: 1px solid #e5e7eb;
}

/* ラベル側 */
.ccf-confirm-label {
  background-color: #f9fafb; /* 薄いグレー */
  padding: 16px 20px;
  font-weight: 700;
  color: #374151;
  font-size: 15px;
  display: flex;
  align-items: center; /* 縦中央揃え */
}

/* 内容側 */
.ccf-confirm-value {
  padding: 16px 20px;
  font-size: 16px;
  color: #111827;
  line-height: 1.6;
  background-color: #ffffff;
  word-break: break-all; /* 長いURLなども折り返す */
}

/* ==========================================
   4. 完了画面 (Thanks) のレイアウト ★ここも調整
   ========================================== */
.ccf-thanks-content {
  text-align: center;
  padding: 20px 0;
}

.ccf-thanks-icon {
  color: #10b981; /* 緑色 */
  margin-bottom: 20px;
}
.ccf-thanks-icon svg {
  width: 64px;
  height: 64px;
}

.ccf-thanks-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.ccf-thanks-message {
  font-size: 16px;
  line-height: 1.8;
  color: #4b5563;
}

/* ==========================================
   5. ボタン・共通パーツ
   ========================================== */
.ccf-form-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

.ccf-button {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
}
.ccf-button:hover {
  opacity: 0.9;
}

.ccf-button-primary {
  background: #3b82f6;
  color: white;
}
.ccf-button-secondary {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

/* 隠しフィールド */
input[type="hidden"] {
  display: none !important;
}

/* ==========================================
   6. レスポンシブ (スマホ: 600px以下)
   ========================================== */
@media (max-width: 600px) {
  .ccf-form-container {
    padding: 20px 15px; /* 余白を少し狭く */
  }

  /* 入力画面：全項目100%幅に */
  .ccf-field-group.ccf-width-half {
    width: 100% !important;
  }
  .ccf-form-container .ccf-input,
  .ccf-form-container .ccf-select,
  .ccf-form-container .ccf-textarea,
  .ccf-form-container .ccf-message-content {
    width: 100% !important;
  }

  /* 固定幅クラスも解除 */
  .ccf-form-container .ccf-field-group[class*="ccf-width-"] .ccf-input,
  .ccf-form-container .ccf-field-group[class*="ccf-width-"] .ccf-select {
    width: 100% !important;
  }

  /* 確認画面：スマホ対応 (縦積みに変更) */
  .ccf-confirm-row {
    display: block; /* グリッド解除 */
  }
  .ccf-confirm-label {
    width: 100%;
    background-color: transparent; /* 背景色なし */
    padding: 15px 0 5px 0; /* 下の余白を詰める */
    font-size: 14px;
    color: #6b7280; /* 少し薄い色に */
    border-bottom: none;
  }
  .ccf-confirm-value {
    width: 100%;
    padding: 0 0 15px 0;
    font-weight: 500;
  }

  /* ボタン */
  .ccf-form-actions {
    flex-direction: column-reverse; /* 「戻る」を下に */
  }
  .ccf-button {
    width: 100%;
    text-align: center;
  }
}
