/* ═══════════════════════════════════════════════════════════════
   COACHING INSIGHT PROFILE — Stylesheet
   Professional, clean, print-ready
═══════════════════════════════════════════════════════════════ */

/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #0A1E30;
  --brand-light: #1a4a6e;
  --accent:      #2563eb;
  --accent-light:#dbeafe;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --amber:       #d97706;
  --amber-light: #fef3c7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --grey-100:    #f8fafc;
  --grey-200:    #e8edf3;
  --grey-300:    #cdd5df;
  --grey-500:    #64748b;
  --grey-700:    #374151;
  --grey-900:    #0f172a;
  --white:       #ffffff;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --font:        'Playfair Display', 'Georgia', serif;
  --font-sans:   'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--grey-100);
  color: var(--grey-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Views ────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: .75rem 2rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary:hover  { background: #1d4ed8; }
.btn-primary:active { transform: scale(.98); }
.btn-primary.small  { padding: .4rem 1rem; font-size: .875rem; }

.btn-secondary {
  display: inline-block;
  background: var(--white);
  color: var(--brand);
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius-sm);
  padding: .7rem 1.5rem;
  font-size: .9375rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-light); }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--grey-500);
  border: none;
  padding: .7rem 1rem;
  font-size: .9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color .15s;
}
.btn-ghost:hover { color: var(--brand); }

.btn-danger {
  display: inline-block;
  background: var(--red-light);
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-sm);
  padding: .7rem 1.5rem;
  font-size: .9375rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
}
.btn-danger:hover { background: var(--red); color: white; }

/* ─── Welcome view ─────────────────────────────────────────── */
#view-welcome.active {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand) 0%, #1e3a5f 60%, #2563eb 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem 4rem;
}

.welcome-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.brand-mark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--grey-500);
  margin-bottom: 1rem;
}

.welcome-container h1 {
  font-family: var(--font);
  font-size: 2rem;
  color: var(--brand);
  margin-bottom: .5rem;
  line-height: 1.25;
}

.welcome-subtitle {
  color: var(--grey-500);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.welcome-card {
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.welcome-card h3 {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grey-500);
  margin-bottom: .75rem;
}

.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .75rem;
  margin: 1rem 0;
}

.dim-item {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.dim-icon { color: var(--accent); font-size: .8rem; }

.dim-item strong {
  font-size: .875rem;
  color: var(--brand);
  display: block;
}

.dim-item span { font-size: .75rem; color: var(--grey-500); }

.time-note { font-size: .875rem; color: var(--grey-500); margin-top: .75rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--grey-700);
  margin-bottom: .4rem;
}
.form-group input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--grey-900);
  transition: border-color .15s;
  outline: none;
}
.form-group input:focus  { border-color: var(--accent); }
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--grey-900);
  background: #fff;
  transition: border-color .15s;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.form-group select:focus { border-color: var(--accent); }

/* ─── Optional demographic section ── */
.demo-section {
  margin: 1.5rem 0 1rem;
  padding: 1.25rem;
  background: var(--grey-50, #f9fafb);
  border: 1.5px solid var(--grey-200, #e5e7eb);
  border-radius: var(--radius-sm);
}
.demo-section-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.demo-badge {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #6b7280;
  background: #e5e7eb;
  border-radius: 999px;
  padding: .2rem .65rem;
  margin-top: .1rem;
}
.demo-intro {
  font-size: .82rem;
  color: var(--grey-600, #4b5563);
  line-height: 1.55;
  margin: 0;
}
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}
@media (max-width: 560px) {
  .demo-grid { grid-template-columns: 1fr; }
}

#btn-start { width: 100%; margin-top: .5rem; }

.privacy-note {
  font-size: .78rem;
  color: var(--grey-500);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
}

/* ─── Completion view ──────────────────────────────────────── */
.complete-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand) 0%, #1e3a5f 60%, #16a34a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.complete-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.complete-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
}

.complete-title {
  font-family: var(--font);
  font-size: 2.25rem;
  color: var(--brand);
  margin-bottom: .75rem;
}

.complete-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--grey-700);
  margin-bottom: 1rem;
}

.complete-message {
  color: var(--grey-500);
  font-size: .9375rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.complete-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}

.complete-actions .btn-primary { width: 100%; }

/* ─── Assessment view ──────────────────────────────────────── */
.assessment-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-md);
}

