/* QSCND 評価シート — 臨床・タブレット向け（システムフォントのみ） */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f4f6f8;
  padding-bottom: 8rem;
}

.page-header {
  background-color: #2c5282;
  color: #fff;
  padding: 1.25rem 1rem 1.5rem;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}

.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.92;
}

.page-main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.load-error {
  background-color: #fed7d7;
  border: 1px solid #c53030;
  color: #742a2a;
  padding: 1rem 1.25rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.section-heading {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d3748;
}

.meta-section {
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.meta-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 36rem) {
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .meta-grid .field:last-child {
    grid-column: 1 / -1;
  }
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.field input[type="text"],
.field input[type="date"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #a0aec0;
  border-radius: 0.375rem;
  background: #fff;
}

.field input:focus {
  outline: 2px solid #3182ce;
  outline-offset: 2px;
  border-color: #3182ce;
}

.questions-section {
  margin-bottom: 1rem;
}

.step-text {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c5282;
}

.advance-hint {
  margin: 0.55rem 0 0.75rem;
  font-size: 0.9rem;
  color: #4a5568;
}

.progress-track {
  height: 0.45rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2b6cb0, #2c5282);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.questions-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-nav {
  margin-top: 0.75rem;
}

.btn-inline {
  width: auto;
  min-width: 8rem;
}

.question-fieldset {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  background: #fff;
}

.question-legend {
  font-weight: 600;
  font-size: 1rem;
  padding: 0 0.25rem;
  line-height: 1.45;
}

.question-legend .reverse-mark {
  color: #c05621;
  font-weight: 700;
}

.choice-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-item {
  margin: 0;
}

.choice-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  background: #f7fafc;
  font-size: 1.05rem;
}

.choice-label:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.choice-label:has(input:focus-visible) {
  outline: 2px solid #3182ce;
  outline-offset: 2px;
}

.choice-label input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2c5282;
}

.choice-label {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.choice-label.is-chosen,
.choice-label.is-chosen:hover {
  background: #2c5282;
  color: #fff;
  border-color: #1a365d;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(44, 82, 130, 0.28);
}

.choice-label.is-chosen input[type="radio"] {
  accent-color: #fff;
}

.question-fieldset.has-answer .choice-label:not(.is-chosen) {
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .choice-label {
    transition: none;
  }
}

.footnote {
  background: #edf2f7;
  border-left: 4px solid #2c5282;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  color: #2d3748;
  border-radius: 0 0.375rem 0.375rem 0;
}

.footnote p {
  margin: 0;
}

.result-panel {
  background: #fff;
  border: 2px solid #38a169;
  border-radius: 0.5rem;
  padding: 1.5rem 1.25rem;
  margin-top: 1rem;
}

.result-message {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #22543d;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #cbd5e0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.sticky-footer-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d3748;
}

.provisional-score {
  margin: 0;
  font-size: 0.95rem;
  color: #2c5282;
}

.form-error {
  margin: 0;
  font-size: 0.9rem;
  color: #c53030;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.625rem 1.25rem;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  width: 100%;
}

.btn:focus-visible {
  outline: 2px solid #3182ce;
  outline-offset: 2px;
}

.btn-primary {
  background: #2c5282;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #2a4365;
}

.btn-primary:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.btn-secondary {
  background: #edf2f7;
  color: #2d3748;
  border: 1px solid #cbd5e0;
}

.btn-secondary:hover {
  background: #e2e8f0;
}
