/* -- リセット & ベース -- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
}
.container {
  max-width: 640px;
  margin: 40px auto;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* すべてのテキスト系フォームをゆったりサイズに */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  /* 縦方向の内側余白を増やす */
  padding: 12px 12px;
  /* 最低限このくらいの高さを確保 */
  min-height: 48px;
  /* フォントサイズも少し大きめにして可読性UP */
  font-size: 16px;
}

/* select要素のモバイル対応 */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>') no-repeat right 12px center;
  background-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* モバイル時のみ適用したい場合はメディアクエリで */
@media (max-width: 600px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    padding: 14px 16px;
    min-height: 56px;
    font-size: 18px;
  }
  
  select {
    padding-right: 40px; /* 矢印アイコンのスペースを確保 */
    background-position: right 16px center;
  }
}

/* Pay.jp Elements のカード入力を囲む枠 */
#card-form-wrapper {
  border: 1px solid #ccc;       /* 薄いグレーの枠線 */
  border-radius: 4px;           /* 角を丸く */
  padding: 8px 12px;            /* 内側に余白 */
  background: #fff;             /* 背景白 */
  margin-bottom: 16px;          /* 下に余白 */
}

/* iFrame 自体の高さ調整（必要に応じて） */
#card-form-wrapper iframe {
  height: 20px !important;      /* Elements の高さを揃える */
}

/* -- 教会名タイトルを中央に -- */
.church-name {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 16px;
}

/* -- 各セクション -- */
.section {
  margin-bottom: 32px;
}
.section h2 {
  font-size: 18px;
  margin-bottom: 16px;
}
.required {
  color: #e60012;
  margin-left: 4px;
}

/* -- プリセット金額ボタンと自由入力の間に余白 & 横並び -- */
.preset-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1em;
}
.preset-buttons label {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 12px 16px;
  padding-left: 40px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  user-select: none;
}

/* ─── 選択ボックス共通スタイル ─── */
.radio-inline {
  display: block;
  position: relative;
  padding: 12px 16px;
  padding-left: 40px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  user-select: none;
}

/* ラジオボタンを左端に寄せる */
.preset-buttons label input,
.radio-inline input {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  accent-color: #00c48c;
}

/* ───── カスタムラジオボタン ───── */
/* ① デフォルトのラジオを隠す */
.preset-buttons label input[type="radio"],
.radio-inline input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* ② チェックボックス枠（外側円） - 未選択時はグレー */
.preset-buttons label::before,
.radio-inline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid #ccc;   /* ← 未選択時のグレー */
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

/* ③ チェック時の背景色（外側円を緑ベタに） */
.preset-buttons label:has(input:checked)::before,
.radio-inline:has(input:checked)::before {
  background: #00c48c;
  border-color: #00c48c;     /* ← チェック時だけ緑に上書き */
}

/* ④ チェック時の中抜き（内側円） */
.preset-buttons label:has(input:checked)::after,
.radio-inline:has(input:checked)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  transform: translate(50%, -50%);
}



/* ホバー時の色変化 */
.preset-buttons label:hover,
.radio-inline:hover {
  background: #f0fdfa;
}

/* 選択時のスタイル */
.preset-buttons label:has(input:checked),
.radio-inline:has(input:checked) {
  background: #e6fffa;
  border-color: #00c48c;
}

/* -- カスタム金額 -- */
.custom-amount input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* -- フォーム行 & グループ -- */
.form-row {
  display: flex;
  gap: 0 16px;
  flex-wrap: wrap;
}
.form-group {
  flex: 1;
  margin-bottom: 16px;
}
.form-group.small {
  flex: 0 0 48%;
}

.form-group label input {
  display: block;       
  margin-top: 8px;   
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom:6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.split {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 注意書きブロック */
.card-info-note {
  background: #f7f9fa;       
  border: 1px solid #d9e2e8; 
  border-radius: 4px;
  padding: 12px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;        
  color: #555;              
}

/* テキスト部分 */
.card-info-note p {
  margin: 0;
  line-height: 1.4;
}


/* -- ボタン -- */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.btn-back,
.btn-next {
  padding: 10px 50px;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  min-width: 120px;
  position: relative;
}
.btn-back {
  background: #fff;
  border: 1px solid #00c48c;
  color: #00c48c;
}
.btn-next {
  background: #00c48c;
  border: none;
  color: #fff;
}

/* -- ローディング状態 -- */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 運営協力金オプションを金額選択と同じ横並びデザインに */
.tip-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;  /* グレー背景との間の余白 */
}

.tip-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
  min-width: 100px;   /* 見やすさ調整用 */
  text-align: center;
}

/* ラジオボタン非表示 */
.tip-options input[type="radio"] {
  display: none;
}

/* チェック時に label 全体の色を変える */
.tip-options input[type="radio"]:checked + label,
.tip-options label:has(input[type="radio"]:checked) {
  background: #e6f7f1;   /* 選択時の背景色 */
  border-color: #00c48c;
  /*font-weight: 600;*/
}

/* 合計金額表示 */
.total-amount {
  text-align: center;     /* 中央寄せ */
  margin-top: 20px;       /* 上に余白 */
  font-size: 16px;
}

.total-amount strong {
  font-weight: 700;       /* 金額を太字 */
  font-size: 18px;        /* 少し大きく */
}

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid #ddd;
  padding: 16px 0;
  text-align: center;
  font-size: 14px;
  color: #777;
  margin-top: 40px;
}
.site-footer p {
  margin: 0 0 8px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 16px;
}
.footer-links a {
  color: #00c48c;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* ---------- LINE ログイン関連スタイル ---------- */
.login-block {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.line-login-btn {
  background: #06C755;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: block;
  margin: 0 auto 12px;
  transition: background-color 0.2s;
}

.line-login-btn:hover {
  background: #05b04a;
}

.login-description {
  text-align: center;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

.logged-in-area {
  text-align: center;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background: #c82333;
}

/* 保存済みカード選択 */
.card-selection {
  margin-bottom: 16px;
}

.radio-card {
  display: block;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-card:hover {
  border-color: #00c48c;
  background-color: #f8fff8;
}

.radio-card input[type="radio"] {
  margin-right: 8px;
}

.radio-card input[type="radio"]:checked {
  accent-color: #00c48c;
}

/* マイ情報保存セクション */
.save-controls {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.checkbox-label:last-child {
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #00c48c;
}

#make-default-card-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .user-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .line-login-btn {
    width: 100%;
  }
}
