/* ==========================================================================
   千住古民家サロン | 子犬対面説明＆契約iPadスマートガイド スタイルシート
   ========================================================================== */

:root {
  --bg-primary: #FDFBF7;
  --bg-secondary: #F4EFE6;
  --text-main: #2C2825;
  --text-muted: #6B655F;
  --accent-gold: #C29B38;
  --accent-gold-light: #F9F5EB;
  --accent-indigo: #1E2D4A;
  --accent-indigo-light: #EEF2F8;
  --accent-green: #2E7D32;
  --accent-green-light: #E8F5E9;
  --accent-danger: #C62828;
  --accent-danger-light: #FFEBEE;
  --border-subtle: #E2D9CC;
  --border-focus: #C29B38;
  --card-shadow: 0 10px 30px rgba(44, 40, 37, 0.06);
  --font-base: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Shippori Mincho', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-base);
  background: var(--bg-secondary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow-x: hidden;
}

/* タブレット外枠コンテナ */
.tablet-container {
  width: 100%;
  max-width: 1024px;
  min-height: 720px;
  background: var(--bg-primary);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ヘッダー */
.app-header {
  background: var(--accent-indigo);
  color: #FFFFFF;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--accent-gold);
}

.brand-badge {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ステップインジケーター */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.45;
  transition: all 0.3s ease;
}

.step-dot span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.step-dot label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.step-dot.active {
  opacity: 1;
}

.step-dot.active span {
  background: var(--accent-gold);
  color: var(--accent-indigo);
  border-color: var(--accent-gold);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(194, 155, 56, 0.6);
}

.step-dot.passed {
  opacity: 0.9;
}

.step-dot.passed span {
  background: #2E7D32;
  border-color: #2E7D32;
  color: #fff;
}

.step-line {
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
}

/* メインカード領域 */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.step-card {
  display: none;
  animation: fadeInSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.step-card.active {
  display: block;
}

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

.card-header {
  margin-bottom: 24px;
}

.badge-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent-gold);
  margin-bottom: 8px;
}

.badge-tag.danger {
  background: var(--accent-danger-light);
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

.card-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-indigo);
  margin-bottom: 6px;
}

.card-header .desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* STEP 1: 子犬プロフィール */
.puppy-profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  background: #FFFFFF;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.puppy-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
}

.puppy-emoji-anim {
  width: 120px;
  height: 120px;
  background: var(--accent-gold-light);
  border: 3px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
  z-index: 2;
  animation: floatPuppy 3s ease-in-out infinite;
}

@keyframes floatPuppy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.pulse-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  opacity: 0.6;
  animation: pulseAnim 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 0; }
}

.code-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

.puppy-name-tag h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent-indigo);
  margin: 4px 0;
}

.puppy-name-tag .breed {
  font-size: 12px;
  color: var(--text-muted);
}

.puppy-specs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 14px;
}

.spec-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.spec-row .label {
  color: var(--text-muted);
  font-weight: 600;
}

.spec-row .val {
  font-weight: 700;
  color: var(--text-main);
}

.spec-row .chip-code {
  font-family: monospace;
  letter-spacing: 1px;
  color: var(--accent-indigo);
}

/* 検査チェックリストカード */
.inspection-checklist h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-indigo);
  margin-bottom: 14px;
}

.check-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.check-item-card {
  background: #FFFFFF;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease;
}

.check-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-green);
}

