/* ==========================================================================
   REVE Chat Version 4 homepage: "Let AI take the lead" (AI-to-human handoff).
   Markup: template-parts/rc-v4-homepage/human.php. Behaviour: js/rc-v4-homepage/human.js.
   Design: Human v4 in reve-chat-website src/creative/Rest.jsx (white section, dark example card).
   Shared tokens, container, title/subtitle and reveal come from css/rc-v4-base.css.
   ========================================================================== */

.rc-human {
  --rc-human-card: #0a0912;               /* example card background */
  --rc-human-fg: #f4f2fb;                 /* text on the card */
  --rc-human-fg-2: rgba(244, 242, 251, 0.78);
  --rc-human-fg-3: rgba(244, 242, 251, 0.6);
  --rc-human-line: rgba(255, 255, 255, 0.11);
  --rc-human-lavender: #b79cff;
  --rc-human-mint: #3ddbb0;
  --rc-human-coral: #ff7a59;
  --rc-human-accent: var(--rc-human-mint);   /* status, card icon (coral for the specialist example) */
  --rc-human-dot: var(--rc-human-lavender);  /* side list bullets */
  background: #ffffff;
  color: var(--rc-ink);
}

/* ---------- layout: intro left, example right; one column below 980px ---------- */
.rc-human .rc-human-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

/* ---------- intro ---------- */
.rc-human .rc-human-copy { gap: 16px; }
.rc-human .rc-human-title { max-width: none; }
/* design: 52ch; Chrome resolves it to 464px on the reference (ch from the fallback font), so it is fixed in px */
.rc-human .rc-human-intro { max-width: 464px; margin-bottom: 4px; }

/* tab bar under the intro (desktop) */
.rc-human .rc-human-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px;
  border-radius: 999px; background: #eceaf3; align-self: flex-start;
}
.rc-human .rc-human-tab {
  padding: 11px 20px; border: 0; border-radius: 999px; background: transparent;
  font-family: var(--rc-font); font-size: 14.5px; font-weight: 500; line-height: 1.55; color: #4a4659;
  transition: background-color 0.2s, color 0.2s;
}
.rc-human .rc-human-tab.is-on { background: var(--rc-ink); color: #fff; }
.rc-human .rc-human-tabs-mobile { display: none; }

/* bullet list with violet check marks */
.rc-human .rc-human-checks {
  display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none;
  animation: rc-human-swap 0.5s var(--rc-ease);
}
.rc-human .rc-human-checks li {
  position: relative; margin: 0; padding: 0 0 0 32px;
  font-family: var(--rc-font-text); font-size: 16px; line-height: 1.6; color: var(--rc-ink-2);
}
.rc-human .rc-human-checks li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--rc-violet);
}
.rc-human .rc-human-checks li::after {
  content: ''; position: absolute; left: 6px; top: 8px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(40deg);
}

/* ---------- example card ---------- */
.rc-human .rc-human-handoff {
  overflow: hidden; border: 1px solid #2a2542; border-radius: 24px;
  background: var(--rc-human-card); color: var(--rc-human-fg);
  font-size: 16px; line-height: 1.55;
  box-shadow: 0 40px 80px -30px rgba(40, 20, 120, 0.5);
  transition: box-shadow 0.5s, opacity 0.8s var(--rc-ease), transform 0.8s var(--rc-ease);
}
.rc-human .rc-human-handoff.is-expert {
  --rc-human-accent: var(--rc-human-coral);
  --rc-human-dot: var(--rc-human-coral);
  box-shadow: 0 40px 80px -30px rgba(255, 122, 89, 0.4);
}
.rc-human .rc-human-handoff :where(b) { font-weight: 700; }

.rc-human .rc-human-handoff-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--rc-human-line);
}
.rc-human .rc-human-handoff-sub { font-size: smaller; line-height: 1.55; color: var(--rc-human-fg-3); }
.rc-human .rc-human-handoff-status {
  gap: 7px; margin-left: auto; font-size: 12px; line-height: 1.55; color: var(--rc-human-accent);
}
.rc-human .rc-human-handoff-status-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.rc-human .rc-human-handoff-body {
  display: grid; grid-template-columns: 1.5fr 1fr;
  animation: rc-human-swap 0.5s var(--rc-ease);
}
.rc-human .rc-human-handoff-chat { gap: 12px; min-height: 320px; padding: 18px; }
.rc-human .rc-human-handoff-label {
  font-family: var(--rc-font-label); font-size: 10px; font-weight: 400; line-height: 1.55;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--rc-human-lavender);
}

