/**
 * Academic Assessment module — shared shell (Lifetime Tutors portal).
 * Uses portal-tokens.css variables; extends with assessment-specific layout.
 */

.aa-shell {
  --aa-accent: var(--portal-brand-primary, #1a56db);
  --aa-accent-hover: #153f9e;
  --aa-surface: var(--portal-bg-card, #ffffff);
  --aa-page: var(--portal-bg-page, #f9fafb);
  --aa-text: var(--portal-text-primary, #111827);
  --aa-muted: var(--portal-text-muted, #6b7280);
  --aa-border: var(--portal-border, #e5e7eb);
  --aa-radius: var(--radius-xl, 1rem);
  --aa-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
  font-family: var(--font-sans, "Segoe UI", system-ui, sans-serif);
  color: var(--aa-text);
  background: var(--aa-page);
  min-height: 100vh;
  line-height: 1.55;
}

.aa-shell *,
.aa-shell *::before,
.aa-shell *::after {
  box-sizing: border-box;
}

.aa-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 100);
  background: var(--aa-surface);
  border-bottom: 1px solid var(--aa-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.aa-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.aa-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 0.95rem;
}

.aa-brand:hover {
  text-decoration: none;
  color: var(--aa-accent);
}

.aa-brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--aa-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.aa-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.aa-nav a {
  color: var(--aa-muted);
  text-decoration: none;
  font-weight: 500;
}

.aa-nav a:hover {
  color: var(--aa-accent);
  text-decoration: underline;
}

.aa-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.aa-main.aa-main--wide {
  max-width: 960px;
}

.aa-hero {
  margin-bottom: 1.75rem;
}

.aa-hero h1 {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.aa-hero p {
  margin: 0;
  color: var(--aa-muted);
  font-size: 0.95rem;
}

.aa-card {
  background: var(--aa-surface);
  border: 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--aa-shadow);
}

.aa-card + .aa-card {
  margin-top: 1.25rem;
}

.aa-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--aa-accent);
  display: inline-block;
}

.aa-field {
  margin-bottom: 1.1rem;
}

.aa-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--aa-muted);
  margin-bottom: 0.35rem;
}

.aa-field input,
.aa-field select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--aa-border);
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
}

.aa-field input:focus,
.aa-field select:focus {
  outline: 2px solid rgba(26, 86, 219, 0.25);
  outline-offset: 1px;
  border-color: var(--aa-accent);
}

.aa-field-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--aa-muted);
  line-height: 1.4;
  max-width: 36rem;
}

.aa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.aa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.aa-btn--primary {
  background: var(--aa-accent);
  color: #fff;
  border-color: var(--aa-accent);
}

.aa-btn--primary:hover {
  background: var(--aa-accent-hover);
  border-color: var(--aa-accent-hover);
}

.aa-btn--ghost {
  background: transparent;
  color: var(--aa-accent);
  border-color: var(--aa-border);
}

.aa-btn--ghost:hover {
  border-color: var(--aa-accent);
  background: rgba(26, 86, 219, 0.06);
}

/* Session bar: timer + progress */
.aa-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--aa-surface);
  border: 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

.aa-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--aa-text);
}

.aa-timer__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aa-muted);
  margin-bottom: 0.15rem;
}

.aa-progress {
  flex: 1;
  min-width: 140px;
  max-width: 320px;
}

.aa-progress__track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.aa-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--aa-accent), #3b82f6);
  transition: width 0.35s ease;
}

.aa-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--aa-muted);
  margin-top: 0.35rem;
}

/* Question area */
.aa-question {
  min-height: 200px;
  padding: 1.5rem;
  border: 1px dashed var(--aa-border);
  border-radius: var(--aa-radius);
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
}

.aa-question__placeholder {
  text-align: center;
  color: var(--aa-muted);
  font-size: 0.95rem;
}

.aa-question__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aa-accent);
  margin-bottom: 0.75rem;
}

/* Results */
.aa-results-summary {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aa-results-summary li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--aa-border);
  font-size: 0.9rem;
}

.aa-results-summary li:last-child {
  border-bottom: none;
}

.aa-results-summary span:first-child {
  color: var(--aa-muted);
  font-weight: 500;
}

.aa-results-summary span:last-child {
  font-weight: 600;
  text-align: right;
}

.aa-footnote {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--aa-muted);
}

/* Placement results (premium, readable) */
.aa-results-loading {
  margin: 0;
  color: var(--aa-muted);
  font-size: 0.95rem;
}

.aa-muted-text {
  color: var(--aa-muted);
  font-size: 0.9rem;
}

.aa-results-hero {
  margin-bottom: 1.25rem;
}

.aa-results-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aa-accent);
}

