:root {
  --bg: #f8fafc;
  --card: #fff;
  --border: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #3b82f6;
  --brand2: #2563eb;
  --accent: #10b981;
  --green-light: #dcfce7;
  --green-bg: #f0fdf4;
  --red-light: #fef2f2;
  --red-border: #fca5a5;
  --red-text: #dc2626;

  /* Type scale: xs tags and pills, sm labels, tables and notes, base running text,
     lg section titles, xl the one headline */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.75rem;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(171deg, #f8fafc 0%, #bbc2ca 100%);
  background-attachment: fixed;
  background-size: 100% 100%;
  min-height: 100vh;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  transition: max-width 0.3s ease;
}

/* Results get more room; intro and quiz keep the reading width */
.wrap.wide {
  max-width: 60rem;
}

@media (prefers-reduced-motion: reduce) {
  .wrap {
    transition: none;
  }
}

.card {
  background: var(--card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fafafa 0%, #f4f4f5 100%);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.content {
  padding: 2.5rem 2rem;
}

.intro-section {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.instructions {
  margin-bottom: 3rem;
}

.instructions h2 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 100%;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.instructions p {
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 28rem;
}

.form-grid {
  margin: 2rem 0;
}

.form-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .form-fields {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
}

input[type="text"], input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: var(--text-base);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus, input[type="date"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

#intro input[type="text"] {
  background: transparent;
}

/* Field validation styles */
.field-error {
  border-color: var(--red-text) !important;
  background-color: var(--red-light) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.field-error:focus {
  border-color: var(--red-text) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.field-error-message {
  color: var(--red-text);
  font-size: var(--text-sm);
  margin-top: 0.25rem;
  text-align: left;
  font-weight: 500;
}

.tip {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: var(--text-sm);
  text-align: left;
}

.error {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red-text);
  font-size: var(--text-sm);
  text-align: left;
}

.actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  min-width: 7rem;
  font-size: var(--text-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.primary:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.secondary {
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.secondary:focus {
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.5);
}

.footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: var(--text-sm);
  background: #fafafa;
  border-top: 1px solid var(--border);
}

.chevron {
  padding: 0.75rem;
  min-width: 3rem;
  font-size: var(--text-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.progress {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
  background-size: 300% 100%;
  width: 0;
  transition: width 0.3s ease;
  animation: shimmer 3s infinite;
  border-radius: 9999px;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.qwrap {
  min-height: 14rem;
  position: relative;
  overflow: hidden;
  padding-top: 0.5rem;
}

.qcard {
  background: #fff;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.qtitle {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--ink);
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.nav .primary {
  flex: 1;
}

.nav .chevron {
  flex: 0 0 auto;
  min-width: 3rem;
  width: auto;
}

.quiz-header {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
}

.quiz-progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.quiz-progress-bar {
  flex: 1;
}

.question-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.question-header {
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.question-text {
  padding: 0.75rem 0.5rem;
  font-size: var(--text-sm);
  color: var(--ink);
}

.option-button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: #fff;
  transition: all 0.2s ease;
}

.option-button:hover {
  background: #f8fafc;
  border-color: var(--brand);
}

.option-button.selected {
  background: #eff6ff;
  border-color: var(--brand);
}

.option-circle {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-circle.selected {
  background: var(--brand);
}

.option-circle.selected::after {
  content: '✓';
  color: white;
  font-size: var(--text-xs);
  font-weight: bold;
  position: absolute;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: var(--text-sm);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.score-table th,
.score-table td {
  padding: 0.75rem;
  border: 1px solid var(--border);
  text-align: center;
}

.score-table th:first-child,
.score-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.score-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--ink);
}

/* DISC Summary Styles */
.disc-summary {
  margin: 1.5rem 0;
  line-height: 1.7;
}

.disc-summary h4,
.style-sections h4 {
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  font-size: var(--text-base);
  font-weight: 600;
}

.style-overview {
  margin: 0 0 1rem 0;
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.7;
}

.disc-summary ul,
.style-sections ul {
  margin: 0.75rem 0 0 1.25rem;
  padding: 0;
  list-style-type: disc;
}

.disc-summary li,
.style-sections li {
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.disc-summary li strong,
.style-sections li strong {
  color: var(--ink);
  font-weight: 600;
}

.strengths-section {
  background: #f0f9ff;
  padding: 1.25rem;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border: 1px solid #bfdbfe;
}

.growth-section {
  background: #fefce8;
  padding: 1.25rem;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  border: 1px solid #fde047;
}

/* Results page */
/* Shown only while the PDF is being captured: title and boxed fields for HR */
.pdf-head {
  display: none;
}

#report.pdf-mode .pdf-head {
  display: block;
}

#report.pdf-mode .report-meta {
  display: none;
}

.pdf-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.pdf-fields {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: var(--text-sm);
}

.pdf-fields th,
.pdf-fields td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.pdf-fields th {
  width: 12rem;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 500;
}

.pdf-fields td {
  color: var(--ink);
}

.report-meta {
  color: var(--muted);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.headline {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.section-title {
  margin-top: 2rem;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

.scores-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
  align-items: start;
}

@media (min-width: 768px) {
  .scores-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.5rem;
  }
}

#report.pdf-mode .scores-row {
  grid-template-columns: 1fr;
}

.scores-row .score-table {
  margin-top: 0;
}

.scores-row .score-table th,
.scores-row .score-table td {
  padding: 0.6rem 0.5rem;
}

.score-bars {
  display: grid;
  gap: 0.5rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) 2.5rem;
  gap: 0.75rem;
  align-items: center;
}

.bar-label {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: var(--text-sm);
  color: var(--ink);
  min-width: 0;
}

.bar-letter {
  font-weight: 700;
  font-size: var(--text-base);
  width: 1.25rem;
  flex: 0 0 auto;
}

.bar-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 0.875rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
}

.bar-zero {
  position: absolute;
  left: 50%;
  top: -0.25rem;
  bottom: -0.25rem;
  width: 1px;
  background: #94a3b8;
}

.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #93c5fd;
}

.bar-fill.pos {
  left: 50%;
  border-radius: 0 0.25rem 0.25rem 0;
}

.bar-fill.neg {
  right: 50%;
  border-radius: 0.25rem 0 0 0.25rem;
}

.bar-row.is-dominant .bar-fill {
  background: var(--brand);
}

.bar-row.is-dominant .bar-name {
  color: var(--ink);
  font-weight: 600;
}

.bar-value {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  text-align: right;
  color: var(--ink);
}

.bar-row.is-dominant .bar-value {
  font-weight: 700;
}

.chart-note {
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.score-grid {
  overflow-x: auto;
}

.score-table td.is-dominant {
  background: #eff6ff;
  font-weight: 700;
}

.style-sections {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .style-sections {
    grid-template-columns: 1fr 1fr;
  }
}

.style-sections .strengths-section,
.style-sections .growth-section {
  margin: 0;
}

/* Other styles switcher */
.explore {
  margin-top: 0.5rem;
}

.style-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.style-chip {
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: none;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  text-align: left;
}

.style-chip:hover {
  border-color: var(--brand);
  background: #f8fafc;
}

.style-chip.active {
  border-color: var(--brand);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--brand);
}

.style-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.chip-letter {
  font-weight: 700;
  font-size: var(--text-base);
  width: 1.5rem;
  text-align: center;
}

.chip-name {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-score {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: var(--text-sm);
}

.chip-you {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #166534;
  background: var(--green-light);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.explore-title {
  margin-top: 1.25rem;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.explore-tag {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

/* Mobile responsiveness */
@media (max-width: 720px) {
  .wrap {
    padding: 1rem 0.5rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .instructions h2 {
    font-size: 2.25rem;
  }

  .instructions p {
    font-size: var(--text-base);
  }

  .actions {
    justify-content: stretch;
    flex-direction: column-reverse;
  }

  .actions button {
    width: 100%;
  }

  .style-switch {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) 2.5rem;
    row-gap: 0.25rem;
  }

  .bar-label {
    grid-column: 1 / -1;
  }

  .quiz-progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav {
    gap: 0.75rem;
  }
  
  .nav .primary {
    flex: 1;
  }
  
  .nav .chevron {
    flex: 0 0 auto;
    min-width: 3rem;
  }
}

/* Minimal PDF Debug Styles */
@media print {
  #report {
    color: black !important;
    background: white !important;
  }
  
  #report * {
    color: black !important;
    background: white !important;
  }
  
  .actions {
    display: none !important;
  }
  
  .gradient-text {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    color: black !important;
  }
}