/* static/css/management_philosophy_tool.css */

/* 経営理念ツールと俯瞰図ツールを1枚のカードとして見せるための共通ラッパー */
.mp-experience-grid {
  position: relative;

  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
  margin: 2rem 0;

  padding: 2.5rem;
  background: linear-gradient(180deg, #eef4ff 0%, #fbfcff 100%);
  border: 0.0625rem solid #d3e2fa;
  border-radius: 1.5rem;
  box-shadow: 0 0.75rem 2.5rem rgba(0,0,0,0.08);
}

.mp-experience-grid .mp-panel,
.mp-experience-grid .mpd-panel {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* 経営理念セクションと俯瞰図セクションの区切り（狭い画面では上下、広い画面では左右） */
.mp-experience-grid .mpd-panel {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 0.0625rem dashed #c7d9f7;
}

/* PCなど横幅に余裕がある画面では、経営理念と俯瞰図を左右2カラムで表示する */
@media (min-width: 64rem) {

  .mp-experience-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3.5rem;
  }

  .mp-experience-grid .mpd-panel {
    margin-top: 0;
    padding-top: 0;
    padding-left: 1.5rem;
    border-top: none;
    border-left: 0.0625rem dashed #c7d9f7;
  }

}

@media (max-width: 48rem) {

  .mp-experience-grid .mpd-panel {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
  }

}

.mp-panel {
  margin: 2rem 0;
  padding: 2.5rem;
  background: linear-gradient(180deg, #eef4ff 0%, #fbfcff 100%);
  border: 0.0625rem solid #d3e2fa;
  border-radius: 1.5rem;
  box-shadow: 0 0.75rem 2.5rem rgba(0,0,0,0.08);
}

.mp-lead-box {
  text-align: center;
  margin: 0 0 2rem;
}

.mp-lead-box .mp-lead-box__label {
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;

  display: inline-block;
  width: fit-content;
  padding: 0.6rem 2rem;

  border-radius: 999rem;

  background: #0175d8;
  color: #ffffff;

  font-size: 1.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;

  box-shadow: 0 0 0 0 rgba(1, 117, 216, 0.45);
  animation: ndg-badge-pulse 2.2s ease-out infinite;
}

@keyframes ndg-badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(1, 117, 216, 0.45); }
  70% { box-shadow: 0 0 0 0.55rem rgba(1, 117, 216, 0); }
  100% { box-shadow: 0 0 0 0 rgba(1, 117, 216, 0); }
}

.mp-lead-box .mp-lead-box__sub {
  display: block;
  width: fit-content;
  margin: 0 auto 0.85rem;
  text-align: center;
}

.mp-lead-box p {
  margin: 0;
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.9;
  text-align: center;
}

.mp-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: row dense;
  gap: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.mp-quick-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mp-quick-field--wide {
  grid-column: 1 / -1;
}

.mp-quick-field--span2 {
  grid-column: span 2;
}

.mp-quick-field label,
.mp-quick-field__label {
  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 700;
}

.mp-quick-field select,
.mp-quick-field input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: #ffffff;
  border: 0.0625rem solid #dce6f5;
  border-radius: 0.75rem;
  color: #1f2937;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.mp-strength-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mp-strength-input-row {
  display: flex;
  gap: 0.5rem;
}

.mp-strength-input-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}

.mp-strength-add {
  flex: 0 0 auto;
  padding: 0 1.1rem;
  background: #3468e0;
  border: none;
  border-radius: 0.75rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mp-strength-add:hover {
  opacity: 0.9;
}

.mp-strength-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mp-strength-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mp-strength-tags:empty {
  display: none;
}

.mp-strength-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  padding: 0.4rem 0.5rem 0.4rem 0.85rem;

  background: #eef4ff;
  border: 0.0625rem solid #b9d7fb;
  border-radius: 999rem;

  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 600;
}

.mp-strength-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 1.25rem;
  height: 1.25rem;

  background: #ffffff;
  border: none;
  border-radius: 999rem;

  color: #3468e0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.mp-strength-tag__remove:hover {
  background: #dce6f5;
}

.mp-strength-count {
  align-self: flex-end;
  font-size: 0.8rem;
  color: #6b7280;
}

.mp-field-note {
  display: block;
  margin-top: -0.15rem;
  color: #6b7280;
  font-size: 0.78rem;
  line-height: 1.5;
}

.mp-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mp-chip {
  position: relative;

  display: inline-flex;
  align-items: center;

  padding: 0.45rem 0.9rem;

  background: #f5f9ff;
  border: 0.0625rem solid #dce6f5;
  border-radius: 999rem;

  color: #1f2937;
  font-size: 0.85rem;
  font-weight: 600;

  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mp-chip input {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  opacity: 0;
  pointer-events: none;
}

.mp-chip:hover {
  border-color: #b9d7fb;
}

.mp-chip.is-checked {
  background: #3468e0;
  border-color: #3468e0;
  color: #ffffff;
}

.mp-chip-hint {
  display: block;
  margin-top: 0.5rem;
  color: #6b7280;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.mp-chip-hint--warn {
  color: #b91c1c;
  font-weight: 700;
}

.mp-button-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.mp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20rem;
  padding: 0.95rem 1.8rem;
  border: none;
  border-radius: 999rem;
  background: #3468e0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 0.625rem 1.125rem rgba(52, 104, 224, 0.25);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mp-button:hover {
  transform: translateY(-0.0625rem);
  opacity: 0.98;
}