.check-item-card .icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: var(--bg-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-item-card .text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.check-item-card .text strong {
  font-size: 14px;
  color: var(--text-main);
}

.check-item-card .text span {
  font-size: 12px;
  color: var(--text-muted);
}

.check-badge {
  background: var(--accent-green-light);
  color: var(--accent-green);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
}

/* STEP 2: 遺伝病・ワクチン */
.dna-guarantee-banner {
  background: linear-gradient(135deg, var(--accent-indigo), #2A3F66);
  color: #FFFFFF;
  padding: 20px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.dna-icon-anim {
  font-size: 40px;
  animation: rotateDNA 8s linear infinite;
}

@keyframes rotateDNA {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dna-text h3 {
  font-size: 18px;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.dna-text p {
  font-size: 13px;
  opacity: 0.9;
}

.dna-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dna-card {
  background: #FFFFFF;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.dna-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-green);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.dna-card h4 {
  font-size: 14px;
  color: var(--accent-indigo);
  margin-bottom: 6px;
  padding-right: 50px;
}

.dna-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ワクチンタイムライン */
.timeline-box {
  background: #FFFFFF;
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.timeline-box h3 {
  font-size: 15px;
  color: var(--accent-indigo);
  margin-bottom: 16px;
}

.vax-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vax-point {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.vax-point .circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
}

.vax-point.done .circle {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.vax-point.next .circle {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--accent-indigo);
  animation: pulseNext 2s infinite;
}

@keyframes pulseNext {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.vax-point .info strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.vax-point .info span {
  font-size: 11px;
  color: var(--text-muted);
}

.vax-line {
  height: 2px;
  background: var(--border-subtle);
  width: 30px;
  margin: 0 10px;
}

.vax-line.done {
  background: var(--accent-green);
}

/* STEP 3: 低血糖警告 */
.warning-hero-card {
  background: var(--accent-danger-light);
  border: 2px solid var(--accent-danger);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  animation: shakeNotice 6s ease-in-out infinite;
}

@keyframes shakeNotice {
  0%, 90%, 100% { transform: translateX(0); }
  92%, 96% { transform: translateX(-3px); }
  94%, 98% { transform: translateX(3px); }
}

.warning-icon {
  font-size: 44px;
}

.warning-body h3 {
  font-size: 18px;
  color: var(--accent-danger);
  margin-bottom: 6px;
}

.warning-body p {
  font-size: 13px;
  color: #7F0000;
  line-height: 1.6;
}

.rules-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rule-box {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.rule-box h4 {
  font-size: 16px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.rule-box.good h4 {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.rule-box.bad h4 {
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

.rule-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-box ul li {
  font-size: 13px;
  color: var(--text-main);
  padding-left: 14px;
  position: relative;
}

.rule-box ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* STEP 4: 生体保証・規約 */
.warranty-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.warranty-card {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--card-shadow);
}

.warranty-card.highlight {
  border: 2px solid var(--accent-gold);
  background: var(--accent-gold-light);
}

.w-header {
  margin-bottom: 10px;
}

.w-period {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  background: #FFFFFF;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--accent-gold);
  display: inline-block;
  margin-bottom: 4px;
}

.warranty-card h4 {
  font-size: 16px;
  color: var(--accent-indigo);
}

.warranty-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.agreement-acknowledgements {
  background: #FFFFFF;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.agreement-acknowledgements h3 {
  font-size: 14px;
  color: var(--accent-indigo);
  margin-bottom: 14px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  display: none;
}

.check-row .box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-subtle);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.check-row input[type="checkbox"]:checked + .box {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.check-row input[type="checkbox"]:checked + .box::after {
  content: '✓';
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.check-row .txt {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

/* STEP 5: 署名 */
.contract-summary-box {
  background: #FFFFFF;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.cs-row {
  display: flex;
  justify-content: space-between;
}

.cs-row .price {
  color: var(--accent-danger);
  font-size: 18px;
}

.signature-section {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.sig-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sig-header h4 {
  font-size: 15px;
  color: var(--accent-indigo);
}

.canvas-wrap {
  position: relative;
  background: #FAF8F5;
  border: 2px dashed var(--accent-gold);
  border-radius: 10px;
  overflow: hidden;
  height: 160px;
  margin-bottom: 16px;
}

#sigCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.sign-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #B5ACA0;
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.signer-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.input-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent-gold);
}

/* フッター */
.app-footer {
  background: #FFFFFF;
  padding: 16px 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-center {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-nav {
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav.prev {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.btn-nav.prev:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-nav.next {
  background: var(--accent-gold);
  color: var(--accent-indigo);
  box-shadow: 0 4px 15px rgba(194, 155, 56, 0.4);
}

.btn-nav.next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(194, 155, 56, 0.6);
}

.btn-nav.next.sign-mode {
  background: var(--accent-indigo);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(30, 45, 74, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--accent-indigo);
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}

/* 完了セレブレーションモーダル */
.completion-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 45, 74, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease forwards;
}

.completion-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.completion-modal {
  background: var(--bg-primary);
  width: 90%;
  max-width: 580px;
  padding: 36px 32px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confetti-anim {
  font-size: 48px;
  margin-bottom: 12px;
  animation: bounceConfetti 1s infinite alternate;
}

@keyframes bounceConfetti {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.completion-modal h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--accent-indigo);
  margin-bottom: 10px;
}

.completion-modal p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.cert-box {
  background: #FFFFFF;
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
}

.cert-stamp {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 2px solid var(--accent-danger);
  color: var(--accent-danger);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  transform: rotate(-15deg);
  opacity: 0.85;
}

.cert-box h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.cert-box p {
  font-size: 13px;
  color: var(--text-main);
  margin: 2px 0;
}
