/* =============================================================
   Paravector AI — Assessment Widget Styles
   All classes prefixed with .asmt- to avoid collision.
   ============================================================= */

/* ── Outer section wrapper ─────────────────────────────────── */
.asmt-section {
  background: var(--surface-muted);
}

/* Widget container — centers and constrains the card */
#assessment-widget {
  max-width: 780px;
  margin: 0 auto;
  /* Reserve vertical space to prevent layout shift during transitions */
  min-height: 280px;
}

/* ── Shared card shell ─────────────────────────────────────── */
.asmt-entry,
.asmt-question,
.asmt-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: asmtFadeUp 0.3s ease both;
}

@keyframes asmtFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   ENTRY STATE
══════════════════════════════════════════════════════════════ */
.asmt-entry {
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.asmt-entry-badge {
  display: inline-block;
  background: rgba(95,175,214,0.12);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.875rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.asmt-entry-heading {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.875rem;
  max-width: 540px;
}

.asmt-entry-body {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 1.75rem;
}

.asmt-entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.asmt-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.asmt-meta-item svg {
  color: var(--accent-2);
  flex-shrink: 0;
}

.asmt-start-btn {
  min-width: 220px;
  justify-content: center;
  gap: 0.5rem;
}

.asmt-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   QUESTION STATE
══════════════════════════════════════════════════════════════ */
.asmt-question {
  display: flex;
  flex-direction: column;
}

/* Progress bar */
.asmt-progress {
  padding: 1.25rem 2rem 0;
}

.asmt-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.asmt-step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.asmt-step-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.asmt-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.asmt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question body */
.asmt-q-body {
  padding: 1.75rem 2rem;
  flex: 1;
}

.asmt-q-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.asmt-q-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Options grid */
.asmt-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* Option button */
.asmt-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.asmt-option:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(42,166,164,0.12);
}

.asmt-option.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.asmt-option.is-selected .asmt-option-check {
  opacity: 1;
  transform: scale(1);
}

/* Flash when max selections reached */
.asmt-option--maxed {
  border-color: var(--accent-3) !important;
  box-shadow: 0 0 0 3px rgba(168,139,82,0.25) !important;
}

.asmt-option-label {
  flex: 1;
  line-height: 1.4;
}

.asmt-option-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--transition), transform var(--transition);
}

.asmt-option-check svg {
  width: 11px;
  height: 11px;
  stroke: #fff;
}

.asmt-multi-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* Navigation row */
.asmt-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  gap: 1rem;
}

.asmt-nav .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.asmt-next {
  gap: 0.5rem;
  margin-left: auto;
}

/* ══════════════════════════════════════════════════════════════
   RESULTS STATE
══════════════════════════════════════════════════════════════ */
.asmt-results {
  padding: 0;
  overflow: visible; /* allow cards to breathe */
}

.asmt-results-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Lead bucket badge */
.asmt-bucket {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.asmt-bucket--high  { background: rgba(42,166,164,0.12);  color: var(--accent); }
.asmt-bucket--med   { background: rgba(95,175,214,0.12);  color: var(--accent-2); }
.asmt-bucket--poss  { background: rgba(183,138,59,0.12);  color: var(--accent-3); }
.asmt-bucket--low   { background: rgba(239,68,68,0.10);   color: #EF4444; }

.asmt-results-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

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

/* Match cards container */
.asmt-matches {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual match card */
.asmt-match {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--transition);
}

.asmt-match:last-child {
  border-bottom: none;
}

/* Top result gets a brass left accent */
.asmt-match--top {
  border-left: 3px solid var(--accent-3);
  background: var(--surface-elevated);
}

.asmt-match-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.asmt-match-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(42,166,164,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.asmt-match-icon svg {
  width: 22px;
  height: 22px;
}

.asmt-match-title {
  flex: 1;
}

.asmt-match-title h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.asmt-match-pitch {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

.asmt-conf-badge {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 0.73rem;
  font-weight: 700;
}

/* Why/gaps sections */
.asmt-match-section {
  margin-bottom: 1rem;
}

.asmt-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.asmt-section-label--gap {
  color: var(--accent-3);
}

.asmt-why-list,
.asmt-gap-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0;
  list-style: none;
}

.asmt-why-list li {
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.asmt-why-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
  margin-top: 0.45em;
}

.asmt-gap-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.asmt-gap-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-3);
  flex-shrink: 0;
  margin-top: 0.45em;
}

/* Match CTA row */
.asmt-match-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* No-fit state */
.asmt-no-fit {
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.asmt-no-fit-icon {
  color: var(--accent-3);
  margin-bottom: 1rem;
}

.asmt-no-fit h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.asmt-no-fit p {
  font-size: 0.9rem;
  max-width: 500px;
  line-height: 1.7;
}

/* Results footer */
.asmt-results-footer {
  padding: 1.5rem 2rem;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.asmt-results-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.asmt-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.asmt-footer-actions .btn-primary {
  margin-left: auto;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .asmt-entry,
  .asmt-q-body,
  .asmt-progress,
  .asmt-nav,
  .asmt-results-header,
  .asmt-match,
  .asmt-no-fit,
  .asmt-results-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .asmt-options {
    grid-template-columns: 1fr;
  }

  .asmt-entry {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .asmt-match-header {
    flex-wrap: wrap;
  }

  .asmt-conf-badge {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .asmt-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .asmt-footer-actions .btn {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .asmt-footer-actions .btn-primary {
    margin-left: 0;
  }

  .asmt-match-cta {
    flex-direction: column;
  }

  .asmt-match-cta .btn {
    justify-content: center;
  }
}
