/* ==========================================================================
   Valident Theme — Animation Components
   ==========================================================================
   Scroll-triggered reveal animations for all visual components.
   JS (IntersectionObserver) adds `.visible` class to trigger transitions.
   Brand design tokens defined in theme.css.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Base Animation Class
   -------------------------------------------------------------------------- */

.anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim.visible {
  opacity: 1;
  transform: translateY(0);
}


/* --------------------------------------------------------------------------
   2. Component Frame (browser chrome mockup)
   -------------------------------------------------------------------------- */

.component-frame {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 24, 70, 0.10);
  overflow: hidden;
}

.component-frame--wide {
  /* No extra width — container handles it */
}

.chrome-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--grey-50);
  border-bottom: 1px solid var(--grey-200);
}

.chrome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-300);
}

.chrome-url {
  margin-left: 10px;
  font-size: 0.625rem;
  color: var(--grey-400);
  font-family: monospace;
}


/* --------------------------------------------------------------------------
   3. Hero Form (referral-form animation)
   -------------------------------------------------------------------------- */

.hero-form {
  padding: 20px;
}

.hero-form__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hero-form__title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--navy);
}

.hero-form__badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-btn);
  background: var(--blue-pale);
  padding: 3px 8px;
  border-radius: 4px;
}

.hf-field {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  margin-bottom: 12px;
}

.hf-field.visible {
  opacity: 1;
  transform: translateY(0);
}

.hf-field label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-500);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hf-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--navy);
  background: var(--white);
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hf-field input:focus,
.hf-field input.typing {
  border-color: var(--blue-btn);
  box-shadow: 0 0 0 3px rgba(55, 176, 215, 0.15);
  outline: none;
}

.hf-submit {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease;
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: default;
  margin-top: 8px;
}

.hf-submit.visible {
  opacity: 1;
  transform: translateY(0);
}


/* --------------------------------------------------------------------------
   4. Workflow (workflow animation)
   -------------------------------------------------------------------------- */

.workflow-section {
  padding: 24px 20px;
}

.workflow-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.workflow-step.visible {
  opacity: 1;
  transform: scale(1);
}

.ws-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: background 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

.ws-dot--pending {
  background: var(--grey-100);
  color: var(--grey-400);
}

.ws-dot--active {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(55, 176, 215, 0.2);
}

.ws-dot--complete {
  background: #22c55e;
  color: var(--white);
}

.ws-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 8px;
}

.ws-sub {
  font-size: 0.625rem;
  color: var(--grey-400);
  margin-top: 2px;
}

.ws-connector {
  position: absolute;
  top: 22px;
  left: calc(50% + 26px);
  right: calc(-50% + 26px);
  height: 3px;
  background: var(--grey-100);
  border-radius: 2px;
  overflow: hidden;
}

