/* Quick Test Maturity Assessment — aligned with Quality Maturity Coach tokens */

:root {
  --nav-bg: #0f172a;
  --nav-text: #cbd5e1;
  --nav-active: #38bdf8;
  --content-bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0369a1;
  --accent-hover: #075985;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --radius: 10px;
  --content-max: 1120px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--content-bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid #1e293b;
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.top-bar-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #0284c7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.top-bar-title {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.top-bar-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
}

.top-bar-home {
  color: #bae6fd;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.top-bar-home:hover {
  background: #1e293b;
  color: #fff;
}

.page-canvas {
  flex: 1;
  background: var(--content-bg);
  padding: 1.5rem 1.25rem 2.5rem;
}

.main-content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.container {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  padding: 2rem 2.25rem;
  min-height: auto;
  display: block;
}

/* Screen Management */
.screen {
  display: none;
  width: 100%;
  max-width: none;
  animation: fadeIn 0.35s ease-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-content {
  background: transparent;
  text-align: center;
}

.title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.25;
  background: none;
  -webkit-text-fill-color: unset;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}

.path-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.5rem 0 1.75rem;
  text-align: left;
}

.path-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  background: var(--content-bg);
}

.path-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--text);
}

.path-card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.path-card .path-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.path-card .path-btn:hover {
  background: var(--accent-hover);
}

.path-card.path-card--alt {
  background: var(--card-bg);
  border-color: var(--accent);
}

.path-card.path-card--alt .path-btn {
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.path-card.path-card--alt .path-btn:hover {
  background: #e0f2fe;
}

.quick-form-hint {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.assessment-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.info-card {
  background: var(--content-bg);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  box-shadow: none;
}

.info-card h3 {
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 0.4rem 0;
  color: #475569;
  font-size: 0.9rem;
  position: relative;
  padding-left: 1.15rem;
}

.info-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.info-card li strong {
  color: var(--text);
}

.maturity-levels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.level {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.level span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  margin-right: 0.65rem;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

.level-1 {
  background: #fef2f2;
  color: var(--danger);
}
.level-2 {
  background: #fff7ed;
  color: var(--warning);
}
.level-3 {
  background: #fefce8;
  color: #a16207;
}
.level-4 {
  background: #e0f2fe;
  color: var(--accent);
}
.level-5 {
  background: #f0fdf4;
  color: var(--success);
}

.team-input {
  background: var(--content-bg);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  text-align: left;
}

.input-group {
  margin-bottom: 1rem;
  text-align: left;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}

.input-group input,
.input-group select,
input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  height: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group input:focus,
.input-group select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
}

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

.form-actions--after-nav {
  margin-top: 1.25rem;
}

.start-btn,
button.start-btn,
.action-btn,
button.action-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-family: inherit;
  box-shadow: none;
}

.start-btn:hover,
.action-btn:hover {
  background: var(--accent-hover);
  transform: none;
  box-shadow: none;
}

.action-btn.secondary {
  background: #475569;
}

.action-btn.secondary:hover {
  background: #334155;
}

.action-btn.danger {
  background: var(--danger);
}

.action-btn.danger:hover {
  background: #991b1b;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  line-height: 1.25;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--card-bg);
  font-family: inherit;
  transition: background-color 0.15s;
  box-sizing: border-box;
}

.back-home-btn:hover {
  background: #e0f2fe;
  transform: none;
  box-shadow: none;
}

.back-home-arrow {
  font-size: 0.88em;
  line-height: 1;
}

/* Assessment Screen */
.progress-container {
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: none;
  backdrop-filter: none;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.category-progress {
  color: var(--accent);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.35s ease;
  width: 0%;
}

.question-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: none;
  backdrop-filter: none;
}

#question-text {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.4;
}

.question-description {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-style: normal;
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.answer-option {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
  overflow: hidden;
}

.answer-option:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: none;
  box-shadow: none;
}

.answer-option.selected {
  background: #e0f2fe;
  border-color: var(--accent);
  color: var(--text);
}

.answer-option .answer-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}

.answer-option .answer-description {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.answer-option.selected .answer-description {
  color: #475569;
}

.answer-option .score-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--content-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.answer-option.selected .score-badge {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-btn {
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  font-family: inherit;
}

.nav-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-btn.primary:hover {
  background: var(--accent-hover);
  transform: none;
  box-shadow: none;
}

/* Results Screen */
.results-content,
.assessor-content {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.results-content h1 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.65rem;
  color: var(--text);
  font-weight: 700;
}

.overall-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.25);
}

.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-size: 0.85rem;
  opacity: 0.95;
  margin-top: 0.25rem;
}

.maturity-level {
  flex: 1;
  text-align: left;
}

.maturity-level h3 {
  font-size: 1.45rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.maturity-level p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.45;
}

.category-scores,
.recommendations {
  margin-bottom: 1.75rem;
}

.category-scores h3,
.recommendations h3,
.assessments-table h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 1rem;
  font-weight: 600;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.category-score {
  background: var(--content-bg);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.category-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.category-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.category-level {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: normal;
}

.recommendations-content {
  background: var(--content-bg);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
}

.priority-section {
  margin-bottom: 1.15rem;
}

.priority-section:last-child {
  margin-bottom: 0;
}

.priority-section h4 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.recommendation-list {
  list-style: none;
  padding: 0;
}

.recommendation-list li {
  padding: 0.35rem 0 0.35rem 1.1rem;
  color: #475569;
  font-size: 0.9rem;
  position: relative;
}

.recommendation-list li::before {
  content: "●";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.actions,
.dashboard-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.screen-header h2 {
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 600;
}

.close-btn {
  background: var(--danger);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background-color 0.15s;
}

.close-btn:hover {
  background: #991b1b;
  transform: none;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--content-bg);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.stat-card h4 {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.stat-value {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.assessments-table {
  margin-bottom: 1.25rem;
}

.table-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  background: var(--content-bg);
  color: var(--text);
  font-weight: 600;
}

tbody tr:hover {
  background: #f8fafc;
}

#results-screen {
  color: var(--text);
}

#results-screen .score-circle .score-value,
#results-screen .score-circle .score-label {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

@media (max-width: 700px) {
  .path-chooser {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-canvas {
    padding: 1rem 0.75rem 1.5rem;
  }

  .container {
    padding: 1.25rem 1rem;
  }

  .top-bar {
    padding: 0.75rem 1rem;
  }

  .top-bar-title {
    font-size: 0.85rem;
  }

  .title {
    font-size: 1.45rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .assessment-info {
    grid-template-columns: 1fr;
  }

  .overall-score {
    flex-direction: column;
    text-align: center;
  }

  .maturity-level {
    text-align: center;
  }

  .scores-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions,
  .dashboard-actions {
    flex-direction: column;
  }

  .progress-info {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
  }

  .form-actions .start-btn,
  .form-actions .back-home-btn,
  .actions .action-btn,
  .actions .back-home-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .table-container {
    overflow-x: auto;
  }

  table {
    min-width: 600px;
  }
}