.mp-button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.mp-notice {
  margin: 1rem 0 0;
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.7;
  text-align: center;
}

.mp-result {
  position: relative;

  margin-top: 2.5rem;
  padding: 2rem 1.5rem 1.5rem;

  background: #ffffff;
  border: 0.125rem dashed #a9c3f5;
  border-radius: 1.35rem;
  box-shadow: 0 0.5rem 1.25rem rgba(30, 41, 59, 0.05);
}

.mp-result__badge {
  position: absolute;
  top: -0.85rem;
  left: 1.5rem;

  display: inline-flex;
  align-items: center;
  gap: 0.35rem;

  padding: 0.3rem 0.85rem;

  background: #3468e0;
  color: #ffffff;

  border-radius: 999rem;

  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;

  box-shadow: 0 0.25rem 0.625rem rgba(52, 104, 224, 0.3);
}

.mp-statement-list {
  display: grid;
  gap: 1rem;
}

.mp-statement-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  background: #ffffff;
  border: 0.0625rem solid #e7e3d8;
  border-radius: 1rem;
  box-shadow: 0 0.375rem 1.125rem rgba(30, 41, 59, 0.04);
}

.mp-statement-card__no {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #3468e0;
  color: #ffffff;
  font-weight: 700;
}

.mp-statement-card__body {
  flex: 1 1 auto;
}

.mp-statement-card__label {
  display: block;
  margin-bottom: 0.3rem;
  color: #2557c7;
  font-size: 0.8rem;
  font-weight: 700;
}

.mp-statement-card__text {
  margin: 0;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.7;
}

.mp-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.mp-restart {
  display: block;
  margin: 0;
  padding: 0.6rem 1.4rem;
  background: transparent;
  border: 0.0625rem solid #3468e0;
  border-radius: 999rem;
  color: #3468e0;
  font-weight: 700;
  cursor: pointer;
}

.mp-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.6rem 1.4rem;
  background: #3468e0;
  border: 0.0625rem solid #3468e0;
  border-radius: 999rem;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mp-print-btn:hover {
  opacity: 0.9;
}

.mp-error {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border: 0.0625rem solid #fecaca;
  border-radius: 0.75rem;
  color: #b91c1c;
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 48rem) {

  .mp-experience-grid {
    padding: 1.25rem;
  }

  .mp-lead-box {
    padding-top: 0;
  }

  .mp-lead-box .mp-lead-box__label {
    position: static;
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    transform: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    white-space: normal;
    text-align: center;
    box-sizing: border-box;
  }

  .mp-lead-box p {
    font-size: 0.95rem;
    text-align: left;
  }

  .mp-quick-grid {
    grid-template-columns: 1fr;
  }

  .mp-quick-field--span2 {
    grid-column: 1 / -1;
  }

  .mp-button {
    width: 100%;
    min-width: auto;
  }

  .mp-result {
    padding: 1.75rem 1rem 1rem;
  }

}

/* 印刷時は、経営理念・俯瞰図の結果部分だけを紙面いっぱいに表示する */
@media print {

  nav,
  footer,
  .container > *:not(.mp-experience-grid) {
    display: none !important;
  }

  /* A4など縦向き印刷が基準のため、経営理念（上）→俯瞰図（下）の1カラムで積む */
  .mp-experience-grid {
    margin: 0;
    padding: 1rem;
    box-shadow: none;
    border: none;
    grid-template-columns: 1fr;
  }

  #mpForm,
  .mp-notice,
  .mp-result__badge,
  .mp-result-actions,
  .mpd-canvas-wrap__badge,
  .mpd-lead-box p {
    display: none !important;
  }

  .mp-result,
  .mpd-canvas-wrap {
    border-style: solid;
  }

  .mp-experience-grid .mpd-panel {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    padding-left: 0;
    border-top: 0.0625rem dashed #c7d9f7;
    border-left: none;
  }

  /* 1枚のA4に収まるよう、見出し・余白・文字サイズを詰める */
  .mp-lead-box {
    margin-bottom: 0.5rem;
  }

  .mp-lead-box .mp-lead-box__label {
    position: static;
    transform: none;
    display: inline-block;
    padding: 0.25rem 0.9rem;
    margin: 0 auto 0.35rem;
    font-size: 1rem;
    animation: none;
    box-shadow: none;
  }

  .mp-lead-box .mp-lead-box__sub {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .mpd-lead-box {
    margin-bottom: 0.35rem;
  }

  .mpd-lead-box .mpd-lead-box__label {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }

  .mp-result {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
  }

  .mp-statement-list {
    gap: 0.4rem;
  }

  .mp-statement-card {
    padding: 0.5rem 0.65rem;
    gap: 0.5rem;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .mp-statement-card__no {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .mp-statement-card__label {
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
  }

  .mp-statement-card__text {
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .mpd-canvas-wrap {
    padding: 0.6rem;
  }

  .mpd-svg {
    max-width: 15rem;
  }

  .mpd-legend {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.65rem;
    line-height: 1.4;
    break-inside: avoid;
    page-break-inside: avoid;
  }

}
