/* sales-chat.css - AI sales chat widget for the v3 landing (markup built by /static/js/sales-chat.js).
   Palette and type follow the landing: bg #07090B/#05070A, text #F2F4F5, muted #9AA6AF, brand #10A6E9. */

.otc {
  --otc-bg: #0B0F12;
  --otc-bg2: #05070A;
  --otc-line: rgba(255, 255, 255, 0.1);
  --otc-text: #F2F4F5;
  --otc-muted: #9AA6AF;
  --otc-blue: #10A6E9;
  --otc-red: #FF5A66;
  --otc-gap: 20px;
  --otc-l: max(var(--otc-gap), calc(env(safe-area-inset-left, 0px) + 12px));
  --otc-b: max(var(--otc-gap), calc(env(safe-area-inset-bottom, 0px) + 12px));
  font-family: Heebo, 'Arial Hebrew', system-ui, sans-serif;
  color: var(--otc-text);
  -webkit-font-smoothing: antialiased;
}
.otc *, .otc *::before, .otc *::after { box-sizing: border-box; }
.otc [hidden] { display: none !important; }
.otc button, .otc input, .otc textarea { font: inherit; color: inherit; }
.otc a { color: var(--otc-blue); }
.otc a:hover { color: #3DBBF2; }
.otc :focus-visible { outline: 2px solid var(--otc-blue); outline-offset: 2px; }
.otc-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Launcher: bottom-left, the RTL mirror of the usual bottom-right corner. */
.otc-launcher {
  position: fixed; left: var(--otc-l); bottom: var(--otc-b); z-index: 56;
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border: 1px solid rgba(16, 166, 233, 0.6); border-radius: 50%;
  background: var(--otc-blue); color: #04121A; cursor: pointer;
  box-shadow: 0 0 0 6px rgba(16, 166, 233, 0.16), 0 18px 40px -14px rgba(16, 166, 233, 0.85);
  transition: transform 0.25s ease, background-color 0.25s, opacity 0.2s;
}
.otc-launcher.otc-hold { opacity: 0; pointer-events: none; }
.otc-launcher:hover { background: #3DBBF2; transform: translateY(-2px); }
.otc-launcher:focus-visible { outline: 2px solid var(--otc-text); outline-offset: 4px; }
.otc-launcher svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Teaser bubble above the launcher. Never steals focus; hidden while it would cover plan buttons / video controls. */
.otc-teaser {
  position: fixed; left: var(--otc-l); bottom: calc(var(--otc-b) + 68px); z-index: 56;
  display: flex; align-items: flex-start; gap: 4px;
  width: max-content; max-width: min(320px, calc(100vw - 2 * var(--otc-gap)));
  padding: 4px; border: 1px solid rgba(16, 166, 233, 0.45); border-radius: 16px 16px 16px 4px;
  background: rgba(11, 15, 18, 0.96); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.95);
  animation: otc-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.otc-teaser.otc-hold { visibility: hidden; }
.otc-teaser-msg {
  flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent;
  text-align: start; font-size: 16px; line-height: 1.5; white-space: pre-wrap; cursor: pointer;
}
.otc-teaser-msg:hover { background: rgba(16, 166, 233, 0.1); }
.otc-teaser-x, .otc-x {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--otc-muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.otc-teaser-x:hover, .otc-x:hover { background: rgba(255, 255, 255, 0.08); color: var(--otc-text); }

/* Panel */
.otc-panel {
  position: fixed; left: var(--otc-l); bottom: calc(var(--otc-b) + 68px); z-index: 80;
  display: flex; flex-direction: column;
  width: min(400px, calc(100vw - 2 * var(--otc-gap)));
  height: min(600px, calc(100vh - 140px)); height: min(600px, calc(100dvh - 140px));
  border: 1px solid var(--otc-line); border-radius: 18px; background: var(--otc-bg);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(16, 166, 233, 0.12);
  overflow: hidden;
  animation: otc-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.otc-panel:focus { outline: none; }
.otc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 10px 10px; border-bottom: 1px solid var(--otc-line);
}
.otc-titlewrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.otc-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otc-badge {
  flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(16, 166, 233, 0.14); color: var(--otc-blue);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
}
.otc-x { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; }
.otc-disclosure {
  margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--otc-line); background: var(--otc-bg2);
  font-size: 13.5px; line-height: 1.5; color: var(--otc-muted);
}

.otc-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  scrollbar-width: thin; scrollbar-color: #1B242B transparent;
}
.otc-msg {
  max-width: 88%; padding: 10px 14px; border-radius: 14px;
  font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.otc-u { align-self: flex-start; background: var(--otc-blue); color: #04121A; border-start-start-radius: 4px; font-weight: 500; }
.otc-a { align-self: flex-end; background: #131A1F; border: 1px solid var(--otc-line); border-start-end-radius: 4px; }
.otc-e { align-self: stretch; max-width: none; background: rgba(255, 90, 102, 0.1); border: 1px solid rgba(255, 90, 102, 0.4); color: #FFC9CD; font-size: 15px; }
/* Assistant formatting (built by renderRich in sales-chat.js) */
.otc-msg.otc-wide { width: 100%; }
.otc-text > * + * { margin-top: 8px; }
.otc-b { color: var(--otc-blue); font-weight: 800; }
.otc-num { font-family: Archivo, system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.otc-ul { margin: 0; padding-inline-start: 20px; white-space: normal; }
.otc-ul li + li { margin-top: 3px; }
.otc-ul li::marker { color: var(--otc-blue); }
.otc-tablewrap {
  max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--otc-line); border-radius: 10px; background: #0E1418;
  scrollbar-width: thin; scrollbar-color: #1B242B transparent;
}
.otc-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; white-space: normal; }
.otc-table th, .otc-table td { padding: 7px 9px; text-align: start; vertical-align: top; min-width: 3.5em; }
.otc-table thead th { background: rgba(16, 166, 233, 0.16); color: var(--otc-text); font-weight: 800; border-bottom: 1px solid rgba(16, 166, 233, 0.55); white-space: nowrap; }
.otc-table tbody th { font-weight: 700; }
.otc-table tbody tr + tr > * { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.otc-table tr.otc-rec > * { background: rgba(46, 229, 157, 0.12); color: #C9F5E4; }
.otc-table tr.otc-rec .otc-num { color: #2EE59D; }
.otc-star { color: #2EE59D; margin-inline-end: 4px; }
.otc-chart { margin: 0; padding: 10px 12px; border: 1px solid var(--otc-line); border-radius: 10px; background: #0E1418; white-space: normal; }
.otc-chart-title { margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.otc-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.otc-bar-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; line-height: 1.35; }
.otc-bar-label { min-width: 0; overflow-wrap: anywhere; }
.otc-bar-val { flex: none; color: var(--otc-text); }
.otc-bar-unit { color: var(--otc-muted); font-size: 12.5px; }
.otc-bar-track { display: block; height: 8px; margin-top: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.otc-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--otc-blue); }
.otc-hi .otc-bar-fill { background: #2EE59D; box-shadow: 0 0 12px rgba(46, 229, 157, 0.45); }
.otc-hi .otc-bar-label, .otc-hi .otc-bar-val { color: #2EE59D; font-weight: 700; }

/* One assistant message = a group of part bubbles */
.otc-group { display: flex; flex-direction: column; gap: 6px; }

/* Thinking (send -> first text) and the small typing dots between parts */
.otc-think { position: relative; display: flex; align-items: center; gap: 10px; overflow: hidden; color: var(--otc-muted); font-size: 14px; }
.otc-gap { padding: 9px 14px; line-height: 1; }
.otc-dots-anim { display: inline-flex; align-items: center; gap: 4px; }
.otc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--otc-blue); animation: otc-pulse 1.2s ease-in-out infinite; }
.otc-dot:nth-child(2) { animation-delay: 0.15s; }
.otc-dot:nth-child(3) { animation-delay: 0.3s; }
.otc-dots-small .otc-dot { width: 5px; height: 5px; background: var(--otc-muted); }
.otc-dots-static { display: none; color: var(--otc-blue); font-weight: 800; letter-spacing: 0.1em; }
.otc-scan {
  position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--otc-blue), transparent);
  animation: otc-scan 1.8s linear infinite;
}
.otc-think-text { font-family: Heebo, 'Arial Hebrew', system-ui, sans-serif; }

/* Sign-up call to action (done.signup) */
.otc-signup { align-self: flex-end; width: 88%; display: flex; flex-direction: column; gap: 6px; }
.otc .otc-signup-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px;
  border-radius: 12px; background: var(--otc-blue); color: #04121A; text-decoration: none;
  font-size: 17px; font-weight: 800; text-align: center;
  box-shadow: 0 0 0 1px rgba(16, 166, 233, 0.6), 0 18px 40px -16px rgba(16, 166, 233, 0.75);
  transition: background-color 0.2s, transform 0.2s;
}
.otc .otc-signup-btn:hover { background: #3DBDF5; color: #04121A; transform: translateY(-1px); }
.otc .otc-signup-btn:focus-visible { outline: 2px solid var(--otc-text); outline-offset: 3px; }
.otc-signup-arrow { font-size: 18px; }
.otc-signup-note { margin: 0; text-align: center; font-size: 12.5px; color: var(--otc-muted); }

.otc-form { padding: 10px 12px 12px; border-top: 1px solid var(--otc-line); background: var(--otc-bg2); }
.otc-input {
  display: block; width: 100%; min-height: 46px; max-height: 132px; resize: none; margin: 0;
  padding: 11px 12px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px;
  background: #0E1418; font-size: 16px; line-height: 1.45;
}
.otc-input::placeholder { color: #6F7C86; }
.otc-input:focus { border-color: var(--otc-blue); outline: none; box-shadow: 0 0 0 2px rgba(16, 166, 233, 0.35); }
.otc-input:disabled { opacity: 0.55; }
.otc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.otc-count { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.06em; color: #6F7C86; }
.otc-count.otc-warn { color: #FFB547; }
.otc-send {
  min-height: 44px; padding-inline: 20px; border: 0; border-radius: 10px;
  background: var(--otc-blue); color: #04121A; font-weight: 800; font-size: 16px; cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}
.otc-send:hover { background: #3DBBF2; }
.otc-send:disabled { opacity: 0.45; cursor: not-allowed; background: var(--otc-blue); }

/* Phone handoff form */
.otc-phone {
  align-self: stretch; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  border: 1px solid rgba(46, 229, 157, 0.35); border-radius: 14px; background: rgba(46, 229, 157, 0.06);
}
.otc-phone p { margin: 0; }
.otc-phone-intro { font-size: 15px; font-weight: 700; }
.otc-field { margin-top: 4px; font-size: 14px; color: var(--otc-muted); }
.otc-phone input {
  min-height: 44px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px;
  background: #0E1418; font-size: 16px;
}
.otc-phone input:focus { border-color: var(--otc-blue); outline: none; box-shadow: 0 0 0 2px rgba(16, 166, 233, 0.35); }
.otc-phone input[aria-invalid="true"] { border-color: var(--otc-red); }
.otc-consent { font-size: 13px; line-height: 1.5; color: var(--otc-muted); }
.otc-phone .otc-send { margin-top: 4px; background: #2EE59D; }
.otc-phone .otc-send:hover { background: #5BEDB3; }
.otc-phone-status:empty { display: none; }
.otc-phone-status { font-size: 14px; color: #FFC9CD; }
.otc-phone-done { align-self: stretch; margin: 0; padding: 10px 14px; border-radius: 14px; background: rgba(46, 229, 157, 0.1); color: #C9F5E4; font-size: 15px; }

/* Desktop: lift the launcher above the page's bottom HUD row. */
@media (min-width: 761px) {
  .otc { --otc-gap: 28px; --otc-b: 64px; }
}

/* Phones: near-full-screen panel sized to the visual viewport by the script (keyboard-safe). */
@media (max-width: 600px) {
  .otc { --otc-gap: 16px; }
  .otc-panel {
    left: 0; right: 0; top: 0; bottom: auto; width: 100%; height: 100vh; height: 100dvh;
    border: 0; border-radius: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .otc-open .otc-launcher { display: none; }
  .otc-msg { max-width: 92%; }
  .otc-signup { width: 92%; }
}

@keyframes otc-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes otc-pulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: none; } }
@keyframes otc-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .otc *, .otc *::before, .otc *::after { animation: none !important; transition: none !important; }
  .otc .otc-dot, .otc .otc-scan { display: none; }
  .otc .otc-dots-static { display: inline; }
}
.otc[data-motion="off"] .otc-dot, .otc[data-motion="off"] .otc-scan { display: none; }
.otc[data-motion="off"] .otc-dots-static { display: inline; }
.otc[data-motion="off"] *, .otc[data-motion="off"] *::before, .otc[data-motion="off"] *::after { animation: none !important; transition: none !important; }
