/**
 * Shared styles for Assessment/*.html survey pages.
 * Pairs with pfy-design-system.css + nav-template.js.
 */

body.assessment-page {
  background: var(--pfy-color-bg);
}

body.assessment-page .assessment-wrap {
  padding: 24px 0 48px;
}

body.assessment-page .container.assessment-container {
  max-width: var(--pfy-container-max);
  margin: 0 auto;
  background: var(--pfy-color-surface);
  border-radius: var(--pfy-radius-lg);
  box-shadow: var(--pfy-shadow-card);
  padding: 24px;
  margin-bottom: 40px;
}

/* Sticky confidentiality + instructions bar (below site nav) */
.fixed-header {
  position: sticky;
  top: var(--pfy-nav-height);
  left: 0;
  right: 0;
  background: var(--pfy-color-surface);
  z-index: 90;
  box-shadow: var(--pfy-shadow-header);
}

.confidentiality-banner {
  background: var(--pfy-color-primary);
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.survey-instructions {
  background: #f8faff;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pfy-color-border);
}

.survey-instructions p {
  font-size: 14px;
  color: var(--pfy-color-text-muted);
  line-height: 1.5;
  max-width: var(--pfy-container-max);
  margin: 0 auto;
}

.assessment-page .logo {
  display: none;
}

.survey-header {
  text-align: center;
  margin-bottom: 40px;
}

.survey-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--pfy-color-heading);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.survey-header p {
  font-size: 16px;
  color: var(--pfy-color-text-muted);
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.version-info {
  background: var(--pfy-color-bg);
  padding: 16px;
  border-radius: var(--pfy-radius-sm);
  margin-top: 24px;
  font-size: 14px;
  color: var(--pfy-color-text-muted);
  text-align: center;
}

.progress-bar {
  background: var(--pfy-color-border);
  height: 8px;
  border-radius: var(--pfy-radius-sm);
  margin: 24px 0 16px;
  overflow: hidden;
}

.progress-fill {
  background: var(--pfy-color-primary);
  height: 100%;
  border-radius: var(--pfy-radius-sm);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  color: var(--pfy-color-text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--pfy-radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--pfy-color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--pfy-color-primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--pfy-color-primary);
}

.btn-secondary {
  background: var(--pfy-color-bg);
  color: var(--pfy-color-text);
  border: 1px solid var(--pfy-color-border);
}

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

.page {
  display: none;
}

.page.active {
  display: block;
}

.question-section {
  margin-bottom: 48px;
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-lg);
  overflow: hidden;
  display: none;
}

.question-section.active {
  display: block;
}

.question-header {
  background: var(--pfy-color-bg);
  padding: 24px;
  border-bottom: 2px solid var(--pfy-color-border);
}

.question-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--pfy-color-heading);
  margin-bottom: 12px;
  line-height: 1.5;
}

.question-meta {
  font-size: 14px;
  color: var(--pfy-color-text-muted);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.option-list {
  list-style: none;
  padding: 24px;
  margin: 0;
}

.option-item {
  padding: 16px;
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-sm);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--pfy-color-surface);
}

.option-item:hover {
  background: var(--pfy-color-bg);
  border-color: var(--pfy-color-primary);
}

.option-item.selected {
  background: var(--pfy-color-primary-soft);
  border-color: var(--pfy-color-primary);
  border-width: 2px;
  padding: 15px;
}

.option-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--pfy-color-primary);
  flex-shrink: 0;
}

.option-item label {
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pfy-color-text);
  flex: 1;
}

.survey-grid {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th {
  background: var(--pfy-color-bg);
  color: var(--pfy-color-heading);
  padding: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--pfy-color-border);
}

th:first-child {
  width: 50%;
  text-align: left;
}

th:nth-child(2) {
  width: 50%;
  text-align: left;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--pfy-color-border);
  vertical-align: top;
}

tr:hover {
  background-color: var(--pfy-color-bg);
}

