* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 600px;
}

.payment-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
}

h1 {
  color: #333;
  font-size: 28px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
}

.subtitle {
  color: #666;
  font-size: 16px;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 400;
}

.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* テキスト入力フィールド（既存のnumberスタイルを拡張） */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
}

/* number入力のスピナー非表示（既存のスタイルを維持） */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#card-container {
  min-height: 200px;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  transition: border-color 0.3s;
}

#card-container:focus-within {
  border-color: #667eea;
}

.submit-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.loading {
  text-align: center;
  color: #667eea;
  font-weight: 500;
  margin-top: 20px;
}

/* Square Web Payments SDK のスタイル調整 */
.sq-input {
  border: none !important;
  box-shadow: none !important;
}

.sq-input--focus {
  border: none !important;
  box-shadow: none !important;
}

/* タブナビゲーション */
.tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 30px;
  gap: 0;
}

.tab-button {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #666;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.tab-button:hover {
  color: #667eea;
  background-color: #f5f5f5;
}

.tab-button.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

/* タブコンテンツ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.section-title {
  color: #333;
  font-size: 20px;
  margin-bottom: 24px;
  font-weight: 600;
}

.card-brands-logo {
  text-align: center;
  margin-bottom: 24px;
}

.card-brands-image {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* 金額ボタン */
.amount-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.amount-button {
  padding: 14px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.amount-button:hover {
  border-color: #667eea;
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.amount-button.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 今回のみの寄付用の金額ボタン（3列レイアウト） */
.one-time-amount-buttons {
  grid-template-columns: repeat(3, 1fr);
}

/* 金額入力フィールドと「円」の表示 */
.form-group {
  position: relative;
}

#amount {
  padding-right: 50px;
}

.amount-unit {
  position: absolute;
  right: 16px;
  top: 28px;
  color: #666;
  font-size: 16px;
  pointer-events: none;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 40px;
}

/* 支払い方法タブ */
.payment-method-tabs {
  display: flex;
  gap: 0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.method-tab {
  flex: 1;
  padding: 12px 20px;
  background: white;
  border: none;
  border-right: 1px solid #e0e0e0;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.method-tab:last-child {
  border-right: none;
}

.method-tab:hover {
  background-color: #f5f5f5;
}

.method-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.payment-method-content {
  margin-top: 20px;
}

/* 銀行振込情報 */
.bank-info {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.bank-info p {
  color: #555;
  margin-bottom: 16px;
  line-height: 1.6;
}

.bank-info-content {
  color: #333;
  line-height: 1.8;
}

.bank-method {
  margin-bottom: 20px;
}

.bank-method h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
}

.bank-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.bank-table th {
  background-color: #f5f5f5;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  width: 140px;
  font-size: 14px;
}

.bank-table td {
  padding: 12px 16px;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  word-break: break-all;
}

.bank-table tr:last-child th,
.bank-table tr:last-child td {
  border-bottom: none;
}

.bank-note {
  margin-top: 12px;
  padding: 10px 12px;
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
  color: #856404;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 4px;
}

/* フォームヒント */
.form-hint {
  display: block;
  margin-top: 6px;
  color: #888;
  font-size: 12px;
}

/* 姓・名の横並びレイアウト */
.name-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.name-field {
  display: flex;
  flex-direction: column;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
  .payment-card {
    padding: 30px 20px;
  }

  h1 {
    font-size: 24px;
  }

  .tabs {
    flex-direction: column;
    border-bottom: none;
  }

  .tab-button {
    border-bottom: 2px solid #e0e0e0;
    border-left: 3px solid transparent;
    text-align: left;
  }

  .tab-button.active {
    border-bottom-color: #e0e0e0;
    border-left-color: #667eea;
  }

  .amount-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .payment-method-tabs {
    flex-direction: column;
  }

  .method-tab {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  .method-tab:last-child {
    border-bottom: none;
  }

  /* 姓・名を縦並びに戻す */
  .name-group {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .name-field {
    margin-bottom: 24px;
  }
  
  .name-field:last-child {
    margin-bottom: 0;
  }
}

/* カウントダウンタイマー */
.countdown-timer {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #155724;
  text-align: center;
}

