/* ============================================
   リピート注文フォーム - スタイルシート
   参考: インファクトリー
   ============================================ */

/* --------------------------------------------
   リセット・基本設定
   -------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 10px基準 */
}

body {
  margin: 0;
  padding: 0;
  font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "メイリオ", Meiryo, sans-serif;
  font-size: 1.4rem;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* --------------------------------------------
   レイアウト
   -------------------------------------------- */
.l-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.l-main {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------
   ヘッダー
   -------------------------------------------- */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.page-title {
  font-size: 2.4rem;
  color: #3498db;
  margin: 0 0 10px;
  font-weight: bold;
}

.page-description {
  font-size: 1.4rem;
  color: #666;
  margin: 0;
}

/* --------------------------------------------
   フォームセクション
   -------------------------------------------- */
.form-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.8rem;
  color: #fff;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  padding: 12px 20px;
  margin: 0 0 20px;
  border-radius: 4px;
}

/* --------------------------------------------
   フォームテーブル
   -------------------------------------------- */
.form-table-wrap {
  overflow-x: auto;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
}

.form-table th,
.form-table td {
  padding: 15px;
  border: 1px solid #ddd;
  vertical-align: top;
}

.form-table th {
  background: #f9f9f9;
  font-weight: bold;
  text-align: left;
  width: 200px;
  font-size: 1.4rem;
}

.form-table td {
  background: #fff;
}

/* --------------------------------------------
   必須ラベル
   -------------------------------------------- */
.label-required {
  display: inline-block;
  background: #3498db;
  color: #fff;
  font-size: 1.1rem;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 10px;
  font-weight: normal;
}

/* --------------------------------------------
   入力フィールド
   -------------------------------------------- */
.input-text,
.input-textarea,
.input-select {
  font-family: inherit;
  font-size: 1.4rem;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
  vertical-align: middle;
  margin: 0;
}

.input-text:focus,
.input-textarea:focus,
.input-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-full {
  width: 100%;
}

.input-half {
  width: 50%;
  min-width: 200px;
}

.input-name {
  width: 120px;
}

.input-zip {
  width: 120px;
}

.input-date {
  width: 180px;
}

.input-textarea {
  width: 100%;
  resize: vertical;
}

.input-select {
  min-width: 200px;
  position: relative;
  top: -5px;
}

.input-file {
  font-size: 1.4rem;
}

/* --------------------------------------------
   フォームグループ
   -------------------------------------------- */
.form-group {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 1.3rem;
  color: #555;
  width: 100%;
}

.form-note {
  font-size: 1.2rem;
  color: #888;
  margin: 5px 0 10px;
  width: 100%;
}

.input-prefix {
  display: inline-block;
  margin-right: 5px;
  font-size: 1.3rem;
  color: #555;
  flex-shrink: 0;
}

.date-suffix {
  margin-left: 10px;
  font-size: 1.3rem;
}

/* --------------------------------------------
   名前入力（横並び）
   -------------------------------------------- */
.name-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.name-row .input-text {
  width: 200px;
}

.name-inputs .input-prefix {
  flex-shrink: 0;
}

.name-inputs .input-name {
  flex-shrink: 0;
}

/* --------------------------------------------
   ラジオボタン・チェックボックス
   -------------------------------------------- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.radio-group-vertical {
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 1.4rem;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
  margin: 0 8px 0 0;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* --------------------------------------------
   ファイルアップロード
   -------------------------------------------- */
.file-upload-area {
  margin-bottom: 10px;
}

.file-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.file-note {
  font-size: 1.2rem;
  color: #888;
}

.btn-add-file {
  background: #f0f0f0;
  border: 1px dashed #999;
  padding: 8px 16px;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 4px;
  color: #555;
  transition: background 0.2s;
}

.btn-add-file:hover {
  background: #e5e5e5;
}

.btn-remove-file {
  background: #3498db;
  color: #fff;
  border: none;
  padding: 5px 12px;
  font-size: 1.2rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-remove-file:hover {
  background: #2980b9;
}

.uploaded-files {
  background: #f9f9f9;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.file-list {
  margin: 5px 0 0;
  padding-left: 20px;
}

.file-list li {
  margin-bottom: 5px;
}

.file-size {
  color: #888;
  font-size: 1.2rem;
}

.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.file-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

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

.file-preview-item .btn-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.file-preview-container {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

.file-preview-container .file-preview-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  height: auto;
  padding: 5px;
  background: #f9f9f9;
}

.file-preview-container .file-preview-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 3px;
}

.file-preview-placeholder {
  width: 70px;
  height: 70px;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.file-preview-placeholder .file-ext {
  font-size: 1.2rem;
  font-weight: bold;
  color: #666;
}

.file-preview-name {
  display: block;
  font-size: 1rem;
  color: #666;
  margin-top: 3px;
  text-align: center;
  word-break: break-all;
  max-width: 70px;
}

/* --------------------------------------------
   住所検索ボタン
   -------------------------------------------- */
.btn-zip {
  background: #3498db;
  color: #fff;
  border: 1px solid #3498db;
  padding: 10px 16px;
  font-size: 1.4rem;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 0 0 10px;
  line-height: 1.6;
  transition: background 0.2s;
  vertical-align: middle;
  position: relative;
  top: 0;
}

.btn-zip:hover {
  background: #2980b9;
}

/* --------------------------------------------
   送信ボタン
   -------------------------------------------- */
.submit-area {
  text-align: center;
  margin-top: 40px;
}

.btn-submit {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #fff;
  border: none;
  padding: 18px 60px;
  font-size: 1.8rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

/* --------------------------------------------
   エラー表示
   -------------------------------------------- */
.error-summary {
  background: #fdf2f2;
  border: 1px solid #e74c3c;
  border-radius: 4px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.error-summary-title {
  color: #e74c3c;
  font-weight: bold;
  margin: 0 0 10px;
}

.error-summary-list {
  margin: 0;
  padding-left: 20px;
  color: #c0392b;
}

.input-error {
  border-color: #e74c3c !important;
  background: #fdf2f2 !important;
}

.error-message {
  color: #e74c3c;
  font-size: 1.2rem;
  margin-top: 5px;
}

/* --------------------------------------------
   フッター
   -------------------------------------------- */
.footer {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

.footer-text {
  color: #888;
  font-size: 1.2rem;
  margin: 0;
}

/* --------------------------------------------
   レスポンシブ対応
   -------------------------------------------- */
@media screen and (max-width: 768px) {
  html {
    font-size: 56.25%; /* 9px基準 */
  }

  .l-wrapper {
    padding: 10px;
  }

  .l-main {
    padding: 15px;
  }

  .page-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.6rem;
    padding: 10px 15px;
  }

  .form-table,
  .form-table tbody,
  .form-table tr,
  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
  }

  .form-table th {
    background: #f0f0f0;
    border-bottom: none;
    padding: 10px 15px;
  }

  .form-table td {
    padding: 15px;
    border-top: none;
  }

  .input-half {
    width: 100%;
    min-width: auto;
  }

  .name-row .input-text {
    width: 100%;
    flex: 1;
  }

  .btn-submit {
    width: 100%;
    padding: 15px 20px;
  }

  .btn-zip {
    margin-left: 0;
    margin-top: 10px;
    width: auto;
  }

  .form-group {
    flex-wrap: wrap;
  }
}

/* --------------------------------------------
   確認画面用スタイル
   -------------------------------------------- */
.confirm-table {
  width: 100%;
  border-collapse: collapse;
}

.confirm-table th,
.confirm-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.confirm-table th {
  background: #f9f9f9;
  width: 200px;
  font-weight: bold;
}

.confirm-value {
  white-space: pre-wrap;
}

.confirm-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.confirm-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.btn-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.btn-back {
  background: #95a5a6;
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 1.6rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-back:hover {
  background: #7f8c8d;
}

/* --------------------------------------------
   完了画面用スタイル
   -------------------------------------------- */
.complete-message {
  text-align: center;
  padding: 40px 20px;
}

.complete-icon {
  font-size: 6rem;
  color: #27ae60;
  margin-bottom: 20px;
}

.complete-title {
  font-size: 2.4rem;
  color: #333;
  margin-bottom: 20px;
}

.complete-text {
  font-size: 1.4rem;
  color: #666;
  line-height: 1.8;
}

.btn-home {
  display: inline-block;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  padding: 15px 40px;
  font-size: 1.6rem;
  border-radius: 50px;
  margin-top: 30px;
  transition: background 0.2s;
}

.btn-home:hover {
  background: #2980b9;
}
