/* ============================================================
   Components — Cal AI pill selections, CTAs, cards
   ============================================================ */

/* ---------- Button / CTA ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 14px 22px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.005em;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  user-select: none;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--ink);
  color: #fff;
  width: 100%;
}
.btn--primary:disabled { opacity: 0.35; }

/* Inverse variant — white fill, dark text. Used on the welcome variant
   over the photo bg where a dark CTA fights with the dark sky scrim. */
.btn--primary.btn--primary-inverse {
  background: #FFFFFF;
  color: var(--ink);
}
.btn--primary.btn--primary-inverse:disabled { opacity: 0.45; }

.btn--ghost {
  background: transparent;
  color: var(--ink-muted);
  min-height: 44px;
  font-size: var(--fs-sm);
  padding: 8px 16px;
}

.btn--split {
  flex: 1;
  background: var(--ink);
  color: #fff;
}
.btn--split-secondary {
  flex: 1;
  background: var(--surface);
  color: var(--ink);
}

.btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* ---------- Pill select (Cal AI style) ----------
   Soft grey-bg pill with a white icon circle on the left. Selected =
   full black fill, white text, icon circle stays white. No card around
   the list. Multi-select variant shows a check on the right so the
   "pick more than one" affordance is obvious. */
.pill-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill {
  /* v3: dropped the grey surface fill in favour of a transparent
     pill with a hairline border. Lets the questionnaire screens
     breathe against the white app surface — the selected state
     (black fill) still pops cleanly. */
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 12px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  min-height: 76px;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-md);
  text-align: left;
  width: 100%;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.pill:active { transform: scale(0.985); }

/* Icon lives in a white circle — stays white in both states for contrast */
.pill__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out);
}
.pill__icon svg { width: 22px; height: 22px; }

.pill__label {
  flex: 1;
  font-weight: 600;
  line-height: 1.25;
}

.pill__sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: 2px;
  font-weight: 400;
  transition: color var(--dur-fast) var(--ease-out);
}

/* Check indicator — hidden by default (single-select doesn't need one:
   the black fill IS the selected state). Shown for multi-select so the
   user knows multiple choices are valid. */
.pill__check {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  background: #FFFFFF;
  border: 1.5px solid #D4D4D8;
  display: none;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.pill__check svg { width: 14px; height: 14px; stroke-width: 3; }

/* Multi-select: show the check box on the right — makes "pick any" obvious */
[data-multi-select] .pill__check { display: inline-flex; }

/* Selected — Cal AI's black-fill treatment */
.pill.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}
.pill.is-selected .pill__label { color: #FFFFFF; }
.pill.is-selected .pill__sub { color: rgba(255,255,255,0.65); }
/* Icon circle stays white with dark icon — mirrors Cal AI reference */
.pill.is-selected .pill__icon { background: #FFFFFF; color: var(--ink); }
/* Multi-select: check fills white when selected */
[data-multi-select] .pill.is-selected .pill__check {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--ink);
}

/* Container that used to wrap question lists — neutralised to a flat
   spacer so we didn't have to rip it out of every page's HTML. */
.q-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.q-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.q-card__hint {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: -4px;
}
.q-card .pill-list { gap: 12px; }

/* ---------- Text input ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__label {
  font-size: var(--fs-md);
  color: var(--ink);
  font-weight: 600;
}
.field__input {
  height: 56px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid #ECECEC;
  border-radius: 8px;
  font-size: var(--fs-md);
  color: var(--ink);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field__input::placeholder { color: var(--ink-soft); }
.field__input:focus {
  outline: none;
  border-color: var(--ink);
}

/* ---------- Info card (bordered) ---------- */
.card {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.card--plain {
  background: var(--bg);
  border: 1px solid var(--hairline);
  box-shadow: none;
}

/* ---------- Summary chip row (Cal AI style) ---------- */
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
}
.summary-row + .summary-row { margin-top: 8px; }
.summary-row__label { color: var(--ink-muted); }
.summary-row__value { font-weight: 600; color: var(--ink); }

/* ---------- Green "all done" tick chip ---------- */
.done-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
}
.done-chip__dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.done-chip__dot svg { width: 11px; height: 11px; stroke-width: 3.5; }

