/* ============================================
   不用品判定ツール - Apple HIG Design
   ============================================ */

:root {
  --brand: #0099D9;
  --brand-dark: #0077A8;
  --brand-light: #E6F4FB;
  --color-success: #34C759;
  --color-success-light: #E8F7EC;
  --color-success-dark: #1B7A33;
  --color-warning: #FF9500;
  --color-warning-light: #FFF3E0;
  --text-primary: #1C1C1E;
  --text-secondary: #636366;
  --text-tertiary: #AEAEB2;
  --bg: #F2F2F7;
  --bg-white: #FFFFFF;
  --border: #D1D1D6;
  --border-light: #E5E5EA;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", Meiryo, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #FFFFFF; --text-secondary: #AEAEB2; --text-tertiary: #636366;
    --bg: #1C1C1E; --bg-white: #2C2C2E;
    --border: #48484A; --border-light: #38383A;
    --brand-light: #0A2E3D;
    --color-success-light: #0F2E18; --color-warning-light: #2E1F08;
  }
}

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

*, *::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;
}

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

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

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

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

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

/* Intro */
.intro-section { margin-top: var(--s6); }

.intro-card { text-align: center; }

.intro-title {
  font-size: 1.375rem;
  font-weight: 800;
  margin-bottom: var(--s3);
  letter-spacing: -0.02em;
}

.intro-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--s5);
  line-height: 1.7;
}

.intro-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  margin-bottom: var(--s6);
  flex-wrap: wrap;
}

.intro-step {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: var(--bg);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
}

.intro-step-num {
  width: 28px;
  height: 28px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  flex-shrink: 0;
}

.intro-step-text {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
}

.intro-step-text small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.intro-step-arrow {
  color: var(--text-tertiary);
  font-size: 1.25rem;
}

.intro-result-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.intro-result-desc strong {
  color: var(--brand);
  font-weight: 700;
}

.intro-features {
  list-style: none;
  text-align: left;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

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

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

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

/* Step */
.step-section { margin-top: var(--s6); }

.step-label {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--s4);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 800;
  flex-shrink: 0;
}

.btn-back {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  padding: var(--s1) 0;
  margin-bottom: var(--s4);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-back:hover { text-decoration: underline; }

/* Category Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s3);
}

.cat-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--s5) var(--s3);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  -webkit-tap-highlight-color: transparent;
}

.cat-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cat-card .cat-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.cat-card .cat-emoji svg {
  width: 36px;
  height: 36px;
}
.cat-card .cat-name { font-size: 0.875rem; font-weight: 700; }
.cat-card .cat-count { font-size: 0.6875rem; color: var(--text-tertiary); }

/* Item Grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s3);
}

.item-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s3);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  -webkit-tap-highlight-color: transparent;
}

.item-card:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.item-card .item-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
}

.item-card .item-name { font-size: 0.8125rem; font-weight: 600; }

/* Selected Name */
.selected-name {
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: var(--s4);
  padding: var(--s3);
  background: var(--brand-light);
  border-radius: var(--r-md);
}

/* Condition */
.cond-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

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

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

.cond-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.cond-icon svg {
  width: 28px;
  height: 28px;
}

.cond-text { flex: 1; }
.cond-title { font-size: 0.9375rem; font-weight: 700; color: var(--text-primary); }
.cond-desc { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }

/* Result */
.result-section { margin-top: var(--s6); }

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

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

.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);
}

.result-title.sell { color: var(--color-success-dark); }
.result-title.maybe { color: #C65D00; }
.result-title.dispose { color: var(--text-secondary); }

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

/* Judgment Badge */
.result-judgment { text-align: center; margin-bottom: var(--s6); }

.judgment-badge {
  display: inline-block;
  padding: var(--s2) var(--s6);
  border-radius: var(--r-full);
  font-size: 0.9375rem;
  font-weight: 800;
}

.judgment-badge.sell {
  background: var(--color-success-light);
  color: var(--color-success-dark);
  border: 1.5px solid var(--color-success);
}

.judgment-badge.maybe {
  background: var(--color-warning-light);
  color: #C65D00;
  border: 1.5px solid var(--color-warning);
}

.judgment-badge.dispose {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.price-estimate {
  display: block;
  margin-top: var(--s2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-success-dark);
}

/* Methods */
.result-methods { margin-bottom: var(--s6); }

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

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

.method-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  background: var(--bg);
}

.method-rank {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800;
  flex-shrink: 0; margin-top: 1px;
}

.method-content { flex: 1; }
.method-name { font-size: 0.875rem; font-weight: 700; }
.method-desc { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; line-height: 1.5; }

/* Tips */
.result-tips {
  margin-bottom: var(--s4);
  background: var(--brand-light);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
}

.result-tips h3 { border-bottom: none; padding-bottom: 0; margin-bottom: var(--s2); font-size: 0.875rem; color: var(--brand-dark); }
.result-tips p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.7; }

/* Disclaimer */
.result-disclaimer {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--s6);
  line-height: 1.5;
}

/* Actions */
.result-actions { text-align: center; margin-bottom: var(--s8); }

.btn-secondary {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-height: 48px;
  padding: var(--s3) var(--s8);
  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;
}

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

/* 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; margin-bottom: var(--s1); }
.cta-desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: var(--s4); }

.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;
  transition: background 0.2s;
}

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

/* 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-select, .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-select: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;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  align-items: center;
  margin-top: var(--s6);
}

.btn-text {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--s2);
  min-height: 44px;
}

.btn-text:hover { color: var(--brand); text-decoration: underline; }

.btn-full { width: 100%; }

.detail-card { padding: var(--s6); }

/* Result adjust */
.result-adjust {
  background: var(--brand-light);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s6);
}

.result-adjust p {
  font-size: 0.8125rem;
  color: var(--brand-dark);
  line-height: 1.6;
  margin-bottom: var(--s1);
}

.result-adjust p:last-child { margin-bottom: 0; }

/* Inquiry */
.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: var(--color-success-dark);
  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: 640px; 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) {
  .cat-grid, .item-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: var(--s6); }
  .result-title { font-size: 1.2rem; }
}
