/* ===================================================================
   AI Capability Assessment page styles
   Extends styles.css tokens; everything here is prefixed `as-`.
   Tier colors follow the ThinkVerse poster: C green, B blue, A violet.
   =================================================================== */

:root {
  --tier-c: #10b981;
  --tier-c-soft: #ecfdf5;
  --tier-b: #3b82f6;
  --tier-b-soft: #eff6ff;
  --tier-a: #8b5cf6;
  --tier-a-soft: #f5f3ff;
}

.as-body { background: var(--bg); }

/* =============== compact hero =============== */

/* styles.css hides .topnav__links below 980px; here it holds the only way
   back to the lessons, so keep it visible at every width */
.as-hero .topnav__links { display: flex; }

.as-hero {
  position: relative;
  background:
    radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(99, 102, 241, 0.28) 0%, transparent 60%),
    var(--bg-deep);
  color: var(--text-on-dark);
  padding-bottom: 56px;
}

.as-hero__content {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 0;
  text-align: center;
}

.as-hero__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
  margin: 18px 0 12px;
}

.as-hero__subtitle {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-on-dark-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.as-tier-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.as-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.as-chip--c { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.as-chip--b { background: rgba(59, 130, 246, 0.16); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.as-chip--a { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4); }
.as-chip__arrow { color: var(--text-soft); font-size: 13px; }

/* =============== layout =============== */

.as-main {
  max-width: 860px;
  margin: -32px auto 0;
  padding: 0 24px 80px;
  position: relative;
  z-index: 2;
}

.as-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  padding: 32px;
  animation: fadeUp 0.35s ease-out;
}
.as-card--center { text-align: center; color: var(--text-muted); }
.as-card + .as-card { margin-top: 20px; }

.as-h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.as-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* =============== intro =============== */

.as-meta-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.as-meta {
  flex: 1;
  min-width: 140px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 18px;
}
.as-meta__num { font-size: 22px; font-weight: 700; color: var(--primary-700); }
.as-meta__lbl { font-size: 12.5px; color: var(--text-muted); }

.as-dims { display: grid; gap: 10px; margin-bottom: 8px; }
.as-dim-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.as-dim-item__dot {
  flex-shrink: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 7px;
}
.as-dim-item__name { font-weight: 600; font-size: 14.5px; color: var(--text-strong); }
.as-dim-item__desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

.as-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* =============== form (name + role) =============== */

.as-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 22px 0 10px;
}
.as-input {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition: all 0.15s;
}
.as-input:focus {
  border-color: var(--primary);
  box-shadow: var(--sh-glow);
  background: white;
}

.as-roles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.as-role {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  transition: all 0.13s;
}
.as-role:hover { border-color: var(--primary); background: var(--bg-soft); }
.as-role--active {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary);
}
.as-role__icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-tint);
  font-size: 13px;
  font-family: var(--font-mono);
}
.as-role--active .as-role__icon { background: var(--primary); color: white; }

/* =============== quiz =============== */

.as-quiz-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.as-quiz-head .progress { flex: 1; }
.as-quiz-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.as-q-dim {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.as-q-text {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-strong);
  margin-bottom: 22px;
  white-space: pre-line;
}

.as-options { display: grid; gap: 10px; }
.as-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
}
.as-option:hover { border-color: var(--primary); background: var(--bg-soft); }
.as-option--selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary);
}
.as-option__key {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-tint);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}
.as-option--selected .as-option__key { background: var(--primary); color: white; }

.as-tf { display: flex; gap: 12px; }
.as-tf .as-option { flex: 1; justify-content: center; font-weight: 600; font-size: 16px; }

.as-textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: all 0.15s;
}
.as-textarea:focus { border-color: var(--primary); box-shadow: var(--sh-glow); background: white; }
.as-charcount { font-size: 12px; color: var(--text-soft); margin-top: 6px; text-align: right; }
.as-charcount--ok { color: var(--success-700); }