/* ---------- Bio / portrait card ---------- */
.bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 28px 20px;
  background: var(--surface-2);
  border-radius: var(--r-xl);
}
.bio__portrait {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
.bio__name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bio__role {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: 2px;
}
.bio__quote {
  font-size: var(--fs-md);
  color: var(--ink);
  line-height: 1.5;
  max-width: 32ch;
}
.bio__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.bio__badge {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-muted);
}

/* ---------- Awards grid ---------- */
.awards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.award {
  aspect-ratio: 1 / 1.1;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.award__icon {
  width: 28px; height: 28px;
  color: var(--accent-ink);
}
.award__icon svg { width: 100%; height: 100%; }
.award__title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.award__year {
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}

/* ---------- Stat strip ---------- */
.stat-strip {
  display: flex;
  justify-content: space-around;
  padding: 18px 12px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  text-align: center;
}
.stat-strip__cell { flex: 1; }
.stat-strip__num {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.stat-strip__label {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ---------- Testimonial mini-card ---------- */
.testimonials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.testimonial {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.testimonial__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.testimonial__name {
  font-size: var(--fs-sm);
  font-weight: 600;
}
.testimonial__role {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.testimonial__stars {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
  color: #E6A24C;
}
.testimonial__stars svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.testimonial__quote {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-muted);
}
/* v3: keywords that map to the user's Q2 worry are bolded inside the
   quote and given a soft yellow highlight, so the personalisation is
   visible without needing a separate explainer card above. */
.testimonial__quote strong {
  color: var(--ink);
  font-weight: 700;
  background: rgba(255, 224, 0, 0.45);
  padding: 0 3px;
  border-radius: 2px;
}

/* ---------- Rating card (laurels + score) — Cal AI 20 pattern ---------- */
.rating-card {
  background: var(--surface-2);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
/* Big amber star either side of the rating value. Square (24×24 viewBox)
   so the geometry stays clean. --flip class is a no-op for a symmetric
   star, kept on the markup for symmetry with the old laurel layout. */
.rating-card__laurel {
  width: 40px;
  height: 40px;
  color: #E6A24C;
  flex: 0 0 40px;
}
.rating-card__laurel--flip { /* star is symmetrical, no flip needed */ }
.rating-card__middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rating-card__score {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
  line-height: 1;
}
.rating-card__stars {
  display: inline-flex;
  gap: 2px;
  color: #E6A24C;
}
.rating-card__stars svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.rating-card__sub {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  font-weight: 500;
}

/* ---------- Avatar stack + users count ---------- */
.avatar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.avatar-stack__row {
  display: flex;
}
.avatar-stack__row img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  margin-left: -10px;
  background: var(--surface);
}
.avatar-stack__row img:first-child { margin-left: 0; }
.avatar-stack__label {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
}

/* Inline variant: avatars + label on a single row */
.avatar-stack--inline {
  flex-direction: row;
  justify-content: center;
  gap: 14px;
}
.avatar-stack--inline .avatar-stack__row img {
  width: 40px;
  height: 40px;
  border-width: 2px;
  margin-left: -8px;
}
.avatar-stack--inline .avatar-stack__label {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Splash fade-in ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp var(--dur-slow) var(--ease-out) both; }
.fade-up--d1 { animation-delay: 80ms; }
.fade-up--d2 { animation-delay: 160ms; }
.fade-up--d3 { animation-delay: 240ms; }
.fade-up--d4 { animation-delay: 320ms; }
.fade-up--d5 { animation-delay: 400ms; }

@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.pulse-soft { animation: pulseSoft 1.6s var(--ease-in-out) infinite; }
