/* ==========================================================================
   DogSlim - BCS診断ページ CSS
   ========================================================================== */

/* --- Astra 2カラムレイアウトの干渉を除去 --- */
body.dogslim-bcs-layout .ast-container,
body.dogslim-home-layout .ast-container {
  display: block !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
  width: 100% !important;
}

body.dogslim-bcs-layout #content,
body.dogslim-home-layout #content {
  padding: 0 !important;
}

body.dogslim-bcs-layout #primary,
body.dogslim-home-layout #primary {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

body.dogslim-bcs-layout #dogslim-bcs-wrap {
  display: block;
  width: 100%;
  background-color: #FAFAF7;
  min-height: 60vh;
  padding: 0;
  margin: 0;
}

/* Astraのページタイトル/ヘッダー領域を非表示 */
body.dogslim-bcs-layout .ast-archive-description,
body.dogslim-bcs-layout .entry-header,
body.dogslim-bcs-layout .entry-title,
body.dogslim-home-layout .ast-archive-description,
body.dogslim-home-layout .entry-header,
body.dogslim-home-layout .entry-title {
  display: none !important;
}

/* .entry-content の通常ページ用 max-width を解除 */
body.dogslim-bcs-layout .entry-content,
body.dogslim-home-layout .entry-content {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --- App Container --- */
.bcs-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
  color: #1A1A1A;
  line-height: 1.8;
  background-color: #FAFAF7;
  box-sizing: border-box;
}

.bcs-app *,
.bcs-app *::before,
.bcs-app *::after {
  box-sizing: border-box;
}

/* hidden属性を確実に効かせる（display: inline-block等を上書き） */
.bcs-app [hidden],
.bcs-app *[hidden] {
  display: none !important;
}

/* フォームグループとラベルを確実に全幅で表示 */
.bcs-app .bcs-form-group {
  display: block;
  width: 100%;
  clear: both;
}

.bcs-app .bcs-label {
  display: block;
  width: 100%;
  clear: both;
}

/* upload-area を label 要素として block で全幅表示 */
.bcs-app .upload-area {
  display: block;
  width: 100%;
  clear: both;
}

/* upload-preview は絶対に position relative + inline-block ではなく block で配置 */
.bcs-app .upload-preview {
  display: block;
  width: auto;
  max-width: 200px;
  margin-top: 16px;
  position: relative;
  clear: both;
}

/* Astra の h1-h6 リセットを上書き（ds-additionalの color を .step-header で上書き） */
.bcs-app .step-header h2,
.bcs-app .step-header h3 {
  color: #FFFFFF !important;
  margin: 0 !important;
}

/* フォーム要素に Astra が追加する余計なマージンを除去 */
.bcs-app input,
.bcs-app select,
.bcs-app textarea,
.bcs-app button {
  margin: 0;
}

.bcs-app p {
  margin: 0 0 1em;
}

/* --- Page Title --- */
.bcs-main-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #1A1A1A;
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.45;
  margin: 0 0 12px;
}

.bcs-subtitle {
  text-align: center;
  color: #6B6560;
  font-size: 0.9375rem;
  line-height: 1.85;
  margin: 0 0 48px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Progress Indicator --- */
.bcs-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 48px;
  padding: 0;
}

.bcs-progress-step {
  display: flex;
  align-items: center;
  gap: 0;
}

.bcs-progress-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #E8E4DF;
  background: #FFFFFF;
  color: #6B6560;
  transition: all 0.3s ease;
}

.bcs-progress-step.active .bcs-progress-num {
  background: #1B4332;
  color: #FFFFFF;
  border-color: #1B4332;
}

.bcs-progress-step.completed .bcs-progress-num {
  background: #52B788;
  color: #FFFFFF;
  border-color: #52B788;
}

.bcs-progress-line {
  width: 48px;
  height: 1px;
  background: #E8E4DF;
  margin: 0 8px;
}

.bcs-progress-step.completed + .bcs-progress-step .bcs-progress-line,
.bcs-progress-step.completed .bcs-progress-line {
  background: #52B788;
}

