.crefus-form-page-header {
  padding: 48px 0 24px;
  background: #fff;
}

.crefus-form-page-header__title {
  margin: 0;
  color: #333;
  font-size: 3rem;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
}

.crefus-form-page-header__lead {
  margin-top: 28px;
  text-align: center;
}

.crefus-form-page-header__lead p {
  margin: 0;
  color: #333;
  font-size: 1.8rem;
  line-height: 1.5;
  font-weight: 700;
}

.crefus-form {
  padding: 72px 0 96px;
  background: #fff;
}

.crefus-form__panel {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.crefus-form__panel--finish {
  text-align: center;
  max-width: 760px;
  padding: 48px 24px;
  border: 1px solid #e3e3e3;
}

.crefus-form__heading {
  margin: 0 0 28px;
  color: #333;
  font-size: 3rem;
  line-height: 1.4;
  font-weight: 700;
}

.crefus-form__lead {
  margin: 0 0 10px;
  color: #555;
  font-size: 1.6rem;
  line-height: 2;
}

.crefus-form__intro {
  margin-bottom: 48px;
}

.crefus-form__intro-copy {
  color: #666;
  font-size: 1.5rem;
  line-height: 2;
}

.crefus-form__intro-copy p {
  margin: 0 0 22px;
}

.crefus-form__intro-copy ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.crefus-form__intro-copy li {
  margin: 0 0 8px;
}

.crefus-form__intro-copy a {
  color: #59b93f;
  text-decoration: underline;
}

.crefus-form__intro-copy span {
  color: #d93a2f;
}

.crefus-form__intro-action {
  margin: 40px 0 0;
  text-align: center;
}

.crefus-form__intro-action .crefus-form__button--secondary,
.crefus-form__intro-action .crefus-form__button--secondary:visited {
  border-color: #3db52d;
  color: #3db52d;
}

.crefus-form__intro-action .crefus-form__button--secondary:hover,
.crefus-form__intro-action .crefus-form__button--secondary:focus {
  border-color: #3db52d;
  background: #3db52d;
  color: #fff;
}

.crefus-form__notes {
  margin: 20px 0 44px;
  padding-left: 1.5em;
  color: #666;
  font-size: 1.4rem;
  line-height: 2;
}

.crefus-form__alert {
  margin-bottom: 24px;
  padding: 16px 18px;
  border: 1px solid #efc7c0;
  border-radius: 0;
  background: #fff4f1;
  color: #b5442d;
  font-size: 1.4rem;
}

.crefus-form__fields,
.crefus-form__confirm {
  margin: 0;
}

.crefus-form__field,
.crefus-form__confirm-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  padding: 46px 0;
  border-top: 1px dotted #d8d8d8;
}

.crefus-form__field:first-child,
.crefus-form__confirm-row:first-child {
  border-top: 0;
}

.crefus-form__field dt,
.crefus-form__field dd,
.crefus-form__confirm-row dt,
.crefus-form__confirm-row dd {
  margin: 0;
}

.crefus-form__field dt,
.crefus-form__confirm-row dt {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.crefus-form__field dt > label,
.crefus-form__confirm-row dt {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #333;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.6;
}

.crefus-form__field--checkbox-group dt {
  align-items: flex-start;
  padding-top: 4px;
}

.crefus-form__field--checkbox-group dt > label {
  align-items: flex-start;
}

.crefus-form__required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 46px;
  padding: 4px 10px;
  border-radius: 0;
  background: #df1d1d;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.crefus-form__field[hidden],
.crefus-form__inline-dependent[hidden] {
  display: none !important;
}

.crefus-form__label-note {
  color: #888;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.5;
}

.crefus-form__field input:not([type="checkbox"]),
.crefus-form__field select,
.crefus-form__field textarea {
  width: 100%;
  max-width: 480px;
  padding: 9px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  background: #fff;
  color: #333;
  font-size: 1.4rem;
  line-height: 1.45;
  box-sizing: border-box;
}

.crefus-form__field textarea {
  max-width: 640px;
  min-height: 132px;
  resize: vertical;
}

.crefus-form__field [hidden] {
  display: none !important;
}

.crefus-form__policy {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
  font-size: 1.5rem;
  line-height: 1.7;
}

.crefus-form__radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  padding-top: 4px;
}

.crefus-form__radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #444;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.7;
  white-space: nowrap;
}

.crefus-form__radio input {
  margin: 0;
}

