/* MQ jira card */
/* style.css — modern light UI, Inter font, icon-scale Likert, single-row desktop */

:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-accent: #4f46e5;
  --color-accent-light: #818cf8;
  --color-n: #8b5cf6;
  --color-e: #10b981;
  --color-o: #f59e0b;
  --color-a: #f43f5e;
  --color-c: #3b82f6;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: 2rem;
}

.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

/* ─── Screens ─── */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Intro ─── */
.intro-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 0.5rem;
}

.intro-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--color-muted);
  font-size: 1rem;
  font-weight: 500;
}

.intro-content {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.intro-content p {
  margin-bottom: 1.1rem;
  font-size: 1rem;
  color: #374151;
}

.feature-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.feature-list li {
  padding: 0.4rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: #374151;
  font-size: 0.95rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.disclaimer-box {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.88rem;
  color: #3730a3;
  line-height: 1.5;
}

.disclaimer-box strong {
  color: var(--color-accent);
}

.btn-large {
  width: 100%;
  padding: 1.05rem;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
}

/* ─── Buttons ─── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  min-height: 44px;
  padding: 0.7rem 1.3rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  background: #a5b4fc;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Quiz ─── */
.quiz-top {
  margin-bottom: 1rem;
}

.progress-area {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#progress-text {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 72px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent));
  border-radius: 999px;
  width: 0%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Likert — mobile stacked with icon+label */
.likert-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.likert-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #374151;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 52px;
}

.likert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
  background: #f3f4f6;
  transition: background 0.15s, transform 0.15s;
}

.likert-btn:hover {
  border-color: var(--color-accent-light);
  background: #f9fafb;
}

.likert-btn.selected {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #312e81;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  font-weight: 600;
}

.likert-btn.selected .likert-icon {
  background: var(--color-accent);
  color: #fff;
  transform: scale(1.1);
}

.quiz-nav {
  display: flex;
  gap: 0.75rem;
}

.quiz-nav button {
  flex: 1;
}

/* ─── Results ─── */
.results-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.results-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.radar-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

#radar-chart {
  max-width: 100%;
  max-height: 340px;
}

/* Domain bars */
.domain-bars {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.domain-bar-row {
  margin-bottom: 1.5rem;
}

.domain-bar-row:last-child {
  margin-bottom: 0;
}

.domain-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.domain-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  margin-right: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.domain-name {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
}

.domain-score {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.domain-bar-track {
  height: 14px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.domain-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.domain-n { background: var(--color-n); }
.domain-e { background: var(--color-e); }
.domain-o { background: var(--color-o); }
.domain-a { background: var(--color-a); }
.domain-c { background: var(--color-c); }

.domain-desc {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.45;
}

/* Facet breakdown */
.facet-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.domain-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.domain-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px solid #f3f4f6;
}

.domain-section-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.domain-section-score {
  font-weight: 700;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.facet-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.facet-row {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #f3f4f6;
}

.facet-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.facet-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.facet-code {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  background: #f3f4f6;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  color: #6b7280;
  font-weight: 600;
}

.facet-name {
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
  margin-left: 0.4rem;
  color: #374151;
}

.facet-score {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.88rem;
  margin-left: auto;
}

.facet-bar-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.facet-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.facet-desc {
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.4;
}

/* Personalized insights */
.personalized-insights {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.insights-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.narrative-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #374151;
  margin-bottom: 1.5rem;
}

.narrative-text p + p {
  margin-top: 0.9rem;
  text-indent: 0;
}

.insights-subheading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.combination-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.combo-card {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-accent);
  background: #f8fafc;
  transition: transform 0.15s, box-shadow 0.15s;
}

.combo-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.combo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.combo-text {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.5;
}

.insights-fallback {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.55;
  padding: 0.75rem 0;
}

.hidden {
  display: none !important;
}

/* Results actions */
.results-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  margin-bottom: 2rem;
}

.results-actions button {
  flex: 1;
}

.results-disclaimer {
  margin-top: 1.75rem;
  padding: 1.1rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: #4b5563;
  line-height: 1.5;
}

.citation {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Print-only elements hidden on screen */
.print-header {
  display: none;
}

.print-only {
  display: none;
}

/* ─── Desktop: Likert grid row, larger cards ─── */
@media (min-width: 640px) {
  .app-container {
    padding: 2.5rem 1.5rem;
  }

  .likert-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
  }

  .likert-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    min-height: 96px;
  }

  .likert-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .question-text {
    font-size: 1.5rem;
  }

  .intro-header h1 {
    font-size: 2.1rem;
  }
}

/* ─── Print Styles ─── */
@media print {
  #quiz,
  #intro,
  .btn-retake,
  .btn-print,
  .results-actions,
  .progress-area,
  .progress-track,
  nav {
    display: none !important;
  }

  #results {
    display: block !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.4;
    margin: 0;
    padding: 0;
  }

  .app-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ccc;
  }

  .print-header h1 {
    font-size: 16pt;
    margin-bottom: 0.25rem;
  }

  .print-header p {
    font-size: 10pt;
    color: #555;
  }

  #radar-chart {
    display: none !important;
  }

  .print-only {
    display: block !important;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
    max-height: 280px;
  }

  .domain-bars,
  .domain-section,
  .results-disclaimer,
  .radar-wrapper {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .domain-section {
    break-before: auto;
  }

  .domain-bar-row,
  .facet-row {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .personalized-insights {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    page-break-inside: avoid;
    break-inside: avoid;
    break-before: auto;
  }

  .narrative-text {
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .narrative-text p {
    page-break-inside: avoid;
    break-inside: avoid;
    orphans: 3;
    widows: 3;
    margin-bottom: 0.6rem;
  }

  .insights-subheading {
    color: #000 !important;
    font-size: 11pt;
    margin-bottom: 0.75rem;
    page-break-after: avoid;
    break-after: avoid;
  }

  .combo-card {
    border-left: 3px solid #666 !important;
    background: #f9f9f9 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .combo-title {
    color: #333 !important;
  }

  .combo-text {
    color: #333 !important;
  }

  .insights-fallback {
    color: #333 !important;
  }

  .domain-bar-fill,
  .facet-bar-fill {
    background: #666 !important;
  }

  .domain-n,
  .domain-e,
  .domain-o,
  .domain-a,
  .domain-c {
    background: #888 !important;
  }

  .domain-bar-track,
  .facet-bar-track {
    background: #eee !important;
    border: 1px solid #ccc;
  }

  .facet-code {
    background: #f5f5f5 !important;
    border: 1px solid #ddd;
  }

  .results-header {
    display: none;
  }

  .results-disclaimer {
    font-size: 9pt;
    color: #333;
  }

  .citation {
    color: #555;
  }
}