.process-option,
.experience-option {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.process-option {
  border-right: 1px solid var(--pfy-color-border);
}

.process-option input[type="radio"],
.experience-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: var(--pfy-color-primary);
  vertical-align: middle;
  flex-shrink: 0;
}

.process-option label,
.experience-option label {
  cursor: pointer;
  font-weight: 500;
  line-height: 1.4;
}

tr.selected-process .process-option,
.process-option.selected {
  background-color: var(--pfy-color-primary-soft);
}

tr.selected-experience .experience-option,
.experience-option.selected {
  background-color: var(--pfy-color-primary-soft);
}

.process-option input[type="radio"]:disabled,
.experience-option input[type="radio"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.process-option:has(input:disabled),
.experience-option:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.process-option:has(input:disabled) label,
.experience-option:has(input:disabled) label {
  cursor: not-allowed;
  color: #999;
}

.matrix-table th {
  font-size: 14px;
}

.matrix-table th.area-col {
  text-align: left;
  min-width: 200px;
}

.matrix-table td {
  text-align: center;
}

.matrix-table td.area-label {
  text-align: left;
  font-weight: 500;
}

.matrix-table input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pfy-color-primary);
  cursor: pointer;
}

.tool-nickname-input {
  width: 100%;
  max-width: 220px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.topology-pillar-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pfy-color-border);
}

.topology-pillar-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.topology-pillar-row select,
.topology-pillar-row input[type="text"] {
  padding: 8px;
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.topology-connections {
  padding: 16px 24px;
  background: var(--pfy-color-bg);
  border-top: 1px solid var(--pfy-color-border);
}

.topology-edge-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.topology-edge-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.topology-edge-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--pfy-color-surface);
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}

.optional-banner {
  background: var(--pfy-color-primary-soft);
  color: var(--pfy-color-primary-hover);
  padding: 10px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--pfy-color-primary-border);
}

.not-applicable-row {
  border-top: 2px solid var(--pfy-color-border);
}

.not-applicable-cell {
  text-align: center;
  padding: 20px;
  background: var(--pfy-color-bg);
  font-weight: 500;
  color: var(--pfy-color-text-muted);
}

.not-applicable-cell input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: var(--pfy-color-text-muted);
  vertical-align: middle;
}

.not-applicable-cell label {
  cursor: pointer;
  font-weight: 500;
}

.deselect-btn {
  background: var(--pfy-color-danger);
  color: #fff;
  border: none;
  border-radius: var(--pfy-radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 12px;
  display: none;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.deselect-btn:hover {
  background: #c82333;
}

.not-applicable-row:has(input:checked) .deselect-btn {
  display: inline-block;
}

.feedback-section {
  padding: 24px;
  border-top: 1px solid var(--pfy-color-border);
  background-color: var(--pfy-color-bg);
}

.feedback-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--pfy-color-heading);
  margin-bottom: 12px;
}

.feedback-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--pfy-color-border);
  border-radius: var(--pfy-radius-sm);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--pfy-color-primary);
  box-shadow: 0 0 0 3px var(--pfy-color-primary-soft);
}

.feedback-textarea::placeholder {
  color: #999;
  font-style: italic;
}

.score-display {
  background: var(--pfy-color-bg);
  color: var(--pfy-color-heading);
  padding: 16px 24px;
  margin: 0 24px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  display: none;
  border-radius: var(--pfy-radius-sm);
  border: 1px solid var(--pfy-color-border);
}

.score-display.visible {
  display: block;
}

.navigation-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--pfy-color-border);
}

.nav-info {
  color: var(--pfy-color-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.overall-scores {
  background: var(--pfy-color-bg);
  padding: 20px;
  border-radius: var(--pfy-radius-sm);
  margin: 24px 0;
  display: none;
  border: 1px solid var(--pfy-color-border);
}

.overall-scores h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--pfy-color-heading);
  margin-bottom: 16px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.score-item {
  background: var(--pfy-color-surface);
  padding: 12px;
  border-radius: var(--pfy-radius-sm);
  border: 1px solid var(--pfy-color-border);
}

.score-label {
  font-size: 12px;
  color: var(--pfy-color-text-muted);
  margin-bottom: 4px;
}

.score-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--pfy-color-heading);
}