.ws-connector-fill {
  height: 100%;
  width: 0;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.workflow-step:last-child .ws-connector {
  display: none;
}


/* --------------------------------------------------------------------------
   5. Dashboard Table (dashboard animation)
   -------------------------------------------------------------------------- */

.dashboard-section {
  padding: 0;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  color: var(--grey-400);
  border-bottom: 1px solid var(--grey-200);
  background: var(--grey-50);
}

.dash-table td {
  font-size: 0.8125rem;
  padding: 10px 12px;
  color: var(--grey-700);
  border-bottom: 1px solid var(--grey-100);
}

.dash-table__ref {
  font-weight: 500;
  color: var(--blue-dark);
}

.dash-table__practice {
  font-weight: 500;
  color: var(--navy);
}

.dash-table__date {
  color: var(--grey-400);
}

.data-row {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.data-row.visible {
  opacity: 1;
  transform: translateX(0);
}

.dash-table tbody tr:hover td {
  background: var(--grey-50);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.status-pill--new {
  background: var(--blue-pale);
  color: var(--blue-dark);
}

.status-pill--review {
  background: rgba(255, 181, 71, 0.15);
  color: #b8860b;
}

.status-pill--accepted {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-pill--complete {
  background: rgba(0, 24, 70, 0.06);
  color: var(--navy);
}


/* --------------------------------------------------------------------------
   6. Analytics Panel (analytics animation)
   -------------------------------------------------------------------------- */

.analytics-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ap-card {
  padding: 16px;
  background: var(--grey-50);
  border-radius: 12px;
}

.ap-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}

.ap-card__sub {
  font-size: 0.6875rem;
  color: var(--grey-400);
  margin-bottom: 12px;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
}

.mini-bars__bar {
  flex: 1;
  background: var(--blue);
  opacity: 0.7;
  border-radius: 2px 2px 0 0;
  height: 0;
  transition: height 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.mini-bars__bar:hover {
  opacity: 1;
}

.mini-bars__bar--today {
  background: var(--orange);
  opacity: 1;
}

.mini-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mini-donut-container {
  width: 80px;
  height: 80px;
  position: relative;
  flex-shrink: 0;
}

.mini-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.mini-donut circle {
  fill: none;
  transition: stroke-dasharray 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.mini-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.mini-donut-center__val {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}

.mini-donut-center__label {
  font-size: 0.5rem;
  color: var(--grey-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--grey-600);
}

.mini-legend__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   7. Conversation (conversation animation)
   -------------------------------------------------------------------------- */

.conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.conversation__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-200);
}

.conversation__ref {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.conversation__ref span {
  font-weight: 400;
  color: var(--grey-400);
}

.conversation__status {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.conversation__messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.message {
  display: flex;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.message--sent {
  flex-direction: row-reverse;
}

.message__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
}

.message__avatar--received {
  background: var(--blue-pale);
  color: var(--blue-dark);
}

.message__avatar--sent {
  background: rgba(0, 24, 70, 0.08);
  color: var(--navy);
}

.message__content {
  max-width: 380px;
}

.message--sent .message__content {
  margin-left: auto;
}

.message__bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.message--received .message__bubble {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  color: var(--grey-700);
  border-top-left-radius: 4px;
}

.message--sent .message__bubble {
  background: var(--navy);
  color: var(--white);
  border-top-right-radius: 4px;
}

.message__meta {
  font-size: 0.625rem;
  color: var(--grey-400);
  margin-top: 4px;
}

.message--sent .message__meta {
  text-align: right;
}

.message__bubble--typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 18px;
}

.message__bubble--typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grey-400);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.message__bubble--typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.message__bubble--typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}


/* --------------------------------------------------------------------------
   8. Waitlist Board (waitlist-board animation)
   -------------------------------------------------------------------------- */

.waitlist {
  padding: 16px;
}

.waitlist__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.waitlist__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
}

.waitlist__count {
  font-size: 0.75rem;
  color: var(--grey-400);
}

.waitlist-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.waitlist-col__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--grey-200);
}

.waitlist-col__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
}

.waitlist-col__count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-400);
  background: var(--grey-100);
  padding: 1px 8px;
  border-radius: 9999px;
}

.wl-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.wl-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.wl-card.moving {
  animation: card-move 0.6s ease;
}

.wl-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.wl-card__detail {
  font-size: 0.6875rem;
  color: var(--grey-500);
  margin-top: 2px;
}

.wl-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.wl-card__priority {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}

.wl-card__priority--high {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.wl-card__priority--medium {
  background: rgba(255, 181, 71, 0.15);
  color: #b8860b;
}

.wl-card__priority--low {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.wl-card__days {
  font-size: 0.6875rem;
  color: var(--grey-400);
}

@keyframes card-move {
  0%  { opacity: 0.5; transform: scale(0.95); }
  50% { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0, 24, 70, 0.12); }
  100% { opacity: 1; transform: scale(1); }
}


/* --------------------------------------------------------------------------
   9. Stat Counters (full-width stat rows)
   -------------------------------------------------------------------------- */

.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 0;
}

