/* ==========================================================================
   profile.css — Policy holder profile, policies, life events, engagement
   ========================================================================== */

/* --------------------------------------------------------------------------
   Profile header
   -------------------------------------------------------------------------- */

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  background-color: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-card);
}

.profile-header__info {
  flex: 1;
}

.profile-header__name {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}

.profile-header__occupation {
  font-size: var(--text-base);
  color: var(--text-brand);
  margin-bottom: var(--space-4);
}

.profile-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.profile-header__meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-header__meta-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}

.profile-header__meta-value {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Score widget */
.profile-header__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: var(--space-2);
}

.profile-header__score-ring {
  position: relative;
  width: 5rem;
  height: 5rem;
}

.profile-header__score-ring svg {
  transform: rotate(-90deg);
}

.profile-header__score-ring circle:last-child {
  transition: stroke-dashoffset 0.6s ease;
}

.profile-header__score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.profile-header__score-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Policy list
   -------------------------------------------------------------------------- */

.policy-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.policy-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.policy-item__type {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background-color: var(--interactive-muted);
  color: var(--text-secondary);
  min-width: 4rem;
  text-align: center;
}

.policy-item__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.policy-item__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.policy-item__detail-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  font-weight: var(--font-weight-bold);
}

.policy-item__detail-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}

.policy-item__status {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.policy-item__status--active {
  background-color: #DCFCE7;
  color: #166534;
}

.policy-item__status--expired {
  background-color: #FEE2E2;
  color: #991B1B;
}

[data-theme="dark"] .policy-item__status--active {
  background-color: #14532D;
  color: #4ADE80;
}

[data-theme="dark"] .policy-item__status--expired {
  background-color: #450A0A;
  color: #FCA5A5;
}

/* --------------------------------------------------------------------------
   Life event timeline
   -------------------------------------------------------------------------- */

.life-event-timeline {
  list-style: none;
  position: relative;
  padding-left: var(--space-8);
}

.life-event-timeline::before {
  content: '';
  position: absolute;
  left: calc(var(--space-3) - 1px);
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background-color: var(--border-default);
}

.life-event-item {
  position: relative;
  margin-bottom: var(--space-5);
}

.life-event-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) + var(--space-2));
  top: 0.375rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--surface-card);
}

.life-event-item--marriage::before    { background-color: var(--event-marriage); }
.life-event-item--newChild::before    { background-color: var(--event-newchild); }
.life-event-item--homePurchase::before { background-color: var(--event-homepurchase); }
.life-event-item--retirement::before  { background-color: var(--event-retirement); }
.life-event-item--divorce::before     { background-color: var(--event-divorce); }
.life-event-item--jobChange::before   { background-color: var(--event-jobchange); }

.life-event-item__type {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.life-event-item__date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.life-event-item__notes {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* --------------------------------------------------------------------------
   Engagement history
   -------------------------------------------------------------------------- */

.engagement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.engagement-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--space-4);
  padding: var(--space-4);
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.engagement-item__date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.engagement-item__content {
  flex: 1;
}

.engagement-item__channel {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.engagement-item__notes {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-normal);
}

.engagement-item__outcome {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.engagement-item__outcome--interested {
  background-color: #DCFCE7;
  color: #166534;
}

.engagement-item__outcome--not_interested {
  background-color: var(--interactive-muted);
  color: var(--text-secondary);
}

.engagement-item__outcome--callback_requested {
  background-color: #DBEAFE;
  color: #1D4ED8;
}

.engagement-item__outcome--policy_updated {
  background-color: #FEF3C7;
  color: #92400E;
}

[data-theme="dark"] .engagement-item__outcome--interested {
  background-color: #14532D;
  color: #4ADE80;
}

[data-theme="dark"] .engagement-item__outcome--callback_requested {
  background-color: #1E3A5F;
  color: #93C5FD;
}

[data-theme="dark"] .engagement-item__outcome--policy_updated {
  background-color: #422006;
  color: #FCD34D;
}