/* --- Step Cards --- */
.bcs-step {
  background: #FFFFFF;
  border: 1px solid #E8E4DF;
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.bcs-step:hover {
  box-shadow: 0 2px 12px rgba(27, 67, 50, 0.05);
}

/* --- Step Header --- */
.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: #1B4332;
  border-bottom: none;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-family: "Noto Serif JP", serif;
  font-size: 0.9375rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.step-header h2,
.step-header h3 {
  font-family: "Noto Serif JP", serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Subtle variant for less prominent steps */
.step-header-subtle {
  background: #F5F2ED;
  border-bottom: 1px solid #E8E4DF;
}

.step-header-subtle .step-num {
  background: #1B4332;
  color: #FFFFFF;
  border: none;
}

.step-header-subtle h2,
.step-header-subtle h3 {
  color: #1A1A1A;
}

/* --- Step Body --- */
.step-body {
  padding: 32px 28px;
}

.step-body p {
  font-size: 0.9375rem;
  color: #6B6560;
  line-height: 1.85;
  margin: 0 0 20px;
}

.step-body p:last-child {
  margin-bottom: 0;
}

/* --- Upload Area --- */
.upload-area {
  border: 1px dashed #D4A574;
  border-radius: 4px;
  padding: 48px 24px;
  text-align: center;
  background: #FAFAF7;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.upload-area:hover {
  border-color: #B8860B;
  background: #F5F2ED;
}

.upload-area.drag-over {
  border-color: #2D6A4F;
  background: rgba(82, 183, 136, 0.05);
}

.upload-icon {
  font-size: 2rem;
  color: #D4A574;
  margin-bottom: 12px;
  display: block;
}

.upload-area p {
  font-size: 0.9375rem;
  color: #6B6560;
  margin: 0 0 8px;
}

.upload-area .upload-hint {
  font-size: 0.8125rem;
  color: #A09A94;
}

.upload-area .upload-btn-inline {
  color: #2D6A4F;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid rgba(45, 106, 79, 0.3);
  transition: border-color 0.2s ease;
}

.upload-area .upload-btn-inline:hover {
  border-bottom-color: #2D6A4F;
}

/* Image Preview（hidden属性が効くように block に） */
.upload-preview {
  margin-top: 16px;
  position: relative;
  display: block;
  width: auto;
  max-width: 200px;
}

.upload-preview img {
  max-width: 200px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #E8E4DF;
}

.upload-preview .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1A1A1A;
  color: #FFFFFF;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

/* --- Form Elements --- */
.bcs-form-group {
  margin-bottom: 24px;
}

.bcs-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.bcs-label-hint {
  font-weight: 400;
  color: #6B6560;
  font-size: 0.8125rem;
  margin-left: 4px;
}

.bcs-required {
  color: #C0392B;
  font-size: 0.75rem;
  margin-left: 2px;
}

.bcs-input,
.bcs-select,
.bcs-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E8E4DF;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #1A1A1A;
  background: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.6;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.bcs-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='%236B6560' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 52px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Safariなど一部ブラウザで選択中テキストが右端にはみ出る問題への保険 */
.bcs-select option {
  font-size: 0.9375rem;
  padding: 8px 12px;
}

.bcs-input:focus,
.bcs-select:focus,
.bcs-textarea:focus {
  border-color: #2D6A4F;
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.08);
}

.bcs-input::placeholder,
.bcs-textarea::placeholder {
  color: #B8B3AD;
}

.bcs-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Input with unit */
.bcs-input-group {
  display: flex;
  align-items: stretch;
}

.bcs-input-group .bcs-input {
  border-radius: 4px 0 0 4px;
  border-right: none;
}

.bcs-input-unit {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: #F5F2ED;
  border: 1px solid #E8E4DF;
  border-radius: 0 4px 4px 0;
  color: #6B6560;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* --- Radio Cards (Activity Level, etc.) --- */
.activity-cards,
.radio-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 8px 0;
}

.activity-card,
.radio-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.activity-card input[type="radio"],
.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.activity-card .card-content,
.radio-card .card-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: #FFFFFF;
  border: 1px solid #E8E4DF;
  border-radius: 4px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.activity-card input[type="radio"]:checked + .card-content,
.radio-card input[type="radio"]:checked + .card-content {
  border-color: #2D6A4F;
  background: rgba(82, 183, 136, 0.04);
}

.activity-card .card-content:hover,
.radio-card .card-content:hover {
  border-color: #D4A574;
}

.card-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #E8E4DF;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.2s ease;
}