.aa-results-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.aa-results-lede {
  margin: 0;
  color: var(--aa-muted);
  font-size: 0.98rem;
  max-width: 52rem;
}

.aa-placement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.aa-metric-card {
  border-radius: 14px;
  border: 1px solid var(--aa-border);
  padding: 1.05rem 1.15rem;
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.aa-metric-card__label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aa-muted);
}

.aa-metric-card__value {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aa-text);
}

.aa-metric-card__note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-results-section {
  margin-top: 1.5rem;
}

.aa-results-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--aa-text);
}

.aa-results-bullets {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--aa-text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.aa-results-bullets li {
  margin-bottom: 0.35rem;
}

.aa-pill {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
  border: 1px solid var(--aa-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aa-pill--strength {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), #fff);
  border-color: rgba(16, 185, 129, 0.35);
}

.aa-pill--growth {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), #fff);
  border-color: rgba(245, 158, 11, 0.4);
}

.aa-pill__title {
  font-weight: 700;
  font-size: 0.9rem;
}

.aa-pill__text {
  font-size: 0.86rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-results-next {
  background: rgba(26, 86, 219, 0.04);
  border: 1px solid rgba(26, 86, 219, 0.12);
  border-radius: var(--aa-radius);
  padding: 1rem 1.15rem;
}

.aa-results-next__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.aa-results-encourage {
  margin-top: 1.25rem;
  font-size: 0.92rem;
  color: var(--aa-text);
  font-style: italic;
  line-height: 1.5;
}

.aa-tutor-panel {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--aa-accent);
  background: #f9fafb;
  border-radius: 0 12px 12px 0;
}

.aa-tutor-panel__title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--aa-muted);
}

.aa-tutor-panel__muted {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-results-meta {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--aa-border);
  font-size: 0.8rem;
  color: var(--aa-muted);
}

.aa-results-meta p {
  margin: 0.2rem 0;
}

/* Report shell — family + tutor panels (export-friendly root) */
.aa-report-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.aa-lt-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0 0.25rem;
}

.aa-lt-brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--aa-accent), #2563eb);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aa-lt-brand__text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--aa-muted);
  letter-spacing: 0.02em;
}

.aa-panel {
  border-radius: 16px;
  border: 1px solid var(--aa-border);
  padding: 1.35rem 1.5rem 1.5rem;
  background: var(--aa-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.aa-panel--parent {
  border-color: rgba(26, 86, 219, 0.14);
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}

.aa-panel--tutor {
  border-color: rgba(26, 86, 219, 0.22);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
  border-left: 4px solid var(--aa-accent);
}

.aa-panel__title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--aa-text);
}

.aa-panel__title--tutor {
  color: #0f172a;
}

.aa-panel__lede {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--aa-muted);
  max-width: 48rem;
}

.aa-ref-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.aa-ref-strip__cell {
  border-radius: 12px;
  border: 1px solid var(--aa-border);
  padding: 0.65rem 0.75rem;
  background: #fff;
}

.aa-ref-strip__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aa-muted);
  margin-bottom: 0.2rem;
}

.aa-ref-strip__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--aa-text);
  line-height: 1.25;
}

.aa-parent-block {
  margin-top: 1.15rem;
}

.aa-parent-block--list {
  margin-top: 1.25rem;
}

.aa-parent-block__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--aa-text);
}

.aa-parent-block__lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-parent-block__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--aa-text);
}

.aa-parent-block__note {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-empty-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--aa-muted);
  font-style: italic;
  line-height: 1.45;
}

.aa-instructional-frame {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--aa-text);
}

.aa-disclaimer {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--aa-muted);
  line-height: 1.5;
}

.aa-tutor-band {
  border-radius: 12px;
  border: 1px solid var(--aa-border);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: #fff;
}

.aa-tutor-band__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aa-muted);
}

.aa-tutor-band__label {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--aa-text);
}

.aa-tutor-band__meta {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--aa-muted);
}

.aa-tutor-band__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-tutor-block {
  margin-top: 1rem;
}

.aa-tutor-block--frequency {
  border-radius: 12px;
  background: rgba(26, 86, 219, 0.05);
  border: 1px dashed rgba(26, 86, 219, 0.25);
  padding: 0.85rem 1rem;
}

.aa-tutor-block__title {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--aa-text);
}

.aa-tutor-block__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--aa-text);
}

.aa-tutor-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.aa-tutor-ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.aa-tutor-context {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--aa-muted);
  line-height: 1.45;
}

.aa-tutor-monitor {
  margin: 0.65rem 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--aa-text);
  line-height: 1.45;
}

.aa-tutor-meta {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--aa-muted);
  font-family: ui-monospace, monospace;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 520px) {
  .aa-session-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .aa-progress {
    max-width: none;
  }
}