.stat-counter {
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stat-counter.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-counter__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-counter__label {
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-top: 4px;
}


/* --------------------------------------------------------------------------
   10. Before / After Comparison (before-after animation)
   -------------------------------------------------------------------------- */

.before-after {
  padding: 16px;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.before-after__panel {
  flex: 1;
  padding: 16px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.before-after__panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.before-after__panel--before {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.before-after__panel--after {
  background: rgba(34, 197, 94, 0.04);
  border: 1px solid rgba(34, 197, 94, 0.12);
}

.before-after__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.before-after__label--before {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

.before-after__label--after {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}

.before-after__items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ba-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ba-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.ba-item--problem {
  background: rgba(239, 68, 68, 0.05);
}

.ba-item--solution {
  background: rgba(34, 197, 94, 0.05);
}

.ba-item__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ba-item--problem .ba-item__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.ba-item--solution .ba-item__icon {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.ba-item__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.ba-item__desc {
  font-size: 0.6875rem;
  color: var(--grey-500);
  margin-top: 1px;
}

.before-after__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--grey-300);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.before-after__divider.visible {
  opacity: 1;
}


/* --------------------------------------------------------------------------
   11. Audit Trail (audit-trail animation)
   -------------------------------------------------------------------------- */

.audit-trail {
  padding: 16px;
}

.audit-trail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-200);
}

.audit-trail__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
}

.audit-trail__ref {
  font-size: 0.75rem;
  color: var(--grey-400);
}

.audit-trail__entries {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.at-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: relative;
}

.at-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.at-entry__time {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--grey-400);
  width: 36px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 2px;
  font-family: monospace;
}

.at-entry__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.at-entry__dot--blue { background: var(--blue); }
.at-entry__dot--grey { background: var(--grey-300); }
.at-entry__dot--green { background: #22c55e; }
.at-entry__dot--navy { background: var(--navy); }

/* Vertical connecting line */
.at-entry:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 52px;
  top: 24px;
  bottom: -10px;
  width: 2px;
  background: var(--grey-100);
}

.at-entry__content {
  flex: 1;
}

.at-entry__action {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.4;
}

.at-entry__meta {
  font-size: 0.6875rem;
  color: var(--grey-400);
  margin-top: 2px;
}


/* --------------------------------------------------------------------------
   12. Integration Panel (integration animation)
   -------------------------------------------------------------------------- */

.integration-panel {
  padding: 20px;
}

.integration__header {
  margin-bottom: 16px;
}

.integration__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
}

.integration__sub {
  font-size: 0.75rem;
  color: var(--grey-400);
  margin-top: 2px;
}

.integration__blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.int-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--grey-200);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

.int-block.visible {
  opacity: 1;
  transform: translateX(0);
}

.int-block--active {
  border-color: var(--blue-btn);
  background: rgba(55, 176, 215, 0.03);
}

.int-block--pending {
  border-style: dashed;
  border-color: var(--grey-300);
}

.int-block__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.int-block__icon--blue {
  background: var(--blue-pale);
  color: var(--blue-btn);
}

.int-block__icon--navy {
  background: rgba(0, 24, 70, 0.08);
  color: var(--navy);
}

.int-block__icon--orange {
  background: rgba(255, 181, 71, 0.15);
  color: #b8860b;
}

.int-block__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

.int-block__desc {
  font-size: 0.6875rem;
  color: var(--grey-400);
  margin-left: auto;
}

.int-block__check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.int-block__toggle {
  flex-shrink: 0;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--grey-200);
  position: relative;
  transition: background 0.3s ease;
}

.int-block__toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.3s ease;
}

.int-block--active .int-block__toggle {
  background: var(--blue);
}

.int-block--active .int-block__toggle::after {
  transform: translateX(14px);
}

.integration__extras {
  padding-top: 12px;
  border-top: 1px solid var(--grey-100);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.integration__extras.visible {
  opacity: 1;
  transform: translateY(0);
}

.int-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--grey-500);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.int-extra.visible {
  opacity: 1;
}

