/* ==========================================================================
   Product UI — the simulated Synthetix software surfaces
   (hero console, interactive call demo, shared call primitives)
   ========================================================================== */

/* ---- Shared ---------------------------------------------------------- */

.biz-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--night-4), var(--night-2));
  box-shadow: inset 0 0 0 1px var(--night-line-strong);
  color: var(--night-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.biz-mark--light {
  background: var(--white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Owner photo in place of initials */
.biz-mark--photo {
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.biz-mark--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pane-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--night-text-3);
}

.pane-label--dim {
  opacity: 0.7;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.call-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--night-text-3);
  transition: background-color var(--dur-md) var(--ease-standard);
}

.call-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: transparent;
  opacity: 0;
}

[data-state="ringing"] .call-dot {
  background: var(--amber);
}

[data-state="ringing"] .call-dot::after {
  color: var(--amber);
  animation: live-ping 1.1s var(--ease-out) infinite;
}

[data-state="live"] .call-dot,
.mini-call .call-dot {
  background: var(--signal);
}

[data-state="live"] .call-dot::after,
.mini-call .call-dot::after {
  color: var(--signal);
  animation: live-ping 2s var(--ease-out) infinite;
}

.call-timer {
  font-size: 12px;
  color: var(--night-text-3);
  font-variant-numeric: tabular-nums;
}

/* ---- Transcript + messages ------------------------------------------ */

.transcript {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}

.msg {
  display: grid;
  gap: 5px;
  max-width: 88%;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity var(--dur-lg) var(--ease-emphasized), transform var(--dur-lg) var(--ease-emphasized);
}

.msg.is-in {
  opacity: 1;
  transform: none;
}

.msg-who {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--night-text-3);
}

.msg-text {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--night-text);
  text-wrap: pretty;
}

.msg--ai {
  align-self: flex-start;
}

.msg--ai .msg-who {
  color: var(--violet-soft);
}

.msg--ai .msg-text {
  background: rgba(221, 161, 140, 0.11);
  box-shadow: inset 0 0 0 1px rgba(221, 161, 140, 0.22);
  border-top-left-radius: 4px;
}

.msg--caller {
  align-self: flex-end;
  justify-items: end;
}

.msg--caller .msg-text {
  background: var(--night-3);
  box-shadow: inset 0 0 0 1px var(--night-line);
  border-top-right-radius: 4px;
}

.msg--system {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: none;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--night-text-2);
  box-shadow: inset 0 0 0 1px var(--night-line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.msg--system .sys-ico {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--blue-soft);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.msg--system.is-done .sys-ico {
  width: 8px;
  height: 8px;
  margin: 2px;
  animation: none;
  border: 0;
  background: var(--signal);
}

.msg--system.is-done {
  color: var(--signal-soft);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: currentColor;
  opacity: 0.7;
  animation: caret 1s steps(2) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

/* ---- Fields ---------------------------------------------------------- */

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 20px;
}

.fields-wide {
  grid-column: 1 / -1;
}

.fields dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--night-text-3);
}

.fields dd {
  margin-top: 3px;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--night-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--dur-md) var(--ease-standard), background-color 1.2s var(--ease-standard);
}

.fields dd.is-filled {
  color: var(--night-text);
}

.fields dd.is-flash {
  background: rgba(184, 201, 181, 0.22);
  transition-duration: var(--dur-md), 0s;
}

/* ---- Slots ----------------------------------------------------------- */

.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--night-text-3);
  box-shadow: inset 0 0 0 1px var(--night-line);
  transition: color var(--dur-md) var(--ease-standard), box-shadow var(--dur-md) var(--ease-standard),
    background-color var(--dur-md) var(--ease-standard), transform var(--dur-md) var(--ease-emphasized);
}

