/* =====================================================
   PayTrans — 共通スタイルシート
   ブランドカラー: グリーン系 / モバイルファースト
   ===================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ---- CSS変数 ---- */
:root {
  --color-primary: #2F7A5D;
  --color-accent: #3FA67A;
  --color-bg: #F6F9F8;
  --color-text: #1F2A27;
  --color-danger: #D9534F;
  --color-gray-light: #E5ECEA;
  --color-gray-mid: #8FA19A;
  --color-white: #FFFFFF;
  --color-dark: #1F2A27;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .12);

  --max-width: 720px;
  --font: 'Noto Sans JP', system-ui, sans-serif;
}

/* ---- リセット ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font);
}

/* ---- レイアウト ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- ヘッダー ---- */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  height: 52px;
}

.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

/* ---- ヒーローセクション ---- */
.hero {
  background: linear-gradient(135deg, #e8f5f0 0%, #d0ede4 100%);
  padding: 48px 16px 40px;
  text-align: center;
}

.hero h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.hero p {
  font-size: 14px;
  color: var(--color-gray-mid);
}

/* ---- ボタン ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  border: none;
  transition: opacity .15s, transform .1s;
}

.btn:active {
  transform: scale(.98);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  opacity: .9;
}

.btn-secondary {
  background: var(--color-gray-light);
  color: var(--color-text);
}

.btn-secondary:hover {
  opacity: .85;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  opacity: .9;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ---- カード ---- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ---- セクション ---- */
.section {
  padding: 28px 0;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

/* ---- ステップカード（仕組み説明） ---- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-body p {
  font-size: 13px;
  color: var(--color-gray-mid);
}

/* ---- 取引一覧カード ---- */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-card {
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tx-card-info {
  flex: 1;
  min-width: 0;
}

.tx-card-id {
  font-size: 12px;
  color: var(--color-gray-mid);
}

.tx-card-status {
  font-size: 13px;
  font-weight: 700;
  margin: 2px 0;
}

.tx-card-date {
  font-size: 12px;
  color: var(--color-gray-mid);
}

/* ---- ステータスバッジ ---- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-created {
  background: #e0f0ea;
  color: var(--color-primary);
}

.badge-submitted {
  background: #fff3cd;
  color: #856404;
}

.badge-verified {
  background: #cfe2ff;
  color: #084298;
}

.badge-pending {
  background: #ffe0b2;
  color: #e65100;
}

.badge-suspended {
  background: #fde8e8;
  color: var(--color-danger);
}

.badge-unlocked {
  background: #d1fae5;
  color: #065f46;
}

.badge-expired {
  background: var(--color-gray-light);
  color: var(--color-gray-mid);
}

.badge-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

/* ---- フォーム ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color .15s;
}

.form-control::placeholder {
  color: #CBD5E0;
  opacity: 1;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-control:disabled {
  background: var(--color-bg);
  color: var(--color-gray-mid);
}

.form-control[readonly] {
  background-color: #F8FAFC;
  color: #64748B;
  border-color: #E2E8F0;
  cursor: default;
}

.form-hint {
  font-size: 12px;
  color: var(--color-gray-mid);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
}

/* ---- アップロードエリア ---- */
.upload-area {
  border: 2px dashed var(--color-gray-light);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--color-primary);
  background: #f0faf5;
}

.upload-area p {
  font-size: 14px;
  color: var(--color-gray-mid);
  margin-top: 8px;
}

.upload-icon {
  font-size: 40px;
}

/* ---- サムネイルグリッド ---- */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-gray-light);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item .thumb-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 10px;
  padding: 3px 5px;
}

.thumb-item .thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}

/* ---- タイマー ---- */
.timer-box {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.timer-count {
  font-size: 48px;
  font-weight: 700;
  color: #e65100;
  line-height: 1;
}

.timer-label {
  font-size: 13px;
  color: var(--color-gray-mid);
  margin-top: 6px;
}

/* ---- マスク表示 ---- */
.masked-value {
  font-family: monospace;
  letter-spacing: 2px;
  color: var(--color-gray-mid);
}

.reveal-btn,
.api-reveal-btn {
  font-size: 12px;
  color: var(--color-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- アラート ---- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-info {
  background: #e8f4fd;
  color: #0c5460;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
}

.alert-danger {
  background: #fde8e8;
  color: #721c24;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

/* ---- URL表示ボックス ---- */
.url-box {
  background: var(--color-bg);
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-box span {
  flex: 1;
  font-family: monospace;
}

.copy-btn {
  background: none;
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-primary);
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--color-bg);
}

/* ---- 注意事項 ---- */
.notice-list {
  list-style: none;
  font-size: 12px;
  color: var(--color-gray-mid);
  line-height: 1.8;
}

.notice-list li::before {
  content: '※ ';
}

/* ---- フッター ---- */
.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, .7);
  padding: 24px 16px;
  margin-top: 48px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.site-footer a {
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
}

.site-footer a:hover {
  color: #fff;
}

/* ---- ローディング ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-gray-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- ユーティリティ ---- */
.text-center {
  text-align: center;
}

.text-small {
  font-size: 12px;
}

.text-muted {
  color: var(--color-gray-mid);
}

.text-danger {
  color: var(--color-danger);
}

.text-success {
  color: #065f46;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

.mr-8 {
  margin-right: 8px;
}

.py-32 {
  padding-top: 32px;
  padding-bottom: 32px;
}

/* ---- カード内のリストスタイル ---- */
.card ul,
.card ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.card li {
  margin-bottom: 8px;
}

/* ---- PC対応 ---- */
@media (min-width: 640px) {
  .hero h1 {
    font-size: 28px;
  }

  .steps {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .step-card {
    flex: 1;
    min-width: 200px;
  }
}