.activity-card input[type="radio"]:checked + .card-content .card-radio-dot,
.radio-card input[type="radio"]:checked + .card-content .card-radio-dot {
  border-color: #2D6A4F;
}

.activity-card input[type="radio"]:checked + .card-content .card-radio-dot::after,
.radio-card input[type="radio"]:checked + .card-content .card-radio-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2D6A4F;
}

.card-text h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 4px;
}

.card-text p {
  font-size: 0.8125rem;
  color: #6B6560;
  margin: 0;
  line-height: 1.7;
}

/* --- Checkbox Style --- */
.bcs-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}

.bcs-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1.5px solid #E8E4DF;
  border-radius: 3px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: #2D6A4F;
}

.bcs-checkbox span {
  font-size: 0.9375rem;
  color: #1A1A1A;
  line-height: 1.7;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  padding: 16px 40px;
  background-color: #1B4332;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease;
  text-align: center;
  text-decoration: none;
  line-height: 1.5;
}

.btn-primary:hover {
  background-color: #15372A;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background-color: #B8B3AD;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: #1B4332;
  border: 1px solid #1B4332;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
  text-align: center;
  text-decoration: none;
  line-height: 1.5;
}

.btn-secondary:hover {
  background-color: #1B4332;
  color: #FFFFFF;
}

.btn-accent {
  display: inline-block;
  padding: 16px 40px;
  background-color: #D4A574;
  color: #1A1A1A;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease;
  text-align: center;
  text-decoration: none;
  line-height: 1.5;
}

.btn-accent:hover {
  background-color: #C8955F;
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* --- Result Card --- */
.result-card {
  background: #FFFFFF;
  border: 1px solid #E8E4DF;
  border-radius: 4px;
  overflow: hidden;
  margin: 32px 0;
}

.result-header {
  padding: 24px 28px;
  background: #1B4332;
  text-align: center;
}

.result-header h2 {
  font-family: "Noto Serif JP", serif;
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.result-header p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  margin: 0;
}

.result-body {
  padding: 32px 28px;
}

/* BCS Score Display */
.result-score {
  text-align: center;
  padding: 28px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid #E8E4DF;
}

.result-score-label {
  font-size: 0.8125rem;
  color: #6B6560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.result-score-value {
  font-family: "Noto Serif JP", serif;
  font-size: 3rem;
  font-weight: 700;
  color: #1B4332;
  line-height: 1.1;
  margin: 0 0 6px;
}

.result-score-desc {
  font-size: 0.9375rem;
  color: #2D6A4F;
  font-weight: 500;
}

/* Score status colors */
.result-score-value.score-ideal {
  color: #2D6A4F;
}

.result-score-value.score-over {
  color: #B8860B;
}

.result-score-value.score-obese {
  color: #C0392B;
}

.result-score-value.score-under {
  color: #6B6560;
}

/* Result details */
.result-detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid #F5F2ED;
  font-size: 0.9375rem;
}

.result-detail:last-child {
  border-bottom: none;
}

.result-detail-label {
  color: #6B6560;
  flex-shrink: 0;
}

.result-detail-value {
  color: #1A1A1A;
  font-weight: 500;
  text-align: right;
}

/* Result recommendation */
.result-recommendation {
  margin-top: 28px;
  padding: 24px;
  background: #FAFAF7;
  border-radius: 4px;
  border-left: 3px solid #D4A574;
}