.slot small {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.slot.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.1s var(--ease-standard) infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.slot.is-taken {
  color: var(--night-text-3);
}

.slot.is-taken .slot-time {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.slot.is-open {
  color: var(--night-text);
  box-shadow: inset 0 0 0 1px var(--night-line-strong);
}

.slot.is-open small {
  color: var(--signal-soft);
}

.slot.is-selected {
  color: #fff;
  background: rgba(184, 201, 181, 0.18);
  box-shadow: inset 0 0 0 1px var(--blue-soft), 0 0 0 4px rgba(184, 201, 181, 0.14);
  transform: scale(1.02);
}

.slot.is-selected small {
  color: var(--blue-soft);
}

/* ---- Confirmation ---------------------------------------------------- */

.confirm {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(47, 191, 113, 0.09);
  box-shadow: inset 0 0 0 1px rgba(47, 191, 113, 0.26);
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.98);
  transition: opacity var(--dur-lg) var(--ease-emphasized), transform var(--dur-lg) var(--ease-emphasized);
}

.confirm.is-in {
  opacity: 1;
  transform: none;
}

.confirm-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--signal);
  color: #04140b;
}

.confirm-icon .icon {
  stroke-width: 2.2;
}

.confirm-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.confirm-text strong {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--night-text);
}

.confirm-text span {
  font-size: 12px;
  color: var(--night-text-2);
}

/* ==========================================================================
   Hero console
   ========================================================================== */

.console-figure {
  position: relative;
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
}

.console-rise {
  will-change: transform;
}

.console {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--night);
  box-shadow: var(--shadow-product);
}

.console::before {
  /* top-edge highlight */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  z-index: 1;
}

.console-top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: var(--night-2);
  border-bottom: 1px solid var(--night-line);
}

.console-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.console-brand .logo-mark {
  width: 20px;
  height: 20px;
}

.console-tabs {
  display: none;
  gap: 2px;
  margin-left: 12px;
}

.console-tabs span {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--night-text-3);
}

.console-tabs .is-active {
  color: var(--night-text);
  background: var(--night-3);
}

.console-meta {
  margin-left: auto;
  min-width: 0;
}

.console-meta .chip {
  height: 24px;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 479px) {
  .hide-sm {
    display: none;
  }
}

.console-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.pane {
  padding: 18px;
  min-width: 0;
}

.pane + .pane {
  border-top: 1px solid var(--night-line);
}

.biz {
  display: flex;
  align-items: center;
  gap: 11px;
}

.biz-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.biz-text strong {
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-text span {
  font-size: 11.5px;
  color: var(--night-text-3);
}

.call-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--night-2);
  box-shadow: inset 0 0 0 1px var(--night-line);
  transition: box-shadow var(--dur-lg) var(--ease-standard);
}

[data-state="ringing"] .call-card {
  box-shadow: inset 0 0 0 1px rgba(240, 164, 58, 0.45), 0 0 0 4px rgba(240, 164, 58, 0.08);
}

[data-state="live"] .call-card {
  box-shadow: inset 0 0 0 1px rgba(221, 161, 140, 0.4), 0 0 32px -8px rgba(221, 161, 140, 0.35);
}

.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.call-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--night-text-2);
}

.call-number {
  margin: 10px 0 14px;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--night-text);
}

.call-speaker {
  margin-top: 10px;
  font-size: 10.5px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--night-text-3);
}

.mini-steps {
  display: none;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.mini-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--night-text-3);
  transition: color var(--dur-md) var(--ease-standard);
}

.mini-steps li > span {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--night-line-strong);
  transition: background-color var(--dur-md) var(--ease-standard), box-shadow var(--dur-md) var(--ease-standard);
}

.mini-steps li.is-done {
  color: var(--night-text);
}

.mini-steps li.is-done > span {
  background: var(--blue-soft);
  box-shadow: none;
}

.mini-steps li.is-done > span::after,
.actions li.is-done .a-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 3.5px;
  height: 6.5px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.pane-transcript {
  display: flex;
  flex-direction: column;
}

.pane-transcript .transcript {
  height: 300px;
}

