body {
  background-color: #f4f7f6;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  color: #333;
  margin: 0;
}

header {
  position: fixed;
  z-index: 999;
  padding: 2rem;
  top: 0;
  left: 0;
}

.form-container {
  max-width: 720px;
  margin: 2rem auto;
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

h1 {
  text-align: center;
  color: #2c3e50;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 20px;
  margin-bottom: 30px;
}

h2, .confirm-group h3 {
  color: #34495e;
  border-left: 4px solid #3498db;
  padding-left: 10px;
  margin-top: 40px;
  margin-bottom: 20px;
  font-size: 1.25em; /* h2相当のサイズに調整 */
}

.confirm-group h3 {
  margin-top: 20px;
}

.form-group {
  margin-bottom: 20px;
}

/* 横並びレイアウト用のスタイル */
.form-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.form-col {
  flex: 1;
}
/* --- */

label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  transition: border-color 0.3s, background-color 0.3s; /* アニメーション効果 */
}

input:focus, select:focus, textarea:focus {
  border-color: #3498db;
  outline: none;
}

textarea {
  resize: vertical;
}

/* ★★★ エラー項目のハイライトスタイル ★★★ */
.error-field {
  border-color: #e74c3c !important;
  background-color: #fbecec !important;
}
.radio-group-inline.error-field {
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #e74c3c;
  background-color: #fbecec;
}
/* ★★★★★★★★★★★★★★★★★★★★★ */


.required {
  background-color: #e74c3c;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 8px;
  display: inline-block; /* JSでの表示切替のため */
}

.optional {
  background-color: #7f8c8d;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 8px;
  display: inline-block; /* JSでの表示切替のため */
}

.note {
  font-size: 14px;
  color: #7f8c8d;
  margin-top: 5px;
}

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

.validation-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 4px;
  min-height: 1em;
}

/* ラジオボタンを横並びにするためのスタイル */
.radio-group-inline {
  display: flex;
  align-items: center;
  padding-top: 5px; /* ラベルとの余白調整 */
  transition: border-color 0.3s, background-color 0.3s;
}
.radio-group-inline input[type="radio"] {
  width: auto;
  margin-right: 5px;
}
.radio-group-inline label {
  margin-right: 20px;
  margin-bottom: 0;
  font-weight: normal;
}

.form-buttons {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.submit-btn, .back-btn, .reset-btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 0;
}

.submit-btn {
  background-color: #3498db;
  color: #fff;
}

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

.reset-btn {
  background-color: #bdc3c7;
  color: #fff;
}
.reset-btn:hover {
  background-color: #95a5a6;
}

.back-btn {
  background-color: #95a5a6;
  color: #fff;
}
.back-btn:hover {
  background-color: #7f8c8d;
}

.confirm-group {
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.confirm-group dl {
  margin: 0;
}

.confirm-group dt {
  font-weight: bold;
  color: #555;
  margin-top: 15px;
}

.confirm-group dd {
  margin-left: 0;
  padding: 8px;
  background-color: #f9f9f9;
  border-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.confirm-buttons {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.confirm-buttons form {
  flex: 1;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none; /* 初期状態は非表示 */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  border: none;
  padding: 0;
}

.modal-close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}
.modal-close:hover {
  color: #333;
}

.modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.modal-body li {
  background-color: #fbecec;
  color: #c0392b;
  border-left: 3px solid #c0392b;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 3px;
}

.modal-footer {
  text-align: right;
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  background-color: #f0f0f0;
}

.modal-btn-danger {
  background-color: #e74c3c;
  color: white;
  border-color: #e74c3c;
}

@media (max-width: 767px) {
  header {
    padding: 0.5rem;
  }
  header img {
    max-width: 72px;
  }
  .form-container {
    margin: 3rem auto;
    padding: 1rem;
  }
  .form-buttons {
    flex-wrap: wrap;
  }
}