.header-brand {
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: rgba(255,255,255,.6);
  min-width: 40px;
}

.progress-container { flex: 1; }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  margin-bottom: .4rem;
}

.progress-bar-outer {
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: #60a5fa;
  border-radius: 3px;
  transition: width .4s ease;
}

.section-pills {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}

.pill {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.5);
  transition: all .2s;
}

.pill.active {
  background: #3b82f6;
  color: var(--white);
}

.assessment-main {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

/* Section intro */
.section-intro {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.intro-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-intro h2 {
  font-family: var(--font);
  font-size: 1.75rem;
  color: var(--brand);
  margin-bottom: .75rem;
}

.section-intro p {
  color: var(--grey-500);
  font-size: .9375rem;
  margin-bottom: .75rem;
  line-height: 1.7;
}

#intro-instructions {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  text-align: left;
  font-size: .875rem;
  color: var(--brand);
  margin: 1.25rem 0;
}

#btn-intro-next { margin-top: 1rem; }

/* ─── Pre-assessment instructions list ─────────────────────── */
.pre-assessment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pre-assessment-list li {
  padding: .5rem 0 .5rem 1.75rem;
  position: relative;
  border-bottom: 1px solid rgba(37,99,235,.12);
  line-height: 1.65;
  font-size: .9rem;
}

.pre-assessment-list li:last-child {
  border-bottom: none;
  padding-bottom: .25rem;
}

.pre-assessment-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: .8rem;
  top: .575rem;
}

/* Tighter padding when instructions box holds a bullet list */
#intro-instructions:has(.pre-assessment-list) {
  padding: .5rem 1rem .75rem;
}

/* ─── Break card ───────────────────────────────────────────── */
#intro-instructions:has(.break-note) {
  background: var(--green-light);
  border-left-color: var(--green);
}

.break-note {
  color: #14532d;
  line-height: 1.7;
  margin-bottom: .5rem;
}

.break-next {
  color: #15803d;
  font-size: .875rem;
  font-style: italic;
}

/* Question card */
.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.5rem 2rem;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.question-domain-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .75rem;
}

.question-text {
  font-size: 1.2rem;
  color: var(--grey-900);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-family: var(--font);
}

.scale-container { margin-bottom: 2rem; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--grey-500);
  margin-bottom: .6rem;
}

.scale-buttons {
  display: flex;
  gap: .5rem;
  justify-content: center;
}

.scale-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--grey-200);
  background: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--grey-500);
  cursor: pointer;
  transition: all .15s;
}

.scale-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.scale-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.scale-descriptor {
  text-align: center;
  font-size: .875rem;
  color: var(--grey-500);
  margin-top: .6rem;
  min-height: 1.4em;
  font-style: italic;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--grey-200);
  padding-top: 1.25rem;
}

