/*
 * 「スポンサーもはじめる」
 * デスクトップ: consultation-box 内に absolute 配置。
 * タブレット以下: コンシェルジュボタンと横並び・高さ揃え。
 */

.consultation-box.has-start-sponsor-cta {
  position: relative;
}

/*
 * end_user: 女性を「スポンサーもはじめる」と「コンシェルジュに相談」の中点へ。
 */
.consultation-box.has-start-sponsor-cta .left-side {
  position: static;
  overflow: visible;
}

.consultation-box.has-start-sponsor-cta img.woman1 {
  position: absolute;
  bottom: 20px;
  /* 幅により女性画像が右側の文言・ボタンに重なるため、必ず背面に置く */
  z-index: 0;
  width: 200px;
  /* CTA中心(20+185=205px) と 右半分中央(75%) の中点。
     左手（画面右）を挙げているので体軸が左に見える → やや右寄せ */
  left: calc((205px + 75%) / 2 + 36px);
  transform: translateX(-50%);
}

/* 文言・ボタンは女性画像より前面に出す */
.consultation-box.has-start-sponsor-cta .right-side {
  position: relative;
  z-index: 1;
}

.start-sponsor-cta {
  /* スポンサー登録再開まで一時非表示 */
  display: none !important;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  margin: 0;
  padding: 0;
  width: auto;
  pointer-events: auto;
}

.start-sponsor-cta__btn {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 370px;
  height: 120px;
  padding: 16px 20px;
  font-size: 28px;
  font-weight: bold;
  line-height: 1.25;
  color: #fff;
  background: #28C0D4;
  border: 2px solid #fff;
  border-radius: 20px;
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-align: center;
  white-space: normal;
  transition: background-color 0.3s, transform 0.3s;
}

/* デスクトップは1行。中間幅だけ改行 */
.start-sponsor-cta__break {
  display: none;
}

.start-sponsor-cta__btn:hover {
  background: #1aa8bb;
  transform: scale(1.01);
}

.start-sponsor-modal[hidden] {
  display: none !important;
}

.start-sponsor-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-sponsor-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.start-sponsor-modal__dialog {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 52px 48px 44px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.start-sponsor-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #5a6a70;
}

.start-sponsor-modal__close:hover {
  color: #1aa8bb;
}

.start-sponsor-modal__title {
  margin: 0 36px 28px 0;
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(40, 192, 212, 0.35);
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: #1f3a42;
}

.start-sponsor-modal__body {
  font-size: 15px;
  line-height: 1.85;
  color: #2c3e45;
}

.start-sponsor-modal__body p {
  margin: 0 0 22px;
}

.start-sponsor-modal__body p:last-child {
  margin-bottom: 0;
}

.start-sponsor-modal__body strong {
  font-weight: 700;
  color: #147a8a;
}

.start-sponsor-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
}

.start-sponsor-modal__confirm {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  background: #28C0D4;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 192, 212, 0.35);
  transition: background-color 0.2s, transform 0.2s;
}

.start-sponsor-modal__confirm:hover {
  background: #1aa8bb;
  transform: translateY(-1px);
}

.start-sponsor-modal__confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.start-sponsor-modal__cancel {
  border: none;
  background: transparent;
  padding: 4px 8px;
  color: #5a6a70;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.start-sponsor-modal__cancel:hover {
  color: #1aa8bb;
}

