/* ===== KIWAMI Design System — Monochrome ===== */
:root {
  --bg-deep:    #080808;
  --bg-dark:    #111111;
  --bg-card:    #181818;
  --bg-input:   #1f1f1f;
  --border:     rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.13);
  --gold:       #ffffff;
  --gold-light: #e8e8e8;
  --gold-dim:   rgba(255,255,255,0.05);
  --text-primary:   #f0f0f0;
  --text-secondary: #b8b8b8;
  --text-muted:     #808080;
  --text-dim:       #484848;
  --success: #4ade80;
  --error:   #f87171;
  --radius:    8px;
  --radius-sm: 4px;
  --shadow:    0 8px 32px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Arial, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Layout ===== */
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ===== Header ===== */
.site-header {
  background: #080808;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; flex-direction: column; gap: 2px; }

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #ffffff;
  text-decoration: none;
}

.logo-sub {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-badge {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== Hero ===== */
.hero {
  background: #0d0d0d;
  padding: 56px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-title span { color: #ffffff; font-weight: 600; }

.hero-desc {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 28px;
}

/* ===== Step Bar ===== */
.step-bar { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 24px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-dim);
  background: var(--bg-card);
  font-weight: 600;
  transition: all 0.3s;
}

.step.active .step-num {
  border-color: rgba(255,255,255,0.5);
  color: #ffffff;
  background: rgba(255,255,255,0.07);
}

.step.done .step-num {
  border-color: var(--success);
  color: var(--success);
  background: rgba(74,222,128,0.08);
}

.step-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; white-space: nowrap; }
.step.active .step-label { color: var(--text-muted); }

.step-line { width: 60px; height: 1px; background: var(--border); margin-bottom: 20px; }

/* ===== Main Content ===== */
.main-content { padding: 48px 0 80px; flex: 1; }

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.02);
}

.card-icon {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); letter-spacing: 0.5px; }
.card-subtitle { font-size: 10px; color: var(--text-dim); margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }
.card-body { padding: 24px; }

/* ===== Form ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px; text-transform: uppercase;
}

.required-mark { color: var(--text-muted); margin-left: 2px; }

.form-input, .form-textarea, .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 14px;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: rgba(255,255,255,0.35);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-input); }
.form-hint { font-size: 11px; color: var(--text-dim); }

/* ===== Signature Pad ===== */
.signature-container { position: relative; }

.signature-label-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}

.signature-canvas {
  width: 100%; height: 160px;
  background: #fafafa;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  cursor: crosshair; display: block; touch-action: none;
}

.signature-canvas.signed { border-color: rgba(255,255,255,0.3); }

.sig-empty-msg {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px; color: #b0b0b0;
  pointer-events: none; text-align: center; line-height: 1.5;
}

.btn-clear-sig {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px; padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-clear-sig:hover { border-color: var(--error); color: var(--error); }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #ffffff;
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; padding: 15px 40px;
  cursor: pointer; font-family: inherit;
  transition: all 0.2s; text-transform: uppercase;
}

.btn-primary:hover {
  background: #e8e8e8;
  box-shadow: 0 4px 20px rgba(255,255,255,0.12);
}

.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
  opacity: 0.3; cursor: not-allowed;
  transform: none; box-shadow: none;
}

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px; padding: 11px 24px;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.3); color: var(--text-primary); }

.form-actions { display: flex; justify-content: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }

/* ===== Notice ===== */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 20px;
}
.notice-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notice p { font-size: 12px; color: var(--text-muted); line-height: 1.7; }

/* ===== Review Panel ===== */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }
.review-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.review-value { font-size: 14px; color: var(--text-primary); }

.sig-preview {
  max-width: 100%; max-height: 80px;
  border-radius: 4px;
  background: #0f0f0f;
  border: 1px solid var(--border); padding: 4px;
}

/* ===== Status Badge ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
}
.status-pending {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
}
.status-completed {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--success);
}

/* ===== Success Page ===== */
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 24px;
}

.success-title {
  font-size: 22px; font-weight: 300; letter-spacing: 4px;
  color: var(--text-primary); text-align: center; margin-bottom: 8px;
}
.success-title span { color: var(--success); font-weight: 600; }

.success-desc {
  font-size: 13px; color: var(--text-muted);
  text-align: center; line-height: 1.8; margin-bottom: 32px;
}

/* ===== Spinner ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.btn-primary .spinner {
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0a0a0a;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1f1f1f;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 13px; color: var(--text-primary);
  box-shadow: var(--shadow); z-index: 9999;
  opacity: 0; transform: translateY(8px);
  transition: all 0.3s; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* ===== Footer ===== */
.site-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px; color: var(--text-dim); letter-spacing: 1px;
}

/* ===== Checkbox ===== */
.checkbox-wrap {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 24px;
}
.checkbox-wrap:hover {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
}
.checkbox-wrap.checked {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.07);
}

.checkbox-label {
  font-size: 13px; color: var(--text-primary); line-height: 1.7;
  cursor: pointer; flex: 1;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 20px; height: 20px; min-width: 20px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  margin-top: 1px;
  position: relative;
  transition: all 0.2s;
}
.checkbox-label input[type="checkbox"]:checked {
  background: #ffffff;
  border-color: #ffffff;
}
.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 6px; height: 10px;
  border: 2px solid #0a0a0a;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ===== Agreement / clause (legacy — kept for compatibility) ===== */
.clause { display: flex; gap: 20px; padding: 28px 0 24px; border-bottom: 1px solid var(--border); }
.clause-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 3px;
}
.clause-body { flex: 1; min-width: 0; }
.clause-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.clause-body p { font-size: 13px; color: var(--text-muted); line-height: 1.85; margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 18px; }
  .step-line { width: 28px; }
  .card-body { padding: 18px; }
}
