/* カード */
.sim__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 910px;
  margin: 32px auto 0;
  padding: 32px 24px;
  border-radius: 60px;
  background: #fcf9ef;
  align-items: center;
  box-shadow: inset 0 10px 0 rgba(0, 0, 0, 0.1), 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* フォーム */
.sim-form__field {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  align-items: flex-start;
  text-align: center;
}
.sim-form__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  color: var(--color-dark);
  margin: 30px 0 10px;
}
.sim-form__label::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* 入力 */
.sim-input,
.sim-select {
  width: min(100%, 520px);
  height: 65px;
  border-radius: 100px;
  border: none;
  outline: none;
  padding: 0 22px;
  background: #fff;
  color: var(--color-text);
  font-size: 22px;
  line-height: 65px;
  box-shadow: inset 0 0 0 4px var(--color-faq);
  transition: box-shadow 0.2s ease, transform 0.06s ease;
}
.sim-input:focus,
.sim-select:focus {
  box-shadow: inset 0 0 0 4px var(--color-faq), 0 0 0 2px var(--color-dark);
}

/* ▼アイコン */
.sim-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="%234d322c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 54px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* 右端の丸アイコン */
  background-image: url(../img/simulator/select-button.svg);
  background-repeat: no-repeat;
  background-position: right 0px center; /* 丸の位置 */
}

/* ラジオ */
.sim-radio {
  display: flex;
  font-size: 18px;
  gap: 36px;
  flex-wrap: wrap;
  justify-content: center;
  width: fit-content;
  margin-inline: auto;
}
.sim-radio label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto; /* ← これで横に広がらない */
  margin: 0;
}
.sim-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
/* カスタム丸 */
.sim-radio__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
/* 丸アイコン本体 */
.sim-radio__item::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--color-faq); /* 外枠 */
  background: #fff;
  flex: 0 0 18px;
}
/* 選択時の中点 */
.sim-radio input:checked + .sim-radio__item::before {
  box-shadow: inset 0 0 0 6px var(--color-accent); /* 中を塗って見せる */
}

/* フォーカス可視化 */
.sim-radio input:focus + .sim-radio__item {
  outline: 2px solid var(--color-dark);
  outline-offset: 2px;
}

/* エラー */
.is-error .sim-input,
.is-error .sim-select {
  box-shadow: inset 0 0 0 4px var(--color-error);
}
.sim-form__error {
  color: var(--color-error);
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-form__error .sim-error__icon {
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  display: inline-block;
}
/* .sim-form__error::before {
    content: "⚠️";
  } */
/* 初期はkVAを隠す */
#field-kva {
  display: none;
}

/* Ampereが選ばれている時：Ampereを表示、kVAを隠す */
.sim-form:has(input[name="mode"][value="ampere"]:checked) #field-ampere {
  display: block;
}
.sim-form:has(input[name="mode"][value="ampere"]:checked) #field-kva {
  display: none;
}

/* kVAが選ばれている時：kVAを表示、Ampereを隠す */
.sim-form:has(input[name="mode"][value="kva"]:checked) #field-kva {
  display: block;
}
.sim-form:has(input[name="mode"][value="kva"]:checked) #field-ampere {
  display: none;
}

/* ボタン */
.sim__submit {
  display: flex;
  margin-top: 50px;
  margin-bottom: 50px;
  justify-content: center;
}
.sim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 304px;
  height: 65px;
  padding: 0 28px;
  border: none;
  border-radius: 9999px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: var(--color-primary);
  box-shadow: inset 0 0 0 4px #fff, 0 12px 18px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sim-btn:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}
.sim-btn:focus {
  outline: 2px solid var(--color-dark);
  outline-offset: 2px;
}

/* 免責事項 */
/* 免責事項 見出し */
.sim__disclaimer {
  margin: 0px auto 40px;
  max-width: 910px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
}
.sim__disclaimer-title {
  display: block;
  width: 100%;
  background: #f5eccf;
  color: #4d322c;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 0 0 10px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
/* 本文だけに内側余白を付与 */
.sim__disclaimer-body {
  padding: 10px 18px 20px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.7;
}
.sim__disclaimer-body p {
  margin: 0;
}
/* ==== Result (送信後) ==== */
.sim-result[hidden] {
  display: none !important;
}

.sim-result {
  margin: 32px auto 0;
  max-width: 910px;
  text-align: center;
}

.sim-result__arrow {
  display: block;
  fill: var(--color-primary);
  width: 70px;
  height: 42px;
  margin: 8px auto 10px;
}

.sim-result__stage {
  position: relative;
  padding: 28px 16px;
  margin-bottom: 30px;
}

.sim-result__char {
  position: absolute;
  bottom: -8px;
  width: 193px;
  height: auto;
  pointer-events: none;
  user-select: none;
  transform-origin: bottom center;
  z-index: 2;
}
.sim-result__char--left {
  left: -120px;
}
.sim-result__char--right {
  right: -120px;
}

/* 結果ボディ（点線で上下を挟む） */
.sim-result__body {
  position: relative;
  margin: 0 auto;
  max-width: 640px;
  padding: 18px 16px 16px;
  background-color: #fff;
}
.sim-result__body::before,
.sim-result__body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dotted var(--color-primary); /* 合意：色は--color-primary、太さ2px */
}
.sim-result__body::before {
  top: 0;
}
.sim-result__body::after {
  bottom: 0;
}
/* 吹き出し */
.sim-result__badge {
  width: min(100%, 280px);
  position: relative;
  z-index: 3;
  margin: -40px auto 0;
  transform: translateY(60px);
  display: none;
}
.sim-result__badge img {
  display: block;
  width: 100%;
  height: auto;
}
.sim--pet .sim-result__badge {
  display: block;
}
/* タイポ */
.sim-result__price {
  margin: 12px 0 6px;
  line-height: 1;
  color: var(--color-dark);
}
.sim-result__amount {
  font-size: 61px;
  letter-spacing: 0.02em;
  font-family: "Monomaniac One";
  color: var(--color-primary);
}
.sim-result__yen {
  font-size: 32px;
  font-weight: 700;
  margin-left: 6px;
}

