/*
 * styles/components.css
 *
 * Next.js移行時の対応表:
 *   .header       → components/Header/Header.module.css
 *   .hero-*       → components/Hero/Hero.module.css
 *   .step-*       → components/StepIndicator/StepIndicator.module.css
 *   .form-*       → components/FormSection/FormSection.module.css
 *   .field        → components/FormField/FormField.module.css
 *   .area-card-*  → components/AreaCard/AreaCard.module.css
 *   .btn-*        → components/Button/Button.module.css
 *   .cta-*        → components/CTA/CTA.module.css
 */
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Header
   components/Header
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; fill: white; }
.logo-text { font-size: 14px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.logo-text span { display: block; font-size: 10px; font-weight: 400; color: var(--color-muted); }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Hero
   components/Hero
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.hero {
  background: var(--color-surface);
  padding: 40px 20px 32px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.hero-badge {
  display: inline-block;
  background: var(--color-secondary-light);
  color: var(--color-secondary-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}
.hero h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero h1 span { color: var(--color-primary); }
.hero p { font-size: 14px; color: var(--color-muted); margin-bottom: 28px; }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   StepIndicator
   components/StepIndicator
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 320px;
  margin: 0 auto;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-muted);
  transition: all 0.3s;
}
.step-num.active { background: var(--color-primary); color: white; }
.step-num.done   { background: var(--color-secondary); color: white; }
.step-label { font-size: 10px; color: var(--color-muted); white-space: nowrap; }
.step-line {
  height: 2px;
  flex: 1;
  background: var(--color-border);
  border-radius: 2px;
  margin-bottom: 14px;
  transition: background 0.3s;
}
.step-line.done { background: var(--color-secondary); }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   FormSection
   components/FormSection
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.form-section {
  background: var(--color-surface);
  margin: 16px;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--color-border);
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--color-primary);
  border-radius: 2px;
}
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   FormField
   components/FormField
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
 
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}
.field label .req { color: var(--color-error); margin-left: 2px; font-size: 12px; }
.field label .opt { color: var(--color-muted); font-size: 11px; font-weight: 400; margin-left: 4px; }
 
.field input[type="text"],
.field input[type="tel"],
.field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,111,212,0.12);
}
.field input.error,
.field select.error {
  border-color: var(--color-error);
  background: var(--color-error-light);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   CheckboxGrid
   components/CheckboxGrid
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--color-text);
  user-select: none;
}
.check-item input[type="checkbox"] { display: none; }
.check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.check-item.checked {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
}
.check-item.checked .check-box { background: var(--color-primary); border-color: var(--color-primary); }
.check-item.checked .check-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Button
   components/Button
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary:active { transform: scale(0.98); background: var(--color-primary-dark); }
.btn-primary:disabled { background: var(--color-border); color: var(--color-muted); cursor: not-allowed; }
 
.btn-line {
  display: flex;
  width: 100%;
  padding: 18px;
  background: var(--color-secondary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-line:active { transform: scale(0.98); background: var(--color-secondary-dark); }
 
.btn-text {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
 
.form-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   AreaCard
   components/AreaCard
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.area-card {
  background: var(--color-surface);
  margin: 12px 16px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.area-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}
.rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-1 { background: #FFF8E1; color: #F9A825; }
.rank-2 { background: var(--color-bg); color: #607D8B; }
.rank-3 { background: #FBE9E7; color: #BF360C; }
.area-name { font-size: 18px; font-weight: 700; }
.area-sub  { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
 
.area-body { padding: 14px 16px; }
.commute-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-secondary-dark);
  background: var(--color-secondary-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 10px;
}
.area-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 20px; font-weight: 500; }
.tag-blue  { background: var(--color-primary-light); color: var(--color-primary); }
.tag-green { background: var(--color-secondary-light); color: var(--color-secondary-dark); }
.tag-gray  { background: var(--color-bg); color: var(--color-muted); }
.area-desc { font-size: 13px; color: var(--color-muted); line-height: 1.7; }
 
.match-bar-wrap { margin-top: 12px; }
.match-label {
  font-size: 11px;
  color: var(--color-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.match-bar { height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; }
.match-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 1s ease;
}
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   ResultHeader
   pages/ResultPage (上部見出し)
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.result-header {
  background: var(--color-surface);
  padding: 28px 20px 24px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.result-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.result-header p  { font-size: 13px; color: var(--color-muted); }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   CTA
   components/CTA
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.cta-section {
  margin: 20px 16px 8px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--color-border);
  text-align: center;
}
.cta-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.cta-section p  { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; }
.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--color-muted);
  padding: 16px 20px 32px;
  line-height: 1.6;
}
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Loading
   components/LoadingScreen
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.loading-screen { text-align: center; padding: 80px 20px; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--color-muted); }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Toast
   components/Toast
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1A202C;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 13px;
  white-space: nowrap;
  transition: transform 0.3s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
 
/* ━━━━━━━━━━━━━━━━━━━━━━━
   Page screen switching
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.screen { display: none; }
.screen.active { display: block; }
.bottom-spacer { height: 32px; }
