/* style.css - 守成クラブ LINE会員連携 フロントエンドスタイル */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont,
    'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
    'Noto Sans JP', 'Yu Gothic', sans-serif;
  background: #f2f2f2;
  color: #333;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
}

/* ============================================================
   画面切り替え
============================================================ */
.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: 48px;
  animation: fadeIn 0.2s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ローディング
============================================================ */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 18px;
  color: #777;
  font-size: 15px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #06c755;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   コンテナ・ページヘッダー
============================================================ */
.container {
  padding: 24px 20px;
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 3px solid #06c755;
}
.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #06c755;
  margin-bottom: 6px;
}
.page-header .subtitle {
  font-size: 13px;
  color: #777;
  line-height: 1.5;
}

/* ============================================================
   お知らせバナー（暫定版表示）
============================================================ */
.notice-banner {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-left: 4px solid #ffa000;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #6d4c00;
  margin-bottom: 20px;
}

/* ============================================================
   フォーム
============================================================ */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.form-group input:focus {
  border-color: #06c755;
}

.hint-text {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
  line-height: 1.5;
}

/* ============================================================
   エラーメッセージ
============================================================ */
.error-message {
  background: #fff5f5;
  border: 1px solid #ffb3b3;
  border-left: 4px solid #e53e3e;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #c53030;
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

/* ============================================================
   ボタン
============================================================ */
.btn {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
  margin-bottom: 12px;
  -webkit-appearance: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: #06c755;
  color: #fff;
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.btn-secondary {
  background: #fff;
  color: #444;
  border: 2px solid #ddd;
}
.btn-secondary:hover:not(:disabled) { background: #f5f5f5; }

/* ローディング中ボタン */
.btn-loading {
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ============================================================
   会員情報カード
============================================================ */
.member-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 4px 0;
  margin-bottom: 24px;
  overflow: hidden;
}
.member-row {
  display: flex;
  align-items: baseline;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  line-height: 1.5;
}
.member-row:last-child { border-bottom: none; }
.member-label {
  min-width: 90px;
  width: 90px;
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
}
.member-value {
  flex: 1;
  color: #222;
  font-weight: 500;
  word-break: break-all;
}

/* ============================================================
   完了・エラー画面
============================================================ */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 32px;
  text-align: center;
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
}
.icon-success { background: #06c755; color: #fff; }
.icon-error   { background: #e53e3e; color: #fff; }

.result-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.result-message {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.result-hint {
  font-size: 13px;
  color: #999;
  margin-bottom: 28px;
}

/* ============================================================
   デバッグパネル（確認後に削除可）
============================================================ */
#debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(18, 18, 28, 0.97);
  color: #a8ff78;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.6;
  z-index: 9999;
  border-top: 2px solid #a8ff78;
  max-height: 50vh;
  flex-direction: column;
}
#debug-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0,0,0,0.5);
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}
#debug-close-btn {
  background: none;
  border: 1px solid #666;
  color: #ccc;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
#debug-panel-body {
  padding: 8px 12px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  flex: 1;
}
#debug-toggle-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(40, 40, 60, 0.85);
  border: 1px solid #555;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