.int-extra svg {
  color: var(--grey-400);
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   13. Timeline (timeline animation)
   -------------------------------------------------------------------------- */

.timeline-panel {
  padding: 20px 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertical line */
.timeline-panel::before {
  content: '';
  position: absolute;
  left: 68px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: var(--grey-100);
}

.tl-entry {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tl-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.tl-entry__year {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
  width: 36px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 2px;
}

.tl-entry__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--grey-300);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.tl-entry__dot--highlight {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(55, 176, 215, 0.2);
}

.tl-entry__content {
  flex: 1;
}

.tl-entry__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.tl-entry__desc {
  font-size: 0.6875rem;
  color: var(--grey-500);
  margin-top: 2px;
  line-height: 1.4;
}


/* --------------------------------------------------------------------------
   14. Security Shield (security-shield animation)
   -------------------------------------------------------------------------- */

.sec-panel {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.sec-panel__shield {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-pale), rgba(55, 176, 215, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-btn);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.sec-panel__shield.visible {
  opacity: 1;
  transform: scale(1);
}

.sec-panel__features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sec-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: var(--white);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.sec-feature.visible {
  opacity: 1;
  transform: translateY(0);
}

.sec-feature__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sec-feature__icon--blue {
  background: var(--blue-pale);
  color: var(--blue-btn);
}

.sec-feature__icon--navy {
  background: rgba(0, 24, 70, 0.08);
  color: var(--navy);
}

.sec-feature__icon--green {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.sec-feature__text {
  flex: 1;
}

.sec-feature__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.sec-feature__desc {
  font-size: 0.6875rem;
  color: var(--grey-400);
  margin-top: 1px;
}

.sec-feature__status {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.sec-feature__status--active {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}

.sec-panel__bar {
  width: 100%;
  height: 28px;
  background: var(--grey-100);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sec-panel__bar.visible {
  opacity: 1;
}

.sec-panel__bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #22c55e);
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sec-panel__bar.visible .sec-panel__bar-fill {
  width: 100%;
}

.sec-panel__bar-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--white);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease 0.8s;
}

.sec-panel__bar.visible .sec-panel__bar-label {
  opacity: 1;
}


/* --------------------------------------------------------------------------
   15. Secure Channel (vResponse)
   -------------------------------------------------------------------------- */

.sch-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 16px 12px;
  min-height: 220px;
}

.sch-practice {
  flex: 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sch-practice.visible { opacity: 1; transform: translateY(0); }

.sch-practice__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sch-practice__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-btn);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sch-practice__avatar--alt {
  background: rgba(0, 24, 70, 0.08);
  color: var(--navy);
}

.sch-practice__name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}

.sch-practice__role {
  font-size: 0.625rem;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sch-practice__messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sch-msg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.6875rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.sch-msg.visible { opacity: 1; transform: translateX(0); }

.sch-msg--out {
  background: var(--blue-pale);
  color: var(--navy);
}
.sch-msg--in {
  background: var(--grey-50);
  color: var(--grey-700);
}

.sch-msg__text {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sch-msg__time {
  font-size: 0.5625rem;
  color: var(--grey-400);
  flex-shrink: 0;
}

/* Central encrypted channel strip */
.sch-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 56px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}
.sch-channel.visible { opacity: 1; }

.sch-channel__line {
  flex: 1;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--grey-300), transparent);
}

.sch-channel__lock {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-btn);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sch-channel__label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--grey-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  writing-mode: horizontal-tb;
}


/* --------------------------------------------------------------------------
   16. Patient Journey (vWaitlist)
   -------------------------------------------------------------------------- */

.pj-container {
  padding: 16px;
}

/* Stage progress track */
.pj-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
}

.pj-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-400);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.5s ease;
}
.pj-stage.visible { opacity: 1; transform: translateY(0); }
.pj-stage.active { color: var(--blue-btn); }
.pj-stage.complete { color: var(--success); }

.pj-stage__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grey-300);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
.pj-stage.active .pj-stage__dot {
  background: var(--blue-btn);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}
.pj-stage.complete .pj-stage__dot {
  background: var(--success);
}

.pj-stage__connector {
  width: 40px;
  height: 2px;
  background: var(--grey-200);
  margin: 0 4px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pj-stage__connector.visible { opacity: 1; }

.pj-stage__connector-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--blue-btn);
  transition: width 0.8s ease;
}
.pj-stage__connector.filled .pj-stage__connector-fill {
  width: 100%;
}

/* Patient card */
.pj-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.pj-card.visible { opacity: 1; transform: translateY(0); }

.pj-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pj-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-btn);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pj-card__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.pj-card__treatment {
  font-size: 0.6875rem;
  color: var(--grey-500);
}

.pj-card__priority {
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pj-card__priority--high {
  background: rgba(239, 68, 68, 0.08);
  color: var(--error);
}
.pj-card__priority--medium {
  background: rgba(255, 181, 71, 0.12);
  color: var(--orange-dark);
}
.pj-card__priority--low {
  background: rgba(34, 197, 94, 0.08);
  color: var(--success);
}

.pj-card__details {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.pj-card__detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pj-card__label {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-400);
  font-weight: 500;
}

.pj-card__value {
  font-size: 0.75rem;
  color: var(--navy);
  font-weight: 500;
}

.pj-card__progress {
  height: 4px;
  background: var(--grey-100);
  border-radius: 2px;
  overflow: hidden;
}

.pj-card__progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue-btn), var(--success));
  border-radius: 2px;
  transition: width 1.2s ease;
}