/* Tablet: call + transcript side by side, booking full width */
@media (min-width: 768px) {
  .console-tabs {
    display: flex;
  }

  .console-body {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .pane + .pane {
    border-top: 0;
  }

  .pane-call {
    border-right: 1px solid var(--night-line);
  }

  .pane-transcript .transcript {
    height: auto;
    flex: 1;
  }

  .pane-booking {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
    border-top: 1px solid var(--night-line) !important;
  }

  .pane-booking .pane-head:first-child,
  .pane-booking .fields {
    grid-column: 1;
  }

  .pane-booking .pane-head:nth-of-type(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .pane-booking .slots {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  .pane-booking .confirm {
    grid-column: 1 / -1;
  }
}

/* Desktop: three-pane product layout */
@media (min-width: 1100px) {
  .console-body {
    grid-template-columns: 290px minmax(0, 1fr) 336px;
    height: 480px;
  }

  .pane {
    padding: 22px;
  }

  .mini-steps {
    display: grid;
  }

  .pane-booking {
    display: block;
    grid-column: auto;
    border-top: 0 !important;
    border-left: 1px solid var(--night-line);
  }

  .pane-booking .pane-head:nth-of-type(2) {
    margin-top: 4px;
  }
}

.console-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
  padding-inline: 4px;
  font-size: var(--fs-xs);
  color: var(--mute);
}

.caption-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--graphite);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: color var(--dur-sm) var(--ease-standard), box-shadow var(--dur-sm) var(--ease-standard);
}

.caption-btn:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

/* ==========================================================================
   Interactive call experience
   ========================================================================== */

.xp {
  margin-top: var(--section-y-sm);
  padding: clamp(18px, 1rem + 2vw, 40px);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-product);
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

.xp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}

.xp-head > div {
  display: grid;
  gap: 12px;
}

.xp-title {
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.xp-head .chip {
  height: auto;
  min-height: 28px;
  padding-block: 4px;
  white-space: normal;
}

.xp-grid {
  display: grid;
  gap: 14px;
  margin-top: clamp(20px, 1rem + 1.5vw, 32px);
}

.xp-call,
.xp-actions {
  padding: 18px;
  border-radius: 18px;
  background: var(--night-2);
  box-shadow: inset 0 0 0 1px var(--night-line);
}

.xp-call {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: box-shadow var(--dur-lg) var(--ease-standard);
}

.xp-call[data-state="live"],
[data-state="live"] .xp-call {
  box-shadow: inset 0 0 0 1px rgba(221, 161, 140, 0.35);
}

.xp-callbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xp-callbar-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.xp-callbar-text strong {
  font-size: 15px;
  font-weight: 550;
}

.xp-callbar-text span {
  font-size: 12px;
  color: var(--night-text-3);
}

.xp-callbar .call-timer {
  margin-left: auto;
}

.wave--lg {
  height: 64px;
  gap: 4px;
}

.transcript--xp {
  height: 340px;
}

.transcript-empty {
  margin: auto;
  max-width: 34ch;
  text-align: center;
  font-size: 14px;
  color: var(--night-text-3);
}

.transcript-empty strong {
  color: var(--night-text-2);
  font-weight: 500;
}

.actions {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.actions li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--night-line);
  opacity: 0.42;
  transition: opacity var(--dur-lg) var(--ease-standard);
}

.actions li:last-child {
  border-bottom: 0;
}

.actions li.is-active,
.actions li.is-done {
  opacity: 1;
}

.a-dot {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--night-line-strong);
  transition: background-color var(--dur-md) var(--ease-standard), box-shadow var(--dur-md) var(--ease-standard);
}

.actions li.is-active .a-dot {
  box-shadow: inset 0 0 0 1.5px var(--blue-soft);
}

.actions li.is-active .a-dot::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--blue-soft);
  animation: dot-pulse 1.2s var(--ease-smooth) infinite alternate;
}

@keyframes dot-pulse {
  from {
    transform: scale(0.6);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.actions li.is-done .a-dot {
  background: var(--signal);
  box-shadow: none;
}

.actions li.is-done .a-dot::after {
  width: 4.5px;
  height: 8px;
  border-color: #04140b;
  border-width: 0 2px 2px 0;
}

.a-text {
  display: grid;
  gap: 3px;
}

.a-text strong {
  font-size: 14.5px;
  font-weight: 500;
}

.a-text code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--night-text-3);
  overflow-wrap: anywhere;
  transition: color var(--dur-md) var(--ease-standard);
}

.actions li.is-done code {
  color: var(--violet-soft);
}

.slots--xp {
  margin-top: 14px;
}

.xp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: clamp(18px, 1rem + 1vw, 28px);
}

.xp-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: var(--fs-small);
  color: var(--night-text-2);
}

.xp-live .text-link {
  min-height: 40px;
  color: var(--night-text);
}

@media (min-width: 560px) {
  .slots--xp {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .slots--xp .slot {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    height: 52px;
  }
}

@media (min-width: 1024px) {
  .xp-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}