.crefus-form__checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 26px;
  max-width: 560px;
}

.crefus-form__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #444;
  font-size: 1.5rem;
  line-height: 1.7;
}

.crefus-form__checkbox input {
  margin: 0;
}

.crefus-form__inline-dependent {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  max-width: 680px;
  margin-top: 10px;
}

.crefus-form__inline-dependent-label {
  color: #333;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.6;
}

.crefus-form__inline-dependent-control input {
  max-width: none;
}

.crefus-form__inline-dependent-control textarea {
  max-width: none;
}

.crefus-form__description {
  margin: 0 0 8px;
  color: #666;
  font-size: 1.4rem;
  line-height: 1.7;
}

.crefus-form__note {
  margin: 8px 0 0;
  color: #444;
  font-size: 1.3rem;
  line-height: 1.6;
}

.crefus-form__note--alert {
  color: #d93a2f;
}

.crefus-form__policy a {
  color: #59b93f;
  text-decoration: underline;
}

.crefus-form__policy-link {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.7;
}

.crefus-form__policy-link a {
  color: #59b93f;
  text-decoration: underline;
}

.crefus-form__error {
  margin: 8px 0 0;
  color: #c84028;
  font-size: 1.3rem;
  line-height: 1.6;
}

.crefus-form__button-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 56px;
  flex-wrap: wrap;
}

.crefus-form__button,
.crefus-form__button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 312px;
  padding: 18px 28px;
  border: 3px solid #2cb34a;
  border-radius: 0;
  background: #fff;
  color: #2cb34a;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.crefus-form__button::before {
  content: "›";
  margin-right: 10px;
  font-size: 1.8rem;
  line-height: 1;
}

.crefus-form__button--secondary,
.crefus-form__button--secondary:visited {
  border-color: #bdbdbd;
  color: #555;
}

.crefus-form__button:hover,
.crefus-form__button:focus {
  background: #2cb34a;
  color: #fff;
}

.crefus-form__confirm-row dd {
  color: #555;
  font-size: 1.5rem;
  line-height: 1.9;
}

.crefus-form__confirm-policy,
.crefus-form__serial {
  margin-top: 24px;
  color: #333;
  font-size: 1.5rem;
  font-weight: 700;
}

.crefus-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.crefus-form__inline-form {
  margin: 0;
}

.crefus-form__field dd > .crefus-form__policy {
  margin-top: 2px;
}

.crefus-form__field--policy dt {
  display: flex;
  align-items: center;
}

.crefus-form__field--policy dd {
  display: block;
}

.crefus-form__field--classroom-picker dd {
  max-width: 760px;
}

.crefus-form__classroom-picker {
  border: 5px solid #7b7b7b;
  padding: 18px 22px 26px;
}

.crefus-form__classroom-picker-summary {
  display: flex;
  justify-content: center;
}

.crefus-form__classroom-picker-button {
  min-width: 240px;
  padding: 14px 24px;
  border: 0;
  background: #3db52d;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
}

.crefus-form__classroom-picker-button::after {
  content: "〉";
  margin-left: 16px;
}

.crefus-form__classroom-picker-selection {
  display: none;
  margin-top: 16px;
  justify-content: center;
}

.crefus-form__classroom-picker-selection.is-visible {
  display: flex;
}

.crefus-form__classroom-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.crefus-form__classroom-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
}

.crefus-form__classroom-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 28px 28px 32px;
  overflow: auto;
  background: #fff;
}

.crefus-form__classroom-modal-title {
  margin: 0 0 22px;
  text-align: center;
  color: #333;
  font-size: 2rem;
  font-weight: 500;
}

.crefus-form__classroom-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #ddd;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
}