/* chat bubbles */
.rc-human .rc-human-bubble { max-width: 88%; padding: 12px 15px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.rc-human .rc-human-bubble-user { align-self: flex-end; background: #2a2542; border-bottom-right-radius: 5px; }
.rc-human .rc-human-bubble-ai { align-self: flex-start; background: linear-gradient(135deg, #6a4be8, #4d6dff); border-bottom-left-radius: 5px; }
.rc-human .is-expert .rc-human-bubble-ai { background: linear-gradient(135deg, #e0603f, #c04a8a); }

/* result card (order / specialist) */
.rc-human .rc-human-handoff-card {
  gap: 12px; padding: 12px 14px; border: 1px solid var(--rc-human-line); border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.rc-human .rc-human-handoff-card-icon {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(61, 219, 176, 0.16); color: var(--rc-human-accent);
  font-style: normal; font-weight: 700; line-height: 1.55;
}
/* coral icon for the specialist example */
.rc-human .is-expert .rc-human-handoff-card-icon { background: rgba(255, 122, 89, 0.16); }
.rc-human .rc-human-handoff-card-text { font-size: 13px; line-height: 1.55; }
.rc-human .rc-human-handoff-card-text span { color: var(--rc-human-fg-3); }

.rc-human .rc-human-handoff-input {
  margin-top: auto; padding: 10px; border: 1px solid var(--rc-human-line); border-radius: 9px;
  color: var(--rc-human-fg-3);
}

/* side panel: activity / handoff summary */
.rc-human .rc-human-handoff-side {
  gap: 12px; padding: 18px; border-left: 1px solid var(--rc-human-line); background: rgba(255, 255, 255, 0.025);
}
.rc-human .rc-human-handoff-steps { gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.55; color: var(--rc-human-fg-2); }
.rc-human .rc-human-handoff-steps li { position: relative; margin: 0; padding-left: 14px; }
.rc-human .rc-human-handoff-steps li::before {
  content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--rc-human-dot);
}
.rc-human .rc-human-handoff-foot {
  padding-top: 14px; border-top: 1px solid var(--rc-human-line); font-size: 13px; line-height: 1.55;
}
.rc-human .rc-human-handoff-foot span { color: var(--rc-human-fg-3); }

@keyframes rc-human-swap { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes rc-human-fade { from { opacity: 0; transform: translateY(8px); } }

/* ---------- tablet: one column ---------- */
@media (max-width: 980px) {
  .rc-human .rc-human-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phones / tablet portrait: heading, intro, bullets, example, floating tab bar ---------- */
@media (max-width: 860px) {
  .rc-human .rc-human-grid { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .rc-human .rc-human-copy { gap: 20px; }
  .rc-human .rc-human-tabs-desktop { display: none; }
  .rc-human .rc-human-checks { align-self: stretch; min-height: 116px; }
  .rc-human .rc-human-demo { display: flex; flex-direction: column; gap: 16px; }

  /* both examples take the same height, so switching never moves the bar or the content below */
  .rc-human .rc-human-handoff { min-height: 662px; }
  .rc-human .rc-human-handoff-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 18px;
  }
  .rc-human .rc-human-handoff-app { grid-column: 1; }
  .rc-human .rc-human-handoff-sub { grid-column: 1; grid-row: 2; }
  .rc-human .rc-human-handoff-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
  .rc-human .rc-human-handoff-body { animation: rc-human-fade 0.35s ease; }

  /* floating tab bar: rides 12px above the bottom edge while the example is on screen */
  .rc-human .rc-human-tabs-mobile {
    position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-self: stretch; padding: 6px; margin: 0;
    border: 1px solid rgba(20, 18, 31, 0.1); border-radius: 999px; background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 36px -16px rgba(40, 30, 110, 0.5), 0 2px 6px rgba(20, 18, 31, 0.06);
    -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  }
  .rc-human .rc-human-tabs-mobile .rc-human-tab {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0;
    height: 44px; min-height: 44px; padding: 0 10px; border-radius: 999px; background: transparent;
    font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; text-align: center; color: #67637a;
    transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
  }
  .rc-human .rc-human-tabs-mobile .rc-human-tab.is-on {
    background: linear-gradient(135deg, #5b3fd0, #7a62ee); color: #fff; box-shadow: 0 8px 18px -8px rgba(91, 63, 208, 0.7);
  }
  .rc-human .rc-human-tabs-mobile .rc-human-tab:hover:not(.is-on) { background: rgba(91, 63, 208, 0.06); color: var(--rc-ink); }
}

@media (max-width: 640px) {
  .rc-human .rc-human-handoff-body { grid-template-columns: minmax(0, 1fr); }
  .rc-human .rc-human-handoff-side { border-left: 0; border-top: 1px solid var(--rc-human-line); }
}
@media (max-width: 380px) {
  .rc-human .rc-human-handoff { min-height: 700px; }
  .rc-human .rc-human-checks { min-height: 142px; }
}
@media (max-width: 340px) {
  .rc-human .rc-human-handoff { min-height: 770px; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-human .rc-human-checks,
  .rc-human .rc-human-handoff-body { animation: none; }
}
