/* ===== 基本レイアウト ===== */
body {
  font-family: 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
}

.bold {
  font-weight: bold;
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
  background:#e1f7fa;
  padding: 1.0rem;padding-top: 66px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* ステップ制御 */
.form-step {
  display: none;
}
.form-step.active {
  display: block;
}

/* ===== 吹き出し（チャット風） ===== */
.chat-bubble {
  background: #e0f7fa;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  position: relative;
  font-size: 1rem;
}
.chat-bubble.operator::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  border: 10px solid transparent;
  border-right-color: #e0f7fa;
}

/* ===== 商品概要 ===== */
.product-summary {
  border: 1px solid #ccc;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  border-radius: 10px;
  background-color: #fafafa;
}
.product-summary img {
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
}
.product-summary .price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #d32f2f;
}
.product-summary .price .only {
  font-size: 0.9rem;
  color: #555;
}

/* ===== 入力グループ ===== */
.form-group {
  margin-bottom: 1.3rem;
}
.radio-group {
  display: flex;
  gap: 1rem;
}
.birthdate-select select {
  width: 32%;
}

/* ===== 入力フィールド ===== */
input,
select,
button {
  width: 100%;
  font-size: 1rem;
  padding: 0.8rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid #666;
  border-radius: 6px;
  box-sizing: border-box;
}

.chat-bubble.operator-with-icon .operator-icon {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.chat-line {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.operator-icon img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 1rem;
}

.chat-bubble {width: 100%;
  background: #fefefe;
  border: 1px solid #ddd;
  padding: 0.8rem 1rem;
  border-radius: 12px 12px 12px 0; /* ←左下を丸くしない */
  font-size: 1rem;
  line-height: 1.6;
  position: relative;
}

.chat-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 12px;
  border: 8px solid transparent;
  border-right-color: #fefefe;
}


/* ===== 性別選択ボタン風 ===== */
.styled-radio {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.gender-option {
  font-size: 2rem;
  padding: 1rem;
  border: 2px solid #999;
  border-radius: 8px;
  background: #eee;
  cursor: pointer;
  text-align: center;
  flex: 1;
  transition: 0.3s;
  font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
input[type="radio"]:checked + .female {
  background-color: #f06292;
  border-color: #c2185b;
}
input[type="radio"]:checked + .male {
  background-color: #64b5f6;
  border-color: #1976d2;
}
.gender-option.female:hover {
  background-color: #f8bbd0;
}
.gender-option.male:hover {
  background-color: #bbdefb;
}

/* ===== 生年月日 select ===== */
.birthdate-select select {
  width: 32%;
  background-color: #ffffe0;
  border: 2px solid #4CAF50;
  border-radius: 8px;
  padding: 0.6rem;
  font-size: 1rem;
}
.gender-option.female img{width:26px;margin-right: 4px;}
.gender-option.male img{width:22px;margin-right: 4px;}


/* ===== ボタン・ナビゲーション ===== */
button {
  background: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
}
button:hover {
  background: #45a049;
}
.form-navigation {
  text-align: right;
}
.next-button {
  background: #2196F3;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
}
.next-button:hover {
  background: #1976D2;
}

/* ===== 必須マーク ===== */
.required {
  color: red;
  margin-left: 0.25em;
}

/* ===== エラーメッセージ ===== */
.error-message {
  color: red;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ===== ローディングオーバーレイ ===== */
#overlay {
  display: none !important;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  text-align: center;
  font-size: 1.2rem;
  font-family: sans-serif;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#overlay.show {
  display: flex !important;
}
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* ===== プログレスバー ===== */
#progress-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color:rgba(51,51,51,0.5);
  padding: 0.5rem 1rem;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#progress-inner {
  max-width: 600px;
  margin: 0 auto;
}

#progress-label {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 4px;
  text-align: left;
}

#progress-bar {
  height: 8px;
  background: #4CAF50;
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}
.chat-block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.chat-block.show {
  opacity: 1;
  transform: translateY(0);
}
button.disabled {
  background: #ccc !important;  /* 確実に適用させる */
  color: #666;
  cursor: default;
  display: none;
}
.input-error {
  border-color: #e53935 !important;
  background: #fff6f6;
}
.field-error {
  color: #e53935;
  font-size: 0.9rem;
  margin-top: -0.4rem;
  margin-bottom: 0.8rem;
}
button.toggle-pass{position: absolute;right: 8px;top: -4%; width: 60px; background: none;}
button.toggle-pass img{width: 48px;}

/* Stripeコンテナの見た目（フォールバック用） */
#stripe-section .StripeElement,
#card-element {
  background: #fff;
  border: 1px solid #D0D7DE;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
}
#stripe-section .StripeElement--focus {
  outline: none;
  border-color: #0A66FF;
  box-shadow: 0 0 0 3px rgba(10,102,255,.15);
}
#stripe-section .StripeElement--invalid {
  border-color: #D93025;
  box-shadow: none;
}

/* 支払いボタンの“処理中”見た目（任意） */
#pay-next.is-processing {
  pointer-events: none;      /* クリックは止めるがボタンは表示のまま */
  opacity: .8;
}
#stripe-section .Link,
#stripe-section .LinkButton {
  display: none !important;
}

/* trial だけ代引きを隠す */
[data-form="trial"] #pay_cod,
[data-form="trial"] label[for="pay_cod"],
[data-form="trial"] #cod-section,
[data-form="trial"] #btn-continue-cod,
[data-form="trial"] #btn-switch-to-card,
[data-form="trial"] .trial-step {
  display: none !important;
}
.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 160px 120px;
}
.card-grid > div {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}