/* prompt lab */
.as-lab-brief {
  background: linear-gradient(135deg, var(--primary-50) 0%, #fff7ed 100%);
  border: 1px solid var(--primary-100);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 18px;
  white-space: pre-line;
}
.as-lab-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.as-quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

/* =============== submitting =============== */

.as-wait { text-align: center; padding: 48px 24px; }
.as-wait__spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--primary-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}
.as-wait__title { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.as-wait__sub { color: var(--text-muted); font-size: 14px; }

/* =============== results =============== */

.as-tier-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  color: white;
  padding: 36px;
  box-shadow: var(--sh-lg);
  animation: fadeUp 0.4s ease-out;
}
.as-tier-hero--green  { background: linear-gradient(135deg, #065f46 0%, #10b981 130%); }
.as-tier-hero--blue   { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 130%); }
.as-tier-hero--violet { background: linear-gradient(135deg, #4c1d95 0%, #8b5cf6 130%); }

.as-tier-hero__row {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.as-tier-hero__letter {
  flex-shrink: 0;
  width: 96px; height: 96px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
}
.as-tier-hero__body { flex: 1; min-width: 240px; }
.as-tier-hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 4px;
}
.as-tier-hero__name { font-size: 27px; font-weight: 700; color: white; margin-bottom: 2px; }
.as-tier-hero__th { font-size: 15px; opacity: 0.92; margin-bottom: 10px; }
.as-tier-hero__desc { font-size: 14px; line-height: 1.7; opacity: 0.9; max-width: 560px; }

.as-overall {
  flex-shrink: 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--r-lg);
  padding: 16px 24px;
}
.as-overall__num { font-size: 40px; font-weight: 700; line-height: 1.1; }
.as-overall__lbl { font-size: 12px; opacity: 0.85; }

.as-tier-notes {
  margin: 22px 0 0;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.7;
}
.as-tier-notes li { margin-bottom: 4px; }
.as-tier-notes ul { margin: 0; padding-left: 20px; }

/* radar + breakdown two-up */
.as-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.as-radar-wrap { text-align: center; }
.as-radar-wrap svg { max-width: 100%; height: auto; }
.as-radar-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--bg-deep);
  color: white;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: var(--sh-lg);
  transform: translate(-50%, -130%);
  white-space: nowrap;
  display: none;
}

.as-dim-row { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.as-dim-row:last-child { border-bottom: 0; }
.as-dim-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.as-dim-row__name { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.as-dim-row__score {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.as-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}
.as-level--strong { background: var(--success-50); color: var(--success-700); }
.as-level--developing { background: var(--warning-50); color: var(--warning-700); }
.as-level--gap { background: var(--error-50); color: var(--error-700); }

.as-meter {
  height: 8px;
  background: var(--bg-tint);
  border-radius: 999px;
  overflow: hidden;
}
.as-meter__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.as-dim-row__rec {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* focus / path card */
.as-focus-list { margin: 0; padding-left: 22px; font-size: 14.5px; line-height: 1.9; }

/* review accordion */
.as-review-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.as-review-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  background: var(--bg-soft);
  list-style: none;
}
.as-review-item summary::-webkit-details-marker { display: none; }
.as-review-item[open] summary { border-bottom: 1px solid var(--border-soft); }
.as-review-status {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.as-review-status--good { background: var(--success); }
.as-review-status--bad { background: var(--error); }
.as-review-status--mid { background: var(--warning); }
.as-review-status--na { background: var(--text-soft); }
.as-review-q { flex: 1; line-height: 1.5; }
.as-review-pts {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.as-review-body { padding: 14px 18px; font-size: 13.5px; line-height: 1.7; }
.as-review-body p { margin-bottom: 8px; }
.as-review-expl {
  background: var(--primary-50);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--primary-700);
}
.as-review-crit { margin: 8px 0 0; padding-left: 20px; color: var(--text-muted); }

/* =============== responsive + print =============== */

@media (max-width: 760px) {
  .as-card { padding: 22px 18px; }
  .as-result-grid { grid-template-columns: 1fr; }
  .as-tier-hero { padding: 26px 20px; }
  .as-tier-hero__letter { width: 72px; height: 72px; font-size: 40px; border-radius: 18px; }
  .as-tf { flex-direction: column; }
}

@media print {
  .as-hero, .as-footer, .as-actions, .as-quiz-nav, .toasts, .as-radar-tip { display: none !important; }
  .as-main { margin-top: 0; max-width: 100%; }
  .as-card, .as-tier-hero { box-shadow: none; break-inside: avoid; }
  /* keep every color-carrying element legible on paper without this the
     meters print as empty tracks and the white status glyphs vanish */
  .as-tier-hero, .as-meter, .as-meter__fill, .as-level, .as-review-status,
  .as-q-dim, .as-overall, .as-tier-notes {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.as-footer {
  background: var(--bg-deeper);
  color: var(--text-on-dark-muted);
  text-align: center;
  padding: 28px 24px;
  font-size: 13px;
}
.as-footer strong { color: white; }
.as-footer__sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.as-footer p { margin: 0; }
