/* ============================================
   お片付け危険度診断 - Apple HIG Design
   ============================================ */

:root {
  /* Brand Colors */
  --brand: #0099D9;
  --brand-dark: #0077A8;
  --brand-light: #E6F4FB;

  /* Semantic Colors */
  --color-success: #34C759;
  --color-warning: #FF9500;
  --color-error: #FF3B30;
  --color-danger: #AF1B1B;

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #636366;
  --text-tertiary: #AEAEB2;

  /* Backgrounds */
  --bg: #F2F2F7;
  --bg-white: #FFFFFF;
  --bg-elevated: #FFFFFF;

  /* Border */
  --border: #D1D1D6;
  --border-light: #E5E5EA;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", Meiryo, sans-serif;

  /* Spacing (8pt grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #FFFFFF;
    --text-secondary: #AEAEB2;
    --text-tertiary: #636366;
    --bg: #1C1C1E;
    --bg-white: #2C2C2E;
    --bg-elevated: #3A3A3C;
    --border: #48484A;
    --border-light: #38383A;
    --brand-light: #0A2E3D;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--s4);
}

/* ========== Header ========== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--s6) var(--s4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo img {
  display: block;
  height: 80px;
  width: auto;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: var(--s12) 0 var(--s10);
}

.hero-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  margin-bottom: var(--s4);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--s3);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.hero-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto var(--s4);
  line-height: 1.7;
}

.hero-points {
  list-style: none;
  text-align: left;
  max-width: 420px;
  margin: 0 auto var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.hero-points li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: var(--s6);
  position: relative;
}

.hero-points li::before {
  content: '';
  position: absolute;
  left: var(--s2);
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
}

.hero-points li strong {
  color: var(--text-primary);
  font-weight: 700;
}

.hero-time {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: var(--s8);
}

/* ========== Buttons ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--s3) var(--s8);
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--s3) var(--s6);
  background: var(--bg-white);
  color: var(--brand);
  border: 2px solid var(--brand);
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover { background: var(--brand-light); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--s3) var(--s6);
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-cta:hover { background: var(--brand-dark); }

/* ========== Card ========== */
.card {
  background: var(--bg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s8);
}

/* ========== Progress ========== */
.progress-wrap {
  padding-top: var(--s8);
  margin-bottom: var(--s6);
}

.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--s2);
}

.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.35s ease;
  width: 10%;
}

.progress-text {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ========== Question ========== */
.question-card {
  animation: fadeSlideIn 0.3s ease;
}

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

.q-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: var(--s1) var(--s4);
  border-radius: var(--r-full);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: var(--s4);
}

.q-text {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: var(--s6);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 52px;
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.answer-btn:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.answer-btn:active { transform: scale(0.98); }

.answer-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
}

.answer-btn:hover .answer-icon {
  border-color: var(--brand);
  color: var(--brand);
}

/* ========== Result ========== */
.result-section {
  padding: var(--s8) 0 var(--s12);
}

.result-card {
  animation: fadeSlideIn 0.4s ease;
}

.result-icon {
  text-align: center;
  margin-bottom: var(--s4);
}

.result-icon svg {
  width: 56px;
  height: 56px;
}

.result-title {
  text-align: center;
  font-size: 1.375rem;
  font-weight: 800;
  margin-bottom: var(--s2);
  letter-spacing: -0.01em;
}

.result-score {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: var(--s6);
}

/* Meter */
.meter-wrap {
  margin-bottom: var(--s8);
}

.meter-bar {
  height: 12px;
  background: linear-gradient(90deg, #34C759 0%, #8BC34A 25%, #FF9500 50%, #FF3B30 75%, #AF1B1B 100%);
  border-radius: 6px;
  position: relative;
  margin-bottom: var(--s2);
}

.meter-pointer {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: left 0.8s ease;
  box-shadow: 0 0 0 2px var(--bg-white);
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* Description */
.result-desc {
  background: var(--bg);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s6);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Advice */
.result-advice {
  margin-bottom: var(--s6);
}

.result-advice h3, .result-detail h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s4);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--border-light);
}

.result-advice ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.result-advice li {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.result-advice li::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M8.5 13.3L5.7 10.5l1-1L8.5 11.3l4.8-4.8 1 1L8.5 13.3z'/%3E%3C/svg%3E");
}

/* Category Scores */
.result-detail {
  margin-bottom: var(--s8);
}

.cat-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.cat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  min-width: 88px;
  flex-shrink: 0;
}

.cat-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.cat-bar-fill.safe { background: #34C759; }
.cat-bar-fill.caution { background: #FF9500; }
.cat-bar-fill.warning { background: #FF3B30; }
.cat-bar-fill.danger { background: #AF1B1B; }

.cat-level {
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 36px;
  text-align: center;
  padding: 2px var(--s2);
  border-radius: var(--r-sm);
}

.cat-level.safe { background: #E8F7EC; color: #1B7A33; }
.cat-level.caution { background: #FFF3E0; color: #C65D00; }
.cat-level.warning { background: #FFEBEE; color: #C62828; }
.cat-level.danger { background: #FFEBEE; color: #AF1B1B; }

/* Actions */
.result-actions {
  display: flex;
  gap: var(--s3);
  margin-bottom: var(--s8);
}

.result-actions .btn-secondary,
.result-actions .btn-primary {
  flex: 1;
}

/* CTA */
.cta-box {
  background: var(--brand-light);
  border-radius: var(--r-md);
  padding: var(--s6);
  text-align: center;
}

.cta-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s1);
}

.cta-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--s4);
}

/* Form */
.form-group { margin-bottom: var(--s4); }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: var(--s1); }
.required { color: #FF3B30; font-size: 0.6875rem; }
.form-input, .form-textarea {
  width: 100%; padding: var(--s3) var(--s4);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--font); font-size: 0.9375rem; color: var(--text-primary);
  background: var(--bg); min-height: 44px;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,153,217,0.12); }
.form-textarea { resize: vertical; min-height: 80px; }
.btn-full { width: 100%; }
.inquiry-box { background: var(--bg); border-radius: var(--r-md); padding: var(--s6); margin-bottom: var(--s6); }
.inquiry-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--s2); }
.inquiry-desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: var(--s5); }
.inquiry-success { text-align: center; padding: var(--s8) var(--s4); }
.inquiry-success p { font-size: 0.9375rem; color: #1B7A33; font-weight: 600; line-height: 1.7; }

/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border-light);
  padding: var(--s6) var(--s4);
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
}

.footer-inner img { height: 48px; opacity: 0.5; }

.footer-inner p {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* ========== Responsive ========== */
@media (max-width: 520px) {
  .hero-title { font-size: 1.5rem; }
  .card { padding: var(--s6); }
  .result-actions { flex-direction: column; }
  .cat-label { min-width: 72px; font-size: 0.75rem; }
}