.crefus-form__classroom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.crefus-form__classroom-prefecture,
.crefus-form__classroom-card,
.crefus-form__classroom-other,
.crefus-form__classroom-back {
  border: 0;
  background: linear-gradient(180deg, #d9f8d0 0%, #d4f6ca 100%);
  color: #38b226;
  cursor: pointer;
}

.crefus-form__classroom-prefecture {
  min-height: 200px;
  padding: 24px;
  font-size: 2.4rem;
  font-weight: 500;
}

.crefus-form__classroom-card {
  width: 100%;
  padding: 22px 20px 20px;
  text-align: center;
}

.crefus-form__classroom-card.is-selected {
  max-width: 420px;
  margin: 0 auto;
}

.crefus-form__classroom-card.is-other {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.crefus-form__classroom-card-title {
  margin: 0 0 12px;
  color: #38b226;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
}

.crefus-form__classroom-card-meta {
  margin: 8px 0 0;
  color: #38b226;
  font-size: 1.5rem;
  line-height: 1.5;
}

.crefus-form__classroom-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.crefus-form__classroom-other,
.crefus-form__classroom-back {
  min-height: 100px;
  padding: 16px 20px;
  font-size: 1.6rem;
}

.crefus-form__classroom-other {
  color: #222;
  background: #ddd;
}

.crefus-form__classroom-back {
  color: #222;
  background: #ddd;
}

.crefus-form-modal-open {
  overflow: hidden;
}

.crefus-form__compound {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.crefus-form__compound--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px 20px;
  max-width: 640px;
}

.crefus-form__compound-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.crefus-form__compound-row--inline {
  grid-template-columns: auto minmax(180px, 1fr);
  flex: 1 1 280px;
  min-width: 0;
}

.crefus-form__compound-row--nolabel {
  grid-template-columns: minmax(0, 640px);
}

.crefus-form__compound-label {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: #333;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.6;
}

.crefus-form__compound-row .crefus-form__error {
  grid-column: 2;
}

.crefus-form__compound-row--inline input,
.crefus-form__compound-row--inline select,
.crefus-form__compound-row--nolabel input:not([type="checkbox"]),
.crefus-form__compound-row--nolabel select,
.crefus-form__compound-row--nolabel textarea {
  max-width: none;
}

/* .header 固定高: 87px (>1200px) / 56px (≤1200px) に合わせてヘッダー直下に余白 */
.crefus-form__required-counter {
  box-sizing: border-box;
  position: fixed;
  top: calc(87px + 12px + env(safe-area-inset-top, 0px));
  right: 16px;
  bottom: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(152px, calc(100vw - 32px));
  height: min(152px, calc(100vw - 32px));
  aspect-ratio: 1;
  padding: 10px;
  border: 4px solid #e9549b;
  border-radius: 14px;
  background: #fff;
  text-align: center;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
}

.crefus-form__required-counter-label {
  display: block;
  margin: 0 0 4px;
  color: #e9549b;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.crefus-form__required-counter-value {
  margin: 0;
  color: #e9549b;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
}

.crefus-form__required-counter-remaining {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.crefus-form__required-counter-total {
  font-size: 1.5rem;
  font-weight: 600;
}

.crefus-form__required-counter-total span {
  font-weight: 600;
}

@media screen and (max-width: 1200px) {
  .crefus-form__required-counter {
    top: calc(56px + 12px + env(safe-area-inset-top, 0px));
  }
}

@media screen and (max-width: 767px) {
  .crefus-form-page-header {
    padding: 28px 0 16px;
  }

  .crefus-form-page-header__title {
    font-size: 3rem;
  }

  .crefus-form {
    padding: 40px 0 64px;
  }

  .crefus-form__panel {
    padding: 0 16px;
  }

  .crefus-form__heading {
    font-size: 2.3rem;
  }

  .crefus-form__field,
  .crefus-form__confirm-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 28px 0;
  }

  .crefus-form__field dt,
  .crefus-form__confirm-row dt {
    justify-content: flex-start;
  }

  .crefus-form__button,
  .crefus-form__button:visited {
    width: 100%;
    min-width: 0;
    font-size: 1.6rem;
  }

  .crefus-form__radio-group {
    gap: 14px 20px;
  }

  .crefus-form__checkbox-group {
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: none;
  }

  .crefus-form__compound-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .crefus-form__compound--inline {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  /* 横並び用の flex: 1 1 280px が縦積みで flex-grow し、行間が異常に空くのを防ぐ */
  .crefus-form__compound-row--inline {
    grid-template-columns: 1fr;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .crefus-form__inline-dependent {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .crefus-form__compound-label {
    min-height: 0;
  }

  .crefus-form__compound-row .crefus-form__error {
    grid-column: auto;
  }

  .crefus-form__required-counter {
    top: calc(56px + 12px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: min(136px, calc(100vw - 24px));
    height: min(136px, calc(100vw - 24px));
  }

  .crefus-form__required-counter-label {
    font-size: 1.1rem;
  }

  .crefus-form__required-counter-remaining {
    font-size: 2.4rem;
  }
}
