/* Sentinel Prime lead chat widget (embedded from sentinel-chatbot) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#sentinel-intake-widget {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#sentinel-intake-widget {
  --sp-chat-bg-deep: #070b12;
  --sp-chat-bg-panel: #0f1624;
  --sp-chat-bg-msg-bot: #141c2e;
  --sp-chat-bg-msg-user: #0c2540;
  --sp-chat-border: rgba(255, 255, 255, 0.08);
  --sp-chat-text: #e8eaef;
  --sp-chat-muted: #94a3b8;
  --sp-chat-accent: #38bdf8;
  --sp-chat-accent-dim: rgba(56, 189, 248, 0.28);
  --sp-chat-glow: rgba(56, 189, 248, 0.12);
  --sp-chat-radius: 14px;
  --sp-chat-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

#sentinel-intake-widget .sentinel-chat-nudge {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  max-width: 240px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--sp-chat-text);
  background: var(--sp-chat-bg-panel);
  border: 1px solid var(--sp-chat-border);
  border-radius: var(--sp-chat-radius);
  box-shadow: var(--sp-chat-shadow), 0 0 24px var(--sp-chat-accent-dim);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9997;
}
#sentinel-intake-widget .sentinel-chat-nudge.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#sentinel-intake-widget .sentinel-chat-nudge button {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sp-chat-bg-deep);
  background: var(--sp-chat-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#sentinel-intake-widget .sentinel-chat-nudge button:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

#sentinel-intake-widget .sentinel-chat-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: auto;
  min-height: 52px;
  padding: 0 1.1rem 0 0.85rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #0284c7 0%, #38bdf8 50%, #0369a1 100%);
  color: #fff;
  box-shadow:
    0 6px 24px rgba(56, 189, 248, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#sentinel-intake-widget .sentinel-chat-toggle-label { white-space: nowrap; }
#sentinel-intake-widget .sentinel-chat-toggle:hover {
  transform: scale(1.06);
  box-shadow:
    0 8px 32px rgba(56, 189, 248, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}
#sentinel-intake-widget .sentinel-chat-toggle:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}
#sentinel-intake-widget .sentinel-chat-toggle svg { width: 24px; height: 24px; flex-shrink: 0; }
#sentinel-intake-widget .sentinel-chat-toggle[aria-expanded="true"] {
  background: linear-gradient(145deg, #334155 0%, #475569 100%);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

#sentinel-intake-widget .sentinel-chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9995;
}
#sentinel-intake-widget .sentinel-chat-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

#sentinel-intake-widget .sentinel-chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(100vw - 2rem, 400px);
  max-height: min(560px, calc(100vh - 5.5rem));
  display: flex;
  flex-direction: column;
  background: var(--sp-chat-bg-panel);
  border: 1px solid var(--sp-chat-border);
  border-radius: calc(var(--sp-chat-radius) + 4px);
  box-shadow: var(--sp-chat-shadow), 0 0 60px var(--sp-chat-glow);
  z-index: 9996;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
#sentinel-intake-widget .sentinel-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#sentinel-intake-widget .sentinel-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sp-chat-border);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
}
#sentinel-intake-widget .sentinel-chat-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sp-chat-text);
}
#sentinel-intake-widget .sentinel-chat-header span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--sp-chat-accent);
  margin-top: 0.15rem;
}
#sentinel-intake-widget .sentinel-chat-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sp-chat-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
#sentinel-intake-widget .sentinel-chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sp-chat-text);
}
#sentinel-intake-widget .sentinel-chat-close:focus-visible {
  outline: 2px solid var(--sp-chat-accent);
  outline-offset: 2px;
}

#sentinel-intake-widget .sentinel-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 220px;
  scroll-behavior: smooth;
}

#sentinel-intake-widget .sentinel-chat-msg {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  animation: spSentinelMsgIn 0.4s ease forwards;
}
@keyframes spSentinelMsgIn {
  to { opacity: 1; transform: translateY(0); }
}
#sentinel-intake-widget .sentinel-chat-msg--bot {
  align-self: flex-start;
  background: var(--sp-chat-bg-msg-bot);
  border: 1px solid var(--sp-chat-border);
  color: var(--sp-chat-text);
}
#sentinel-intake-widget .sentinel-chat-msg--user {
  align-self: flex-end;
  background: var(--sp-chat-bg-msg-user);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
}
#sentinel-intake-widget .sentinel-chat-msg--static {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

#sentinel-intake-widget .sentinel-chat-typing {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: var(--sp-chat-bg-msg-bot);
  border: 1px solid var(--sp-chat-border);
  border-radius: 12px;
}
#sentinel-intake-widget .sentinel-chat-typing.is-visible { display: flex; }
#sentinel-intake-widget .sentinel-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sp-chat-muted);
  animation: spSentinelTypingBounce 1.2s ease-in-out infinite;
}
#sentinel-intake-widget .sentinel-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
#sentinel-intake-widget .sentinel-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes spSentinelTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

#sentinel-intake-widget .sentinel-chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0 1rem 0.5rem;
  transition: opacity 0.2s ease;
}
#sentinel-intake-widget .sentinel-chat-options[hidden] { display: none !important; }
#sentinel-intake-widget .sentinel-chat-opt {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-chat-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sp-chat-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
#sentinel-intake-widget .sentinel-chat-opt:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 16px var(--sp-chat-accent-dim);
}
#sentinel-intake-widget .sentinel-chat-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#sentinel-intake-widget .sentinel-chat-opt.is-selected {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}
#sentinel-intake-widget .sentinel-chat-opt:focus-visible {
  outline: 2px solid var(--sp-chat-accent);
  outline-offset: 2px;
}

#sentinel-intake-widget .sentinel-chat-next {
  flex: 1 1 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sp-chat-bg-deep);
  background: var(--sp-chat-accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.2s ease;
}
#sentinel-intake-widget .sentinel-chat-next:hover:not(:disabled) { filter: brightness(1.08); }
#sentinel-intake-widget .sentinel-chat-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}
#sentinel-intake-widget .sentinel-chat-next:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

#sentinel-intake-widget .sentinel-chat-consent {
  margin: 0 1rem;
  padding: 0 0 0.65rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #94a3b8;
}

#sentinel-intake-widget .sentinel-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--sp-chat-border);
  background: rgba(0, 0, 0, 0.2);
  align-items: flex-end;
  transition: opacity 0.2s ease;
}
#sentinel-intake-widget .sentinel-chat-input-row.is-hidden {
  display: none;
}
#sentinel-intake-widget .sentinel-chat-input-row input,
#sentinel-intake-widget .sentinel-chat-input-row textarea {
  flex: 1;
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--sp-chat-text);
  background: var(--sp-chat-bg-deep);
  border: 1px solid var(--sp-chat-border);
  border-radius: 10px;
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
}
#sentinel-intake-widget .sentinel-chat-input-row textarea {
  min-height: 72px;
}
#sentinel-intake-widget .sentinel-chat-input-row input::placeholder,
#sentinel-intake-widget .sentinel-chat-input-row textarea::placeholder { color: #64748b; }
#sentinel-intake-widget .sentinel-chat-input-row input:focus,
#sentinel-intake-widget .sentinel-chat-input-row textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px var(--sp-chat-accent-dim);
}
#sentinel-intake-widget .sentinel-chat-input-row input:disabled,
#sentinel-intake-widget .sentinel-chat-input-row textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#sentinel-intake-widget .sentinel-chat-input-row .sentinel-chat-field {
  display: none;
  flex: 1;
}
#sentinel-intake-widget .sentinel-chat-input-row .sentinel-chat-field.is-active {
  display: block;
}
#sentinel-intake-widget .sentinel-chat-send {
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sp-chat-bg-deep);
  background: var(--sp-chat-accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.2s ease;
  flex-shrink: 0;
  align-self: stretch;
}
#sentinel-intake-widget .sentinel-chat-send:hover:not(:disabled) { filter: brightness(1.08); }
#sentinel-intake-widget .sentinel-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
#sentinel-intake-widget .sentinel-chat-send:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

#sentinel-intake-widget .sentinel-chat-status {
  padding: 0 1rem 0.75rem;
  font-size: 0.75rem;
  color: var(--sp-chat-muted);
  min-height: 1.25rem;
}
#sentinel-intake-widget .sentinel-chat-status--ok { color: #4ade80; }
#sentinel-intake-widget .sentinel-chat-status--err { color: #f87171; }

@media (max-width: 480px) {
  #sentinel-intake-widget .sentinel-chat-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }
  #sentinel-intake-widget .sentinel-chat-toggle { right: 0.75rem; bottom: 0.75rem; max-width: calc(100vw - 1.5rem); }
  #sentinel-intake-widget .sentinel-chat-nudge { right: 0.75rem; bottom: 5.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  #sentinel-intake-widget .sentinel-chat-msg,
  #sentinel-intake-widget .sentinel-chat-panel,
  #sentinel-intake-widget .sentinel-chat-backdrop,
  #sentinel-intake-widget .sentinel-chat-nudge,
  #sentinel-intake-widget .sentinel-chat-options {
    animation: none !important;
    transition: none !important;
  }
  #sentinel-intake-widget .sentinel-chat-msg { opacity: 1; transform: none; }
  #sentinel-intake-widget .sentinel-chat-typing span { animation: none; opacity: 0.6; }
}
