/* BFServices shared Robo MKT widget. Source: /opt/bfsite/frontend/styles.css */
.mkt-robo {
  --ink: #172033;
  --white: #ffffff;
  --blue: #0b5ed7;
  --navy: #071a38;
  --cyan: #20bdf2;
  --green: #26c281;
  --soft: #f3f7fb;
  --line: #d8e1ec;
  --graphite: #344054;
  --muted: #6b7280;
}
.mkt-robo {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  z-index: 80;
  width: min(390px, calc(100vw - 28px));
  color: var(--ink);
  pointer-events: none;
}

.mkt-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-left: auto;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--navy));
  box-shadow: 0 20px 54px rgba(7, 26, 56, 0.28);
  cursor: pointer;
  font-weight: 900;
  pointer-events: auto;
}

.mkt-robot-svg {
  width: 86px;
  min-width: 86px;
  height: 96px;
  overflow: visible;
  animation: mktFloat 5.2s ease-in-out infinite;
}

.mkt-robot-svg.compact {
  width: 48px;
  min-width: 48px;
  height: 54px;
}

.mkt-robot-svg.panel-bot {
  width: 62px;
  min-width: 62px;
  height: 70px;
}

.mkt-svg-shadow ellipse {
  fill: rgba(2, 8, 20, 0.22);
}

.mkt-svg-antenna path,
.mkt-svg-mouth,
.mkt-svg-gloss,
.mkt-svg-arm path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mkt-svg-antenna path,
.mkt-svg-mouth,
.mkt-svg-arm path {
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 5;
}

.mkt-svg-gloss {
  stroke: rgba(255, 255, 255, 0.46);
  stroke-width: 4;
}

.mkt-svg-antenna circle,
.mkt-svg-light {
  fill: var(--green);
  filter: drop-shadow(0 0 6px rgba(38, 194, 129, 0.85));
}

.mkt-svg-arm.right {
  transform-origin: 106px 88px;
  animation: mktWave 2.6s ease-in-out infinite;
}

.mkt-svg-arm circle {
  fill: #dff7ff;
}

.mkt-svg-head {
  fill: #20bdf2;
  stroke: #ffffff;
  stroke-width: 4;
  filter: drop-shadow(0 12px 18px rgba(7, 26, 56, 0.22));
}

.mkt-svg-body {
  fill: #0b5ed7;
  stroke: #ffffff;
  stroke-width: 4;
}

.mkt-svg-screen {
  fill: #071a38;
  opacity: 0.96;
}

.mkt-svg-panel {
  fill: rgba(255, 255, 255, 0.62);
}

.mkt-svg-eye {
  fill: var(--green);
  filter: drop-shadow(0 0 6px rgba(38, 194, 129, 0.9));
  transform-origin: center;
  animation: mktBlink 4.8s infinite;
}

@keyframes mktBlink {
  0%, 45%, 49%, 100% {
    transform: scaleY(1);
  }
  47% {
    transform: scaleY(0.12);
  }
}

@keyframes mktFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes mktWave {
  0%, 100% {
    transform: rotate(11deg);
  }
  50% {
    transform: rotate(-14deg);
  }
}

.mkt-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 104px));
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 225, 236, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(7, 26, 56, 0.28);
  pointer-events: auto;
}

.mkt-panel[hidden] {
  display: none;
}

.mkt-panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--blue));
}

.mkt-panel-head > div {
  flex: 1;
}

.mkt-panel-head strong,
.mkt-panel-head span {
  display: block;
}

.mkt-panel-head span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.mkt-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 900;
}

.mkt-log {
  display: grid;
  flex: 1 1 150px;
  gap: 8px;
  min-height: 96px;
  max-height: none;
  overflow: auto;
  padding: 14px;
  background: var(--soft);
}

.mkt-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.mkt-message.bot {
  justify-self: start;
  background: var(--white);
  border: 1px solid var(--line);
}

.mkt-message.user {
  justify-self: end;
  color: var(--white);
  background: var(--blue);
}

.mkt-choices {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  padding: 12px 14px 0;
}

.mkt-question-form {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px 0;
}

.mkt-question-form label {
  display: grid;
  gap: 5px;
  color: var(--graphite);
  font-size: 0.78rem;
  font-weight: 900;
}

.mkt-question-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.mkt-question-form button {
  align-self: end;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--white);
  background: var(--blue);
  cursor: pointer;
  font-weight: 900;
}

