:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #dbe3ef;
  --brand: #2947a9;
  --brand-dark: #19327e;
  --soft: #eef3ff;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, #dfe8ff 0, transparent 32rem), var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.05em;
}

.hero-copy {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-card {
  min-width: 190px;
  padding: 24px;
  border-radius: 24px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card strong { font-size: 2rem; }
.hero-card span { opacity: 0.86; }

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 32px);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hidden { display: none !important; }

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-title h2 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.step-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand);
  font-weight: 900;
}

.participant-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(41, 71, 169, 0.16);
  border-color: var(--brand);
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 20px rgba(41, 71, 169, 0.2);
}

.primary-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.secondary-btn {
  color: var(--brand);
  background: var(--soft);
}

.secondary-btn:hover {
  transform: translateY(-1px);
}

.sticky-progress {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -8px -8px 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(8px);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #e7ecf5;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.2s ease;
}

.questions-grid {
  display: grid;
  gap: 18px;
}

.question-card {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.question-card.unanswered {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.question-card legend {
  padding: 0 8px;
  font-weight: 900;
}

.question-card legend small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: var(--muted);
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.45;
  transition: border 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.choice:hover {
  border-color: rgba(41, 71, 169, 0.45);
  background: #fbfcff;
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--soft);
  box-shadow: 0 0 0 4px rgba(41, 71, 169, 0.08);
}

.choice input {
  margin-top: 3px;
  accent-color: var(--brand);
}

.choice-code {
  display: inline-flex;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #edf2f8;
  color: var(--brand);
  font-weight: 900;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.form-error {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 700;
}

.report-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  background: #fbfcff;
}

.report-header h3 {
  margin: 4px 0;
  font-size: 1.6rem;
}

.report-header p {
  margin: 0;
  color: var(--muted);
}

.profile-pill {
  min-width: 220px;
  border-radius: 18px;
  padding: 18px;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.profile-pill span {
  display: block;
  opacity: 0.82;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-pill strong {
  font-size: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f2f5fa;
  color: #344054;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:last-child td { border-bottom: 0; }

.dim-cell {
  font-weight: 900;
}

.analysis-box {
  display: grid;
  gap: 16px;
}

.analysis-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
}

.analysis-card h3,
.analysis-card h4 {
  margin: 0 0 10px;
}

.analysis-card p {
  margin: 0 0 10px;
  color: #344054;
  line-height: 1.7;
}

.analysis-card p:last-child { margin-bottom: 0; }

.interpretation {
  white-space: pre-line;
  line-height: 1.7;
  color: #344054;
}

.disclaimer {
  border-left: 4px solid var(--brand);
  padding-left: 14px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero,
  .participant-form,
  .sticky-progress,
  .report-header {
    grid-template-columns: 1fr;
  }

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

  .actions {
    justify-content: stretch;
  }

  .actions button,
  .participant-form button {
    width: 100%;
  }
}

@media print {
  body { background: #fff; }
  .app-shell { width: 100%; padding: 0; }
  .hero,
  #participantSection,
  #testSection,
  .no-print {
    display: none !important;
  }
  .panel {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .table-wrap {
    overflow: visible;
  }
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
}