.letter-grade {
  background: var(--pfy-color-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--pfy-radius-sm);
  font-size: 18px;
  font-weight: 700;
  display: inline-block;
}

.export-section {
  text-align: center;
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.export-btn {
  background: var(--pfy-color-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--pfy-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.export-btn:enabled:hover {
  background: var(--pfy-color-primary-hover);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#submitBtn:enabled:hover {
  background: var(--pfy-color-success-hover);
}

.confidentiality-disclaimer {
  background: var(--pfy-color-surface);
  border: 1px solid var(--pfy-color-primary-border);
  border-radius: var(--pfy-radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.confidentiality-disclaimer h2 {
  color: var(--pfy-color-primary);
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.confidentiality-disclaimer p,
.confidentiality-disclaimer ul {
  color: var(--pfy-color-text-subtle);
  margin-bottom: 12px;
  line-height: 1.6;
}

.confidentiality-disclaimer ul {
  margin-left: 24px;
  margin-bottom: 16px;
}

.confidentiality-disclaimer li {
  margin-bottom: 8px;
}

.confidentiality-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.confidentiality-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--pfy-color-primary);
}

.confidentiality-checkbox label {
  font-weight: 600;
  color: var(--pfy-color-text);
  cursor: pointer;
}

.pilot-access-screen {
  background: linear-gradient(to bottom, #f8faff, var(--pfy-color-surface));
  border: 1px solid var(--pfy-color-primary-border);
  border-radius: var(--pfy-radius-lg);
  padding: 40px;
  max-width: 500px;
  margin: 48px auto;
  text-align: center;
  box-shadow: var(--pfy-shadow-card);
}

.pilot-access-screen h2 {
  color: var(--pfy-color-primary);
  margin-bottom: 20px;
  font-size: 24px;
}

.pilot-access-screen p {
  color: var(--pfy-color-text-muted);
  margin-bottom: 30px;
  font-size: 16px;
}

.access-code-input {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  border: 1px solid var(--pfy-color-primary-border);
  border-radius: var(--pfy-radius-sm);
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-family: inherit;
}

.access-code-input:focus {
  outline: none;
  border-color: var(--pfy-color-primary);
  box-shadow: 0 0 0 3px var(--pfy-color-primary-soft);
}

.access-btn {
  background: var(--pfy-color-primary);
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--pfy-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-family: inherit;
}

.access-btn:hover {
  background: var(--pfy-color-primary-hover);
}

.access-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.access-error {
  color: var(--pfy-color-danger);
  margin-top: 15px;
  font-size: 14px;
  display: none;
}

.na-warning {
  background: var(--pfy-color-primary-soft);
  border: 1px solid var(--pfy-color-primary-border);
  border-radius: var(--pfy-radius-sm);
  padding: 16px;
  margin: 24px 0;
  text-align: center;
  color: var(--pfy-color-primary-hover);
  font-weight: 500;
  display: none;
}

.na-warning.visible {
  display: block;
}

@media (max-width: 768px) {
  body.assessment-page .assessment-wrap {
    padding-top: 16px;
  }

  body.assessment-page .container.assessment-container {
    padding: 20px 15px;
  }

  .survey-header h1 {
    font-size: 1.5rem;
  }

  .version-info {
    text-align: center;
  }

  .survey-grid table {
    min-width: unset;
  }

  .survey-grid th,
  .survey-grid td {
    padding: 12px 8px;
    font-size: 0.9rem;
  }

  .process-option,
  .experience-option {
    padding: 12px 15px;
  }

  .process-option label,
  .experience-option label {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .navigation-section {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .fixed-header {
    top: var(--pfy-nav-height);
  }
}
