/* ============================= */
/* ページ全体のレイアウト */
/* ============================= */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: sans-serif;
  background-color: white;
}

main {
  flex: 1; /* mainが残りスペースを埋める */
  padding: 20px;
  width: 90%;
  max-width: 800px;
  margin: 40px auto;
}

footer {
  height: 110px;
  text-align: center;
  line-height: 1.5;
  background-color: #dddddd;
  padding: 20px 0 10px;
}

/* ============================= */
/* ヘッダーは触らないので対象外 */
/* ============================= */

/* ============================= */
/* フォーム全般（header内は除外）*/
/* ============================= */
body > :not(header) form input,
body > :not(header) form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  background-color: white;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
}

/* ボタン全般 */
body > :not(header) form input[type="reset"],
body > :not(header) form input[type="submit"],
body > :not(header) form input[type="button"] {
  border: none;
  border-radius: 4px;
  font-size: 16px;
  height: 40px;
  padding: 0 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ボタン色 */
body > :not(header) form input[type="reset"] {
  color: #4770ad;
  background-color: #e4e4e4;
}

body > :not(header) form input[type="submit"],
body > :not(header) form input[type="button"] {
  color: white;
  background-color: #4770ad;
}

body > :not(header) form input.backbtn {
  color: #4770ad;
  background-color: #e4e4e4;
}
/* ボタンホバー */
body > :not(header) form input[type="submit"]:hover,
body > :not(header) form input[type="reset"]:hover,
body > :not(header) form input[type="button"]:hover {
  opacity: 0.7;
}

/* 必須マーク */
body > :not(header) form span.required {
  color: red;
  margin-left: 5px;
  font-size: 12px;
}

/* テーブルスタイル */
body > :not(header) form table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

body > :not(header) form th {
  text-align: left;
  padding: 10px;
  vertical-align: top;
  width: 200px;
}

body > :not(header) form td {
  padding: 10px;
}

/* ボタンの配置例：左右 */
body > :not(header) form p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  body > :not(header) form th,
  body > :not(header) form td {
    display: block;
    width: 100%;
    padding: 5px 0;
  }
  body > :not(header) form th {
    margin-top: 10px;
  }

  body > :not(header) form p {
    flex-direction: column;
  }
}

/* h2の装飾 */
h2 {
  color: #4770ad;
  text-align: center;
}
.msg {
  text-align: center;
}

/* ボタンを中央揃えにする親 */
.error-btn-wrapper {
  display: flex !important; /* flex は残す */
  justify-content: center !important; /* 中央揃え */
  gap: 0 !important; /* 余白を消す */
  margin-top: 20px !important;
}

/* ボタン自体のスタイル */
.error-backbtn {
  display: inline-block !important;
  background-color: #e4e4e4 !important;
  color: #4770ad !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 16px !important;
  height: 40px !important;
  padding: 0 20px !important;
  cursor: pointer !important;
  box-sizing: border-box !important;

  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}
.error-backbtn:hover {
  opacity: 0.7 !important;
}

.formtop {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

@media (min-width: 600px) {
  .formtop {
    list-style: none;
    margin: 0 0 20px;
    padding: 0 90px;
  }
}
