:root {
  --font-ui-ja: "BIZ UDGothic", "MS Gothic", monospace;
  --font-ui-en: Arial, "Helvetica Neue", sans-serif;
  --font-body: var(--font-ui-ja);
}

html:lang(en) {
  --font-body: var(--font-ui-en);
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-body);
}

body {
  font-weight: 400;
  background: linear-gradient(to bottom, #e9e9e9, #d9d9d9);
  height: 100vh;
  line-height: 1.6;
}

.signup-wrapper {
  max-width: 720px;
  margin: 4rem auto 1.5rem auto;
  padding: 2.5rem 2rem;
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
  position: relative; /* 右上の i ボタンの基準 */
}

/* 見出し */
.signup-wrapper h1 {
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 1.6rem;
  text-align: center;
}

/* 右上の i ボタンで開く、見出し下の案内 */
.signup-merits-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  list-style: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.signup-merits-toggle::-webkit-details-marker {
  display: none;
}
.signup-merits-toggle:hover {
  background-color: rgb(0 117 8 / 0.06);
}
.signup-merits[open] > .signup-merits-toggle {
  background-color: rgb(0 117 8 / 0.08);
}
.signup-merits-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(0 117 8 / 0.18);
}
.signup-merits-toggle img {
  display: block;
}
.signup-merits-body {
  width: fit-content;
  max-width: 100%;
  margin: -0.3rem auto 1.8rem;
}
.signup-merits-title {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #223429;
}
/* .signup-wrapper ul の小さい文字より詳細度を上げて上書きする */
.signup-wrapper .signup-merits-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #3d4a42;
  font-size: 0.85rem;
  line-height: 1.6;
}
.signup-merits-list li {
  position: relative;
  padding-left: 1.4em;
}
.signup-merits-list li + li {
  margin-top: 0.3em;
}
.signup-merits-list li::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.35em;
  width: 0.3em;
  height: 0.6em;
  border: solid #007508;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ラベル */
.signup-wrapper label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  font-size: 0.93rem;
}

/* テキスト入力・パスワード入力 */
.signup-wrapper input[type="text"],
.signup-wrapper input[type="email"],
.signup-wrapper input[type="password"] {
  width: 90%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.3em;
  border: 1px solid #c3c3c3;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  line-height: 1.4;
}
.signup-wrapper input:focus {
  outline: none;
  border-color: #007508;
  box-shadow: 0 0 0 2px rgb(0 117 8 / 0.15);
}

/* エラーメッセージ */
.errorlist {
  margin: 0 0 1rem 0;
  padding: 0.8rem 1rem;
  list-style: none;
  background: #ffecec;
  border: 1px solid #f5c2c2;
  color: #cc0000;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* 送信ボタン */
.signup-wrapper .submit-btn {
  margin: 0.5rem auto 0 auto;
  padding: 0.4rem 2rem 0.4rem 1.4rem;
  font-size: 0.8rem;
  border: none;
  border-bottom: solid 2px rgb(0, 68, 5);
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(to bottom, #00aa0b, #00980a);
  color: #fff;
  transition: background 0.2s ease, transform 0.1s ease;
  display: block;
  font-weight: bold;
}
.signup-wrapper button:hover {
  background-image: linear-gradient(to bottom, #00980a, #006e07);
  background-color: #00aa0b;
}
.signup-wrapper button:active {
  transform: translateY(2px);
  -webkit-transform: translateY(2px);
  border-bottom: none;
}

.signup-wrapper .helptext {
  color: #555;
  font-size: 0.75rem;
  line-height: 1.45;
}
.signup-wrapper ul {
  margin: 0;
  color: #555;
  font-size: 0.65rem;
  line-height: 1.45;
  padding-inline-start: 1rem;
}

.with-gap {
  margin-top: 20px; /* メール入力欄とパスワードの間 */
}
.form-group {
  margin-bottom: 13px;
}
.login {
  color: #007508;
  text-decoration: none;
  font-size: 0.8rem;
}
.login:hover {
  text-decoration: underline;
}
#back-button-container {
  text-align: center;
}
#backButton {
  padding: 0.4rem 1.4rem;
  font-size: 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  background-color: transparent;
  color: rgb(167, 0, 0);
  display: inline-block;
}
#backButton:hover {
  text-decoration: underline;
}

/* ---------- レスポンシブ対応（スマホ） ---------- */
@media (max-width: 480px) {
  .signup-wrapper {
    margin: 2.5rem 1rem 1.5rem 1rem;
    padding: 2rem 1.2rem;
  }
  .signup-wrapper h1 {
    font-size: 1.2rem;
    padding-inline: 0.8rem; /* 右上の i ボタンと重ならないよう両側を空ける（中央揃えを保つため左右とも） */
  }
  .signup-merits-toggle {
    top: 6px;
    right: 6px;
  }
  .signup-merits-body {
    margin-top: -0.6rem;
  }
  .signup-merits-title {
    margin-bottom: 0.35rem;
  }
  .signup-merits-title,
  .signup-wrapper .signup-merits-list {
    font-size: 0.8rem;
  }
}