#btn-next:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ─── Results view ─────────────────────────────────────────── */
.results-header {
  background: var(--brand);
  color: var(--white);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.results-header-info { flex: 1; }
.results-header-info h1 { font-size: 1.25rem; font-weight: 700; }
.results-header-info p  { font-size: .8rem; color: rgba(255,255,255,.6); margin-top: .2rem; }
.results-actions { display: flex; gap: .75rem; align-items: center; }

.results-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Results sections */
.results-section {
  margin-bottom: 3rem;
}

.intro-box {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.intro-box h2 {
  font-family: var(--font);
  font-size: 1.25rem;
  color: var(--brand);
  margin-bottom: .75rem;
}

.intro-box p { color: var(--grey-700); font-size: .9rem; margin-bottom: .75rem; line-height: 1.7; }

.stanine-legend {
  display: flex;
  gap: 4px;
  margin: 1rem 0 .3rem;
}

.sl-box {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 4px;
}
.sl-box.low  { background: #fee2e2; color: #991b1b; }
.sl-box.mid  { background: #f1f5f9; color: var(--grey-700); }
.sl-box.high { background: #dcfce7; color: #166534; }

.stanine-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--grey-500);
}

.norm-note { font-size: .8rem; margin-top: .75rem !important; }

.section-heading {
  font-family: var(--font);
  font-size: 1.75rem;
  color: var(--brand);
  margin-bottom: .25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--grey-200);
}

.section-subheading {
  color: var(--grey-500);
  font-size: .9rem;
  margin-bottom: 1.75rem;
}

.personality-heading { border-color: #3b82f6; }
.motivation-heading  { border-color: #10b981; }
.behaviour-heading   { border-color: #8b5cf6; }

/* Domain summary grid */
.domain-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.domain-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.domain-name {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grey-500);
  margin-bottom: .6rem;
}

.domain-pct {
  font-size: .72rem;
  color: var(--grey-500);
  margin-top: .5rem;
}

/* Stanine bar row */
.stanine-row {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.sb {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 600;
  border-radius: 3px;
  background: var(--grey-100);
  color: var(--grey-300);
}
.sb.active       { color: var(--white); font-weight: 700; }
.sb.active.low   { background: #dc2626; }
.sb.active.mid   { background: #1a2e4a; }
.sb.active.high  { background: #16a34a; }

.stanine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 800;
  color: var(--white);
  vertical-align: middle;
}
.stanine-badge.low  { background: #dc2626; }
.stanine-badge.mid  { background: #1a2e4a; }
.stanine-badge.high { background: #16a34a; }

/* Domain detail */
.domain-detail {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.domain-detail-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.1rem;
  color: var(--brand);
  margin-bottom: .6rem;
}

.domain-label-tag {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--accent-light);
  color: var(--accent);
  padding: .2rem .6rem;
  border-radius: 20px;
}

.domain-detail-desc {
  font-size: .9rem;
  color: var(--grey-700);
  margin-bottom: 1.25rem;
  line-height: 1.7;
  border-left: 3px solid var(--grey-200);
  padding-left: .75rem;
}

.trait-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.trait-table thead th {
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--grey-500);
  padding: .5rem .75rem;
  border-bottom: 1.5px solid var(--grey-200);
}

.trait-table tbody tr {
  border-bottom: 1px solid var(--grey-100);
}

.trait-table tbody tr:last-child { border-bottom: none; }

.trait-name {
  font-weight: 700;
  color: var(--brand);
  padding: .75rem .75rem .75rem 0;
  white-space: nowrap;
  min-width: 110px;
}

.trait-stanine {
  padding: .75rem;
  white-space: nowrap;
}

.trait-desc-cell {
  padding: .75rem;
  color: var(--grey-700);
  line-height: 1.6;
}

/* Motivations */
.motivation-category {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cat-heading {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: 1rem;
}

.cat-label-tag {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: #d1fae5;
  color: #065f46;
  padding: .2rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
}

.cat-subtext {
  font-size: .85rem;
  color: var(--grey-500);
  font-style: italic;
}

/* Behaviours */
.behaviour-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.behaviour-thumb {
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1rem .75rem;
  text-align: center;
}

.bt-name { font-size: .72rem; font-weight: 600; color: var(--grey-500); margin-bottom: .4rem; }
.bt-level { font-size: 1.5rem; font-weight: 800; margin-bottom: .2rem; }
.bt-level-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.level-1 { border-color: #fca5a5; }
.level-1 .bt-level, .level-1 .bt-level-name { color: #991b1b; }
.level-2 { border-color: #fcd34d; }
.level-2 .bt-level, .level-2 .bt-level-name { color: #92400e; }
.level-3 { border-color: #93c5fd; }
.level-3 .bt-level, .level-3 .bt-level-name { color: #1e40af; }
.level-4 { border-color: #6ee7b7; }
.level-4 .bt-level, .level-4 .bt-level-name { color: #065f46; }
.level-5 { border-color: #c4b5fd; }
.level-5 .bt-level, .level-5 .bt-level-name { color: #4c1d95; }

.behaviour-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.bc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
  gap: 1rem;
}

.bc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}

.bc-level-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 20px;
  white-space: nowrap;
}

.bc-level-badge.level-1 { background: #fee2e2; color: #991b1b; }
.bc-level-badge.level-2 { background: #fef3c7; color: #92400e; }
.bc-level-badge.level-3 { background: #dbeafe; color: #1e40af; }
.bc-level-badge.level-4 { background: #dcfce7; color: #065f46; }
.bc-level-badge.level-5 { background: #ede9fe; color: #4c1d95; }

.bc-stanine-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bc-stanine-label {
  font-size: .8rem;
  color: var(--grey-500);
  white-space: nowrap;
}

.bc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.bc-block {
  background: var(--grey-100);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.bc-block.next { background: #eff6ff; }

.bc-block-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--grey-500);
  margin-bottom: .5rem;
}

.bc-block p { font-size: .86rem; color: var(--grey-700); line-height: 1.7; }

/* ─── Admin view ────────────────────────────────────────────── */
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
}

.stat-label {
  font-size: .78rem;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.admin-notice {
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: .9rem 1.25rem;
  font-size: .9rem;
  color: var(--grey-700);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.admin-notice.success { background: var(--green-light); border-color: #86efac; color: #14532d; }
.admin-notice.warning { background: var(--amber-light); border-color: #fcd34d; color: #78350f; }

.admin-section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  margin: 1.75rem 0 .5rem;
  border-bottom: 1.5px solid var(--grey-200);
  padding-bottom: .5rem;
}

.admin-note { font-size: .85rem; color: var(--grey-500); margin-bottom: .75rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: .875rem;
}

.admin-table thead th {
  background: var(--grey-100);
  padding: .75rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--grey-500);
  border-bottom: 1.5px solid var(--grey-200);
}

.admin-table tbody td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--grey-100);
  color: var(--grey-700);
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.flagged-row td { background: #fffbeb; }
.drift-high { color: var(--red); font-weight: 700; }

.admin-danger-zone {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1.5px dashed var(--grey-300);
  border-radius: var(--radius-md);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-loading {
  text-align: center;
  padding: 3rem;
  color: var(--grey-500);
  font-size: .9rem;
}

.admin-danger-zone h3 {
  font-size: .875rem;
  font-weight: 700;
  color: var(--grey-500);
  margin-right: auto;
}

/* ─── Behaviour section v2 ─────────────────────────────────── */

.btn-accent {
  display: inline-block;
  background: #7c3aed;
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem 1.25rem;
  font-size: .9rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-accent:hover { background: #6d28d9; }

.subsection-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  margin: 1.75rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--grey-200);
}

/* BEI pending notice */
.bei-pending-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #f8fafc;
  border: 1.5px dashed var(--grey-300);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.bpn-icon { font-size: 1.5rem; color: var(--grey-300); flex-shrink: 0; padding-top: .1rem; }
.bei-pending-notice strong { display: block; color: var(--brand); margin-bottom: .4rem; }
.bei-pending-notice p { font-size: .875rem; color: var(--grey-500); line-height: 1.6; }

/* Frequency overview grid */
.behaviour-freq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}

.freq-thumb {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: .9rem .75rem;
  text-align: center;
}

.ft-num  { font-size: .7rem; color: var(--grey-300); font-weight: 700; margin-bottom: .2rem; }
.ft-name { font-size: .72rem; font-weight: 600; color: var(--grey-500); margin-bottom: .5rem; }
.ft-stanine-mini { display: flex; justify-content: center; margin-bottom: .4rem; }
.ft-stanine-mini .stanine-row { transform: scale(.75); transform-origin: center; }
.ft-freq { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.freq-low      { color: #b91c1c; }
.freq-situational { color: #92400e; }
.freq-habitual { color: #15803d; }
.freq-infrequent { color: #b91c1c; }

/* Dual-track behaviour card */
.behaviour-card-v2 {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.behaviour-card-v2.has-bei { border-left: 3px solid var(--accent); }

.bcv2-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.bcv2-num {
  width: 28px; height: 28px;
  background: var(--grey-200);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
  color: var(--grey-500);
  flex-shrink: 0;
}

.bcv2-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  flex: 1;
}

.bcv2-quad-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1.5px solid;
  white-space: nowrap;
}

/* Dual tracks */
.bcv2-tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.track {
  background: var(--grey-100);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.track.track-empty {
  background: #f8fafc;
  border: 1.5px dashed var(--grey-300);
}

.track-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--grey-500);
  margin-bottom: .5rem;
}

.track-source {
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.track-bar-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.track-descriptor {
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.track-descriptor.freq-habitual    { color: #15803d; }
.track-descriptor.freq-situational { color: #92400e; }
.track-descriptor.freq-infrequent  { color: #b91c1c; }

.track-subtext {
  font-size: .8rem;
  color: var(--grey-500);
  line-height: 1.6;
}

.track-pending {
  font-size: .85rem;
  color: var(--grey-400);
  font-style: italic;
  padding: .5rem 0;
}

/* BEI 5-point level bar */
.bei-level-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.bei-box {
  flex: 1;
  min-width: 56px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: .3rem .4rem;
  text-align: center;
  opacity: .45;
}

.bei-box.active {
  opacity: 1;
  border-width: 2px;
}

.bei-box.active.level-1 { border-color: #fca5a5; background: #fee2e2; }
.bei-box.active.level-2 { border-color: #fcd34d; background: #fef3c7; }
.bei-box.active.level-3 { border-color: #93c5fd; background: #dbeafe; }
.bei-box.active.level-4 { border-color: #6ee7b7; background: #dcfce7; }
.bei-box.active.level-5 { border-color: #c4b5fd; background: #ede9fe; }

.bei-box-num  { display: block; font-size: .85rem; font-weight: 800; color: var(--grey-700); }
.bei-box-name { display: block; font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-500); }

/* Gap insight */
.gap-insight {
  margin-top: 1rem;
  border-left: 3px solid var(--accent);
  padding: .8rem 1rem;
  background: #f8fafc;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.gi-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--grey-500);
  margin-bottom: .35rem;
}

.gap-insight p { font-size: .875rem; color: var(--grey-700); line-height: 1.7; }

/* ─── Quadrant map ──────────────────────────────────────────── */
.quadrant-wrapper { margin-bottom: 2rem; }

.quadrant-intro {
  font-size: .875rem;
  color: var(--grey-500);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.quadrant-svg {
  width: 100%;
  max-width: 760px;
  display: block;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.quadrant-svg .q-label    { font-size: 11px; font-weight: 700; font-family: var(--font-sans); }
.quadrant-svg .axis-label { font-size: 10px; font-family: var(--font-sans); }
.quadrant-svg .axis-title { font-size: 10px; font-family: var(--font-sans); }
.quadrant-svg .point-label{ font-size: 11px; font-weight: 800; font-family: var(--font-sans); }

.quadrant-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .4rem .75rem;
  margin-top: .75rem;
  padding: .75rem 1rem;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
}

.ql-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
}

.ql-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.ql-name  { color: var(--grey-700); font-weight: 600; flex: 1; }
.ql-quad  { font-size: .7rem; font-weight: 700; white-space: nowrap; }

/* ─── BEI input view ───────────────────────────────────────── */
.bei-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.bei-intro {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  color: #4c1d95;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.bei-row {
  display: grid;
  grid-template-columns: 32px 200px 1fr;
  align-items: center;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--grey-100);
}

.bei-row-num {
  font-size: .85rem;
  font-weight: 700;
  color: var(--grey-300);
  text-align: center;
}

.bei-row-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.4;
}

.bei-row-selector {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.bei-level-option {
  flex: 1;
  min-width: 72px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: .4rem .5rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.bei-level-option input { display: none; }

.bei-level-option:hover { border-color: #8b5cf6; background: #f5f3ff; }

.bei-level-option.selected {
  border-color: #7c3aed;
  background: #ede9fe;
}

.blo-num  { display: block; font-size: 1.1rem; font-weight: 800; color: var(--brand); }
.blo-name { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-500); }

.bei-level-option.selected .blo-num  { color: #6d28d9; }
.bei-level-option.selected .blo-name { color: #6d28d9; }

.bei-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-200);
}

/* ─── Admin login page ──────────────────────────────────────── */
.admin-login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand) 0%, #1e3a5f 60%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.admin-login-card h1 {
  font-family: var(--font);
  font-size: 1.75rem;
  color: var(--brand);
  margin-bottom: .5rem;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .welcome-container { padding: 2rem 1.5rem; }
  .dimension-grid { grid-template-columns: 1fr; }
  .domain-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .bc-body { grid-template-columns: 1fr; }
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
  .scale-btn { width: 44px; height: 44px; font-size: 1rem; }
  .question-card { padding: 1.75rem 1.25rem 1.5rem; }
  .behaviour-overview-grid { grid-template-columns: repeat(3, 1fr); }
  .results-header { flex-wrap: wrap; gap: .75rem; }
  .bc-header { flex-direction: column; align-items: flex-start; }
}

/* ─── Print styles ──────────────────────────────────────────── */
@media print {
  body { background: white; font-size: 11pt; }

  .results-header { background: var(--brand) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .btn-primary, .btn-secondary, .btn-ghost, .results-actions { display: none !important; }

  .results-section { page-break-inside: avoid; margin-bottom: 1.5rem; }

  .behaviour-card, .domain-detail, .motivation-category { page-break-inside: avoid; }

  .sl-box, .sb.active { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .bc-level-badge, .stanine-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
