*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #e8edf2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========== Header ========== */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
  padding: 10px;
  width: 100%;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
}

.logo-icon {
  height: 42px;
  width: 42px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #292524;
}

/* ========== Contents ========== */
.contents {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 16px;
  width: 100%;
  flex-shrink: 0;
}

.container {
  background-color: #fafafa;
  border: 1px solid #9f9fa9;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  max-width: 480px;
  padding: 16px;
  width: 100%;
}

/* ========== Page Title ========== */
.page-title {
  width: 100%;
}

.page-title p {
  font-size: 24px;
  font-weight: 700;
  color: #292524;
  text-align: center;
  line-height: 1.2;
}

/* ========== Form Error Message ========== */
.form-error-message {
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: #a30037;
  background-color: #fff0f3;
  border: 1px solid #a30037;
  border-radius: 4px;
  padding: 8px 12px;
  line-height: 1.5;
}
.form-error-message:empty {
  display: none;
}

/* ========== Form ========== */
#signupForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* ========== Input Group ========== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.input-label {
  font-size: 14px;
  font-weight: 500;
  color: #292524;
}

.input-note {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.input-note.warning {
  color: #a30037;
}

.input-note.hint {
  color: #71717a;
}

.input-wrapper {
  background-color: #fafafa;
  border: 1px solid #90a1b9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  width: 100%;
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: #0084c9;
}

.input-wrapper.has-error {
  border-color: #a30037;
}

.input-wrapper input {
  flex: 1;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #292524;
  border: none;
  background: transparent;
  outline: none;
  min-width: 0;
  line-height: 1.5;
}

.input-wrapper input::placeholder {
  color: #a6a09b;
}

/* ========== Password Requirement Items ========== */
.req-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #a6a09b; /* 未充足: グレー */
}

.req-item.met {
  color: #016630; /* 充足: グリーン */
}

.req-icon {
  font-style: normal;
  flex-shrink: 0;
}

.error-text {
  font-size: 12px;
  font-weight: 500;
  color: #a30037;
  line-height: 1.4;
  display: none;
}

.error-text.show {
  display: block;
}

/* ========== Toggle Password Button ========== */
.toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.7;
}

.toggle-password:hover {
  opacity: 1;
}

/* ========== Terms Box ========== */
.terms-box {
  background-color: #E4E4E7;
  border-radius: 4px;
  padding: 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terms-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.terms-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 2.5px solid #0084c9;
  border-radius: 3px;
  background-color: #fafafa;
  position: relative;
  flex-shrink: 0;
}

.terms-box input[type="checkbox"]::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 11px;
  border: 2px solid rgba(0, 132, 201, 0.25);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.terms-box input[type="checkbox"]:checked {
  background-color: #0084c9;
}

.terms-box input[type="checkbox"]:checked::after {
  border-color: white;
}

.terms-box span {
  font-size: 14px;
  font-weight: 500;
  color: #292524;
  line-height: 1.5;
}

/* ========== Link Text ========== */
.link-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.link-text a {
  font-size: 14px;
  font-weight: 500;
  color: #0069a2;
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
}

/* ========== Submit Button ========== */
.btn-submit {
  background-color: #0084c9;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 8px;
  width: 100%;
  filter: drop-shadow(0px 1px 0px rgba(64, 64, 64, 0.4));
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-submit:active {
  filter: brightness(0.92) drop-shadow(0px 1px 0px rgba(64, 64, 64, 0.4));
}

.btn-submit.is-disabled {
  cursor: not-allowed;
  position: relative;
  pointer-events: none;
}

.btn-submit.is-disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.btn-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-label {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  color: #fafaf9;
  text-align: center;
  line-height: 1.2;
}

.btn-spacer {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ========== Info Section ========== */
.info-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-title {
  font-size: 14px;
  font-weight: 500;
  color: #292524;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-item-label {
  font-size: 13px;
  font-weight: 700;
  color: #292524;
}

.info-item-body {
  font-size: 13px;
  font-weight: 400;
  color: #292524;
  line-height: 1.6;
}

/* ========== Border Divider ========== */
.border-divider {
  width: 100%;
  height: 1px;
  background-color: #cad5e2;
  flex-shrink: 0;
}

/* ========== Terms Link Button ========== */
.terms-link-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0069a2;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  padding: 0;
  line-height: 1.5;
}

/* ========== Terms Modal ========== */
.terms-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  flex-direction: column;
  background: #fff;
}

.terms-modal.is-open {
  display: flex;
}

.terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid #cad5e2;
  flex-shrink: 0;
}

.terms-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #292524;
}

.terms-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
}

.terms-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-top: 1px solid #cad5e2;
  flex-shrink: 0;
}

.terms-modal-close {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #0069a2;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 24px;
}

/* ========== Footer ========== */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 73px;
  padding: 16px 10px;
  width: 100%;
  flex-shrink: 0;
}

.footer p {
  font-size: 12px;
  font-weight: 500;
  color: #a6a09b;
  text-align: center;
  line-height: 1.2;
}