.sim-result__meta {
  margin: 8px 0 6px;
  font-size: 22px;
  color: var(--color-dark);
  font-weight: 700;
}

/* ちょいアニメ（1回だけ） */
@keyframes bounceOnce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}
.sim-result__arrow.is-anim {
  animation: bounceOnce 360ms ease-out;
}
.sim-result__char.is-anim {
  animation: bounceOnce 240ms ease-out;
}

@media (max-width: 768px) {
  /* カード */
  .sim__card {
    max-width: 335px;
    padding: 20px 16px;
    border-radius: 36px;
    box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.08),
      0 6px 14px rgba(0, 0, 0, 0.28);
  }

  /* ラベル */
  .sim-form__label {
    font-size: 16px; /* iOSズーム回避 */
    margin: 18px 0 8px;
    gap: 8px;
    align-items: first baseline;
    text-align: left;
  }
  .sim-form__label::before {
    width: 14px;
    height: 14px;
  }

  /* 入力共通 */
  .sim-input,
  .sim-select {
    width: 100%;
    height: 56px; /* 65→56 */
    line-height: 56px;
    font-size: 16px; /* iOSズーム回避 */
    padding: 0 18px;
    box-shadow: inset 0 0 0 3px var(--color-faq);
    border-radius: 999px;
  }
  .is-error .sim-input,
  .is-error .sim-select {
    box-shadow: inset 0 0 0 3px var(--color-error);
  }
  .sim-form__error {
    font-size: 10px;
    font-weight: 700;
    gap: 6px;
  }
  .sim-form__error .sim-error__icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }
  /* ▼セレクト：丸ボタン＋山形を“2枚重ね”で表示（上書き版） */
  .sim-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* 1枚目＝丸ボタン, 2枚目＝山形。順序とpositionを合わせる */
    background-image: url("../img/simulator/select-button.svg"),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%234d322c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat, no-repeat;
    background-position: right 2px center, right 15px center; /* 丸, 山形 */
    background-size: 53px 53px, 18px 18px; /* 丸をやや小さく 山形アイコン */
    padding-right: 48px; /* 右側アイコン分 */
  }

  /* ラジオ：タップしやすさUP */
  .sim-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 15px;
    justify-content: flex-start;
    margin-left: 22px;
  }
  .sim-radio label {
    padding: 6px 2px;
  }
  .sim-radio__item::before {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }
  .sim-radio input:checked + .sim-radio__item::before {
    box-shadow: inset 0 0 0 5px var(--color-accent);
  }

  /* 送信ボタン */
  .sim__submit {
    margin: 28px 0 24px;
  }
  .sim-btn {
    width: 100%;
    min-width: 0;
    height: 56px;
    font-size: 18px;
    box-shadow: inset 0 0 0 3px #fff, 0 10px 16px rgba(0, 0, 0, 0.2);
  }
  /* 結果表示 */
  .sim-result {
    max-width: 335px;
  }
  .sim-result__arrow {
    width: 52px;
    height: 32px;
  }

  .sim-result__stage {
    padding: 18px 8px;
  }

  .sim-result__char {
    width: 140px;
    bottom: -10px;
  }
  .sim-result__char--left {
    left: -85px;
  }
  .sim-result__char--right {
    right: -85px;
  }

  .sim-result__body {
    max-width: 100%;
    padding: 14px 8px 12px;
  }
  .sim-result__body::before,
  .sim-result__body::after {
    border-top-width: 2px;
  } /* SPも2px指定 */

  .sim-result__amount {
    font-size: 40px;
  }
  .sim-result__yen {
    font-size: 21px;
  }
  .sim-result__meta {
    font-size: 15px;
  }
  .sim-result__badge {
    margin: -40px auto 0;
    width: 60%;
    transform: translateY(40px);
  }
  /* 免責 */
  .sim__disclaimer {
    max-width: 335px;
    border-radius: 18px;
    margin: 8px auto 24px;
  }
  .sim__disclaimer-title {
    font-size: 15px;
    padding: 10px 14px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0; /* 下辺は直線のまま */
  }
  .sim__disclaimer-body {
    font-size: 13px;
    line-height: 1.8; /* 行間を少し広げる */
    padding: 12px 14px 16px;
  }
}