/* ---------- 1100px〜1001px: CTA コンパクト（女性あり） ---------- */
@media screen and (max-width: 1100px) {
  .consultation-box.has-start-sponsor-cta {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .start-sponsor-cta {
    left: 12px;
  }

  .start-sponsor-cta__break {
    display: block;
    width: 100%;
  }

  .start-sponsor-cta__btn {
    width: 168px;
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    font-size: 18px;
    line-height: 1.3;
    border-radius: 14px;
    flex-direction: column;
  }

  .consultation-box.has-start-sponsor-cta img.woman1 {
    width: 160px;
    left: calc((96px + 72%) / 2 + 24px);
  }

  .main-box {
    min-width: 0;
    max-width: 100%;
  }
}

/* ---------- 1000px 以下: 女性なし・両ボタン横並び＆高さ揃え ---------- */
@media screen and (max-width: 1000px) {
  .consultation-box.has-start-sponsor-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    height: auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  .consultation-box.has-start-sponsor-cta .left-side {
    display: none;
  }

  .consultation-box.has-start-sponsor-cta img.woman1,
  .consultation-box.has-start-sponsor-cta img.woman2 {
    display: none;
  }

  /* right-side を解体して、文言→両ボタンを同じ flex 行に載せる */
  .consultation-box.has-start-sponsor-cta .right-side {
    display: contents;
  }

  .consultation-box.has-start-sponsor-cta .concierge-help {
    flex: 1 1 100%;
    order: 1;
    margin: 0 0 4px;
    text-align: center;
    font-size: 18px;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .start-sponsor-cta {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    max-width: 280px;
    display: flex;
    margin: 0;
  }

  .start-sponsor-cta__btn {
    width: 100%;
    height: 100%;
    min-height: 72px;
    padding: 12px 14px;
    font-size: 18px;
    line-height: 1.3;
    border-radius: 14px;
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.25);
  }

  .consultation-box.has-start-sponsor-cta .button3 {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
    max-width: 280px;
    width: auto;
    height: auto;
    min-height: 72px;
    margin: 0;
    padding: 12px 14px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .consultation-box.has-start-sponsor-cta .button3 > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
  }

  .consultation-box.has-start-sponsor-cta .button3 p {
    font-size: 18px;
    line-height: 1.3;
    padding: 0;
    margin: 0;
  }

  .consultation-box.has-start-sponsor-cta .button8 {
    order: 4;
    flex: 1 1 100%;
    width: min(280px, 100%);
    margin: 0 auto;
    max-width: 280px;
  }

  /* 中間幅: 両ボタンとも2行（コンパクト） */
  .start-sponsor-cta__break {
    display: block;
    width: 100%;
  }

  .start-sponsor-cta__btn {
    flex-direction: column;
  }

  .side-box {
    display: none;
  }
}

/*
 * 768px 以下: コンシェルジュと同様に1行表示 + 高さ揃え
 * （projectlist.css が .button3 p br { display:none } にする帯域）
 */
@media screen and (max-width: 768px) {
  .consultation-box.consultation-box--supplier.has-start-sponsor-cta {
    display: flex !important;
    position: relative;
    height: auto;
    max-height: none;
    min-height: 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 4px;
    margin: 0;
  }

  .consultation-box.consultation-box--supplier.has-start-sponsor-cta .left-side,
  .consultation-box.consultation-box--supplier.has-start-sponsor-cta .right-side {
    display: none;
  }

  .consultation-box.has-start-sponsor-cta {
    height: auto;
    max-height: none;
    min-width: 0;
    padding: 8px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
  }

  .consultation-box.has-start-sponsor-cta .left-side {
    display: none;
  }

  .consultation-box.has-start-sponsor-cta .concierge-help {
    display: none; /* projectlist でも非表示だが明示 */
  }

  .start-sponsor-cta {
    position: static;
    transform: none;
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin: 0;
    display: flex;
  }

  /* コンシェルジュの br 非表示に合わせ、スポンサーも1行 */
  .start-sponsor-cta__break {
    display: none;
  }

  .start-sponsor-cta__btn {
    width: 100%;
    height: 100%;
    min-height: 60px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 12px;
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .consultation-box.has-start-sponsor-cta .button3 {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    width: auto; /* projectlist の width:100% で縦積みになるのを防ぐ */
    min-height: 60px;
    height: auto;
    padding: 10px;
  }

  .consultation-box.has-start-sponsor-cta .button3 p {
    font-size: 15px;
    line-height: 1.2;
    word-spacing: normal;
  }

  .consultation-box.has-start-sponsor-cta .button8 {
    display: none;
  }

  .start-sponsor-modal__dialog {
    padding: 40px 28px 32px;
    width: min(500px, calc(100vw - 24px));
  }

  .start-sponsor-modal__title {
    font-size: 20px;
    margin-right: 32px;
  }
}