.mkt-choice {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.mkt-choice.active {
  border-color: rgba(11, 94, 215, 0.4);
  color: var(--blue);
  background: rgba(11, 94, 215, 0.08);
}

.mkt-form {
  display: grid;
  flex: 0 1 auto;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
}

.mkt-form label {
  display: grid;
  gap: 5px;
  color: var(--graphite);
  font-size: 0.78rem;
  font-weight: 900;
}

.mkt-form input,
.mkt-form select,
.mkt-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}

.mkt-form textarea {
  resize: vertical;
}

.mkt-hidden-field {
  position: absolute;
  left: -9999px;
}

.mkt-consent {
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 700;
  line-height: 1.4;
}

.mkt-consent input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.mkt-policy,
.mkt-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.mkt-submit {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  cursor: pointer;
  font-weight: 900;
}

.mkt-robo.sending .mkt-submit {
  opacity: 0.66;
  pointer-events: none;
}

@media (max-width: 640px) {
  .mkt-robo {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .mkt-panel {
    right: 0;
    bottom: 72px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 92px);
  }

  .mkt-log {
    min-height: 82px;
    max-height: none;
  }

  .mkt-question-form {
    grid-template-columns: 1fr;
  }

  .mkt-form {
    max-height: 210px;
  }
}

/* Mobile fix 2026-05-16: Robo MKT responsive sheet for phones. */
@media (max-width: 640px) {
  .mkt-robo {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: auto;
    width: auto;
    max-width: calc(100vw - 16px);
    z-index: 80;
  }

  .mkt-launcher {
    width: 58px;
    min-height: 58px;
    max-width: 58px;
    padding: 0;
    gap: 0;
    border-radius: 999px;
    font-size: 0.86rem;
  }

  .mkt-launcher span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mkt-robot-svg.compact {
    width: 38px;
    min-width: 38px;
    height: 44px;
  }

  .mkt-panel {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    display: grid;
    grid-template-rows: auto minmax(84px, 1fr) auto auto minmax(190px, 42vh);
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    border-radius: 8px;
  }

  .mkt-panel[hidden] {
    display: none;
  }

  .mkt-panel-head {
    min-width: 0;
    gap: 8px;
    padding: 8px 10px;
  }

  .mkt-panel-head > div {
    min-width: 0;
  }

  .mkt-panel-head strong,
  .mkt-panel-head span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mkt-robot-svg.panel-bot {
    width: 42px;
    min-width: 42px;
    height: 48px;
  }

  .mkt-close {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .mkt-log {
    min-height: 84px;
    padding: 10px;
    overscroll-behavior: contain;
  }

  .mkt-message {
    max-width: 94%;
    padding: 9px 10px;
    font-size: 0.86rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
  }

  .mkt-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px 0;
  }

  .mkt-choice {
    min-width: 0;
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.78rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .mkt-question-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px 0;
  }

  .mkt-question-form label,
  .mkt-form label {
    min-width: 0;
    font-size: 0.74rem;
  }

  .mkt-question-form input,
  .mkt-question-form button,
  .mkt-form input,
  .mkt-form select,
  .mkt-form textarea,
  .mkt-submit {
    min-height: 40px;
    font-size: 16px;
  }

  .mkt-question-form input,
  .mkt-form input,
  .mkt-form select,
  .mkt-form textarea {
    padding: 8px 9px;
  }

  .mkt-form {
    gap: 8px;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
  }

  .mkt-form textarea {
    min-height: 74px;
    resize: none;
  }

  .mkt-consent {
    grid-template-columns: 20px minmax(0, 1fr);
    line-height: 1.3;
  }

  .mkt-policy,
  .mkt-status {
    font-size: 0.72rem;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  .mkt-panel {
    top: calc(6px + env(safe-area-inset-top, 0px));
    right: 6px;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    left: 6px;
    grid-template-rows: auto minmax(70px, 0.9fr) auto auto minmax(160px, 38vh);
  }

  .mkt-panel-head span {
    display: none;
  }

  .mkt-robot-svg.panel-bot {
    width: 34px;
    min-width: 34px;
    height: 40px;
  }

  .mkt-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mkt-choice {
    min-height: 32px;
    font-size: 0.7rem;
  }

  .mkt-form {
    padding-bottom: 8px;
  }
}

.mkt-robo.mkt-floating-button {
  width: auto;
  max-width: calc(100vw - 16px);
}

.mkt-robo.mkt-floating-button .mkt-launcher {
  margin-left: 0;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.mkt-robo.mkt-floating-button .mkt-launcher:active {
  cursor: grabbing;
}
