/* リセットCSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic', '游ゴシック', 'Meiryo', 'メイリオ', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.payment-form {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #2c3e50;
  margin-bottom: 30px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

h2 {
  color: #34495e;
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 500;
}

h3 {
  color: #34495e;
  margin: 25px 0 15px 0;
  font-size: 18px;
  font-weight: 500;
}

/* 商品情報 */
.product-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #dee2e6;
}

.product-name {
  font-weight: 500;
}

.product-price {
  font-weight: 600;
  color: #2c3e50;
}

.total {
  text-align: right;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #2c3e50;
  font-size: 18px;
  color: #2c3e50;
}

/* フォーム要素 */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #34495e;
}

.required {
  color: #e74c3c;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 支払い方法選択 */
.payment-options {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.payment-option {
  display: block;
  cursor: pointer;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
  background: white;
}

.payment-option:hover {
  border-color: #3498db;
  background: #f8f9fa;
}

.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-option input[type="radio"]:checked+.payment-option-content {
  color: #2c3e50;
}

.payment-option:has(input[type="radio"]:checked) {
  border-color: #3498db;
  background: #e3f2fd;
}

.payment-option.selected {
  border-color: #3498db;
  background: #e3f2fd;
}

.payment-option-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-icon {
  font-size: 24px;
}

.payment-text {
  font-weight: 500;
  font-size: 16px;
}

/* Stripe Buy Button コンテナ */
.stripe-buy-button-container {
  margin-top: 30px;
  text-align: center;
}

/* Stripe Buy Button のスタイル調整 */
stripe-buy-button {
  display: block;
  width: 100%;
}

/* ローディング */
.loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* エラーメッセージ */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin-top: 20px;
  text-align: center;
}

/* ユーティリティクラス */
.hidden {
  display: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .payment-form {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .payment-option-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .payment-icon {
    font-size: 20px;
  }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* フォーカス表示の改善 */
.payment-option:focus-within {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}