/* Activity feed */
.pj-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pj-feed__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--grey-100);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pj-feed__item.visible { opacity: 1; transform: translateX(0); }
.pj-feed__item--future { opacity: 0; }
.pj-feed__item--future.visible { opacity: 0.45; transform: translateX(0); }

.pj-feed__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pj-feed__dot--blue  { background: var(--blue-btn); }
.pj-feed__dot--grey  { background: var(--grey-400); }
.pj-feed__dot--green { background: var(--success); }
.pj-feed__dot--navy  { background: var(--navy); }

.pj-feed__text {
  font-size: 0.6875rem;
  color: var(--navy);
  flex: 1;
}

.pj-feed__time {
  font-size: 0.625rem;
  color: var(--grey-400);
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  /* Cap animation width in single-column split layout */
  .component-frame {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .workflow-steps {
    flex-direction: column;
    gap: 16px;
  }

  .ws-connector {
    display: none;
  }

  .waitlist-columns {
    grid-template-columns: 1fr;
  }

  .mini-donut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-row {
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat-counter {
    flex: 0 0 calc(50% - 12px);
  }

  /* Dashboard — scrollable container + hide non-essential columns */
  .dashboard-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-table {
    font-size: 0.625rem;
    min-width: 0;
    width: 100%;
  }

  .dash-table th,
  .dash-table td {
    padding: 6px 5px;
    white-space: nowrap;
  }

  /* Hide Type, Referring Practice and Date columns on mobile */
  .dash-table th:nth-child(3),
  .dash-table td:nth-child(3),
  .dash-table th:nth-child(4),
  .dash-table td:nth-child(4),
  .dash-table th:nth-child(6),
  .dash-table td:nth-child(6) {
    display: none;
  }

  .conversation__messages {
    gap: 12px;
  }

  .message__content {
    max-width: 280px;
  }

  .before-after {
    flex-direction: column;
    gap: 8px;
  }

  .before-after__divider {
    transform: rotate(90deg);
    padding: 4px 0;
  }

  .audit-trail__header {
    flex-direction: column;
    gap: 4px;
  }

  .at-entry:not(:last-child)::after {
    left: 52px;
  }

  .int-block__desc {
    display: none;
  }

  .integration__extras {
    gap: 6px;
  }

  .timeline-panel::before {
    left: 60px;
  }

  /* Component frames — ensure contained on small screens */
  .component-frame {
    max-width: 100%;
    border-radius: 12px;
  }

  .chrome-bar {
    padding: 8px 10px;
    gap: 4px;
  }

  .chrome-dot {
    width: 6px;
    height: 6px;
  }

  .chrome-url {
    font-size: 0.5625rem;
  }

  /* Waitlist — tighter spacing */
  .waitlist {
    padding: 12px;
  }

  .wl-card {
    padding: 8px;
  }

  .wl-card__name {
    font-size: 0.75rem;
  }

  .wl-card__detail {
    font-size: 0.625rem;
  }

  /* Conversation — tighter on mobile */
  .message__bubble {
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  /* Security shield — compact on mobile */
  .sec-panel {
    padding: 16px;
    gap: 14px;
  }

  .sec-panel__shield {
    width: 56px;
    height: 56px;
  }

  .sec-panel__shield svg {
    width: 36px;
    height: 36px;
  }

  .sec-feature {
    padding: 8px 10px;
    gap: 10px;
  }

  .sec-feature__desc {
    display: none;
  }

  /* Secure Channel — stack on mobile */
  .sch-layout {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .sch-channel {
    flex-direction: row;
    width: 100%;
    gap: 8px;
  }

  .sch-channel__line {
    flex: 1;
    height: 1px;
    width: auto;
    background: linear-gradient(90deg, transparent, var(--grey-300), transparent);
  }

  .sch-practice__messages {
    gap: 4px;
  }

  .sch-msg {
    padding: 5px 8px;
    font-size: 0.625rem;
  }

  /* Patient Journey — compact on mobile */
  .pj-container {
    padding: 12px;
  }

  .pj-stages {
    margin-bottom: 14px;
  }

  .pj-stage {
    font-size: 0.625rem;
  }

  .pj-stage__connector {
    width: 24px;
  }

  .pj-card {
    padding: 10px;
  }

  .pj-card__details {
    gap: 10px;
    flex-wrap: wrap;
  }

  .pj-feed__item {
    padding: 6px 0;
  }

  .pj-feed__text {
    font-size: 0.625rem;
  }
}
