/* /assets/css/imosync-assistant-widget.css
   ImoSync Assistant Widget — premium floating chat suite.
   All selectors scoped with .imo-asst-* prefix to avoid collision with site CSS.
*/

/* Local design tokens (scoped via custom properties on the root element) */
#imosync-assistant-root {
  --imoasst-navy: #0D1B2A;
  --imoasst-navy-2: #16263a;
  --imoasst-gold: #C9A84C;
  --imoasst-gold-soft: rgba(201,168,76,.15);
  --imoasst-cream: #F7F3EA;
  --imoasst-text: #1f2937;
  --imoasst-muted: #64748B;
  --imoasst-line: rgba(13,27,42,.08);
  --imoasst-shadow: 0 10px 40px rgba(13,27,42,.25);
}

/* Floating Action Button (closed state) */
.imo-asst-fab {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 95;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--imoasst-navy), var(--imoasst-navy-2));
  border: 1px solid var(--imoasst-gold);
  color: var(--imoasst-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--imoasst-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding: 0;
}
.imo-asst-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 48px rgba(13,27,42,.32); }
.imo-asst-fab:focus-visible { outline: 2px solid var(--imoasst-gold); outline-offset: 3px; }
.imo-asst-fab svg { width: 24px; height: 24px; }

/* Notification ping dot */
.imo-asst-fab::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--imoasst-gold);
  border: 2px solid var(--imoasst-navy);
  animation: imoAsstPulse 2.4s infinite;
}
@keyframes imoAsstPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .55; }
}

/* Panel container (hidden by default) */
.imo-asst-panel {
  position: fixed;
  z-index: 96;
  background: #fff;
  display: none;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--imoasst-text);
  overflow: hidden;
  box-shadow: var(--imoasst-shadow);
  line-height: 1.5;
}
.imo-asst-panel.imo-asst-open { display: flex; }

/* Desktop panel */
@media (min-width: 641px) {
  .imo-asst-panel {
    bottom: 5.5rem;
    right: 1.5rem;
    width: 380px;
    height: 620px;
    max-height: calc(100vh - 7rem);
    border-radius: 14px;
    border: 1px solid var(--imoasst-line);
  }
}

/* Mobile bottom-sheet */
@media (max-width: 640px) {
  .imo-asst-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 92vh;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--imoasst-line);
  }
}

/* Header */
.imo-asst-header {
  background: linear-gradient(135deg, var(--imoasst-navy), var(--imoasst-navy-2));
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--imoasst-gold-soft);
  flex-shrink: 0;
}
.imo-asst-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--imoasst-gold);
  color: var(--imoasst-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.imo-asst-title-block { flex: 1; min-width: 0; }
.imo-asst-title { font-size: 15px; font-weight: 600; line-height: 1.2; color: #fff; }
.imo-asst-subtitle { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 3px; }
.imo-asst-close {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.7);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  padding: 0;
}
.imo-asst-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.imo-asst-close:focus-visible { outline: 2px solid var(--imoasst-gold); outline-offset: 2px; }

/* Body (scrollable) */
.imo-asst-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--imoasst-cream);
}

/* Persona picker */
.imo-asst-picker-intro {
  font-size: 14px;
  color: var(--imoasst-text);
  margin-bottom: 1rem;
  line-height: 1.55;
}
.imo-asst-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .65rem;
}
.imo-asst-persona {
  background: #fff;
  border: 1px solid var(--imoasst-line);
  border-radius: 10px;
  padding: .85rem .75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-family: inherit;
  color: inherit;
}
.imo-asst-persona:hover {
  border-color: var(--imoasst-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,168,76,.18);
}
.imo-asst-persona:focus-visible {
  outline: 2px solid var(--imoasst-gold);
  outline-offset: 2px;
}
.imo-asst-persona-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.imo-asst-persona-name { font-size: 14px; font-weight: 600; color: var(--imoasst-text); }
.imo-asst-persona-role { font-size: 12px; color: var(--imoasst-muted); margin-top: 2px; }

/* Form view */
.imo-asst-form { display: flex; flex-direction: column; gap: .8rem; }
.imo-asst-intro {
  font-size: 13.5px;
  color: var(--imoasst-text);
  background: #fff;
  border-radius: 10px;
  padding: .8rem .9rem;
  border-left: 3px solid var(--imoasst-gold);
  line-height: 1.55;
  margin: 0;
}
.imo-asst-field { display: flex; flex-direction: column; gap: .3rem; }
.imo-asst-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--imoasst-text);
  letter-spacing: .01em;
}
.imo-asst-req { color: #b3261e; margin-left: 2px; }
.imo-asst-input,
.imo-asst-select,
.imo-asst-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  padding: .55rem .7rem;
  font-size: 14px;
  font-family: inherit;
  color: var(--imoasst-text);
  transition: border-color .2s, box-shadow .2s;
}
.imo-asst-input:focus,
.imo-asst-select:focus,
.imo-asst-textarea:focus {
  outline: none;
  border-color: var(--imoasst-gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}
.imo-asst-textarea { resize: vertical; min-height: 70px; }
.imo-asst-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }

/* Honeypot — visually hidden, not display:none, so bots still see and fill it */
.imo-asst-honey {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Action buttons */
.imo-asst-actions { display: flex; gap: .55rem; margin-top: .4rem; }
.imo-asst-btn {
  flex: 1;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: .7rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s, opacity .2s;
  border: 1px solid transparent;
}
.imo-asst-btn:active { transform: translateY(1px); }
.imo-asst-btn-secondary {
  background: transparent;
  color: var(--imoasst-text);
  border-color: var(--imoasst-line);
}
.imo-asst-btn-secondary:hover { background: rgba(13,27,42,.04); border-color: rgba(13,27,42,.18); }
.imo-asst-btn-primary {
  background: var(--imoasst-gold);
  color: var(--imoasst-navy);
  border-color: var(--imoasst-gold);
}
.imo-asst-btn-primary:hover { background: #d8b85a; }
.imo-asst-btn-primary:disabled { opacity: .55; cursor: not-allowed; }

/* Error message */
.imo-asst-error {
  font-size: 12.5px;
  color: #b3261e;
  background: rgba(179,38,30,.08);
  border-left: 3px solid #b3261e;
  padding: .55rem .7rem;
  border-radius: 6px;
  margin-top: .2rem;
  display: none;
  line-height: 1.45;
}
.imo-asst-error.imo-asst-visible { display: block; }

/* Result view */
.imo-asst-result {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  border-left: 3px solid var(--imoasst-gold);
  font-size: 14px;
  line-height: 1.6;
  color: var(--imoasst-text);
}
.imo-asst-result-title { font-weight: 600; margin-bottom: .35rem; color: var(--imoasst-navy); }
.imo-asst-result p { margin: .25rem 0; }
.imo-asst-result-cta {
  display: inline-block;
  margin-top: .9rem;
  background: var(--imoasst-gold);
  color: var(--imoasst-navy);
  font-weight: 600;
  font-size: 13px;
  padding: .55rem .9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s;
}
.imo-asst-result-cta:hover { background: #d8b85a; }

/* In-panel footer microcopy */
.imo-asst-footer-note {
  font-size: 11px;
  color: var(--imoasst-muted);
  text-align: center;
  padding: .7rem 1rem;
  border-top: 1px solid var(--imoasst-line);
  background: #fff;
  flex-shrink: 0;
}

/* Loading spinner */
.imo-asst-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: imoAsstSpin .8s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes imoAsstSpin { to { transform: rotate(360deg); } }