.result-recommendation h3 {
  font-family: "Noto Serif JP", serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 12px;
}

.result-recommendation p {
  font-size: 0.9375rem;
  color: #6B6560;
  line-height: 1.85;
  margin: 0;
}

.result-recommendation ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.result-recommendation li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 0.875rem;
  color: #1A1A1A;
  line-height: 1.8;
}

.result-recommendation li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #D4A574;
}

/* Result actions */
.result-actions {
  margin-top: 32px;
  text-align: center;
}

/* --- BCS Visual Scale --- */
.bcs-scale {
  display: flex;
  gap: 4px;
  margin: 16px 0 24px;
}

.bcs-scale-item {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #E8E4DF;
  transition: background-color 0.3s ease;
}

.bcs-scale-item.active {
  background: #2D6A4F;
}

.bcs-scale-item.warning {
  background: #B8860B;
}

.bcs-scale-item.danger {
  background: #C0392B;
}

/* --- Info Box --- */
.bcs-info {
  padding: 20px 24px;
  background: #F5F2ED;
  border-radius: 4px;
  border: 1px solid #E8E4DF;
  margin: 20px 0;
  font-size: 0.875rem;
  color: #6B6560;
  line-height: 1.8;
}

.bcs-info strong {
  color: #1A1A1A;
}

/* --- Disclaimer / Note --- */
.bcs-disclaimer {
  margin-top: 48px;
  padding: 20px 24px;
  background: #FAFAF7;
  border: 1px solid #E8E4DF;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: #6B6560;
  line-height: 1.85;
}

.bcs-disclaimer::before {
  content: "※";
  color: #B8860B;
  margin-right: 4px;
}

/* --- Loading State --- */
.bcs-loading {
  text-align: center;
  padding: 48px 24px;
}

.bcs-loading-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid #E8E4DF;
  border-top: 2px solid #2D6A4F;
  border-radius: 50%;
  animation: bcs-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes bcs-spin {
  to { transform: rotate(360deg); }
}

.bcs-loading p {
  font-size: 0.9375rem;
  color: #6B6560;
}

/* --- Error State --- */
.bcs-error {
  padding: 20px 24px;
  background: rgba(192, 57, 43, 0.04);
  border: 1px solid rgba(192, 57, 43, 0.15);
  border-radius: 4px;
  color: #8B2E1F;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .bcs-app {
    padding: 32px 16px 60px;
  }

  .bcs-main-title {
    font-size: 1.5rem;
  }

  .bcs-subtitle {
    font-size: 0.875rem;
    margin-bottom: 36px;
  }

  .step-header {
    padding: 16px 20px;
  }

  .step-body {
    padding: 24px 20px;
  }

  .step-header h2,
  .step-header h3 {
    font-size: 1rem;
  }

  .upload-area {
    padding: 36px 16px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-accent {
    padding: 14px 24px;
    font-size: 0.875rem;
    width: 100%;
  }

  .btn-group {
    flex-direction: column;
  }

  .activity-cards,
  .radio-cards {
    grid-template-columns: 1fr;
  }

  .result-body {
    padding: 24px 20px;
  }

  .result-header {
    padding: 20px;
  }

  .result-score-value {
    font-size: 2.5rem;
  }

  .result-detail {
    flex-direction: column;
    gap: 2px;
  }

  .result-detail-value {
    text-align: left;
  }

  .bcs-progress-line {
    width: 24px;
  }
}

@media (max-width: 480px) {
  .bcs-app {
    padding: 24px 12px 48px;
  }

  .step-header {
    padding: 14px 16px;
    gap: 12px;
  }

  .step-body {
    padding: 20px 16px;
  }

  .step-num {
    width: 30px;
    height: 30px;
    font-size: 0.8125rem;
  }

  .result-recommendation {
    padding: 20px 16px;
  }

  .bcs-progress {
    margin-bottom: 32px;
  }

  .bcs-progress-num {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .bcs-progress-line {
    width: 16px;
    margin: 0 4px;
  }
}
