/* ══════════════════════════════════════════
   SAGE FORM GUIDE — floating panel styles
   ══════════════════════════════════════════ */

/* ── Floating panel ── */
#gmFloatPanel {
  position: fixed;
  width: 320px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(47,93,159,0.18);
  border: 1.5px solid #E6EDF6;
  display: flex;
  flex-direction: column;
  z-index: 800;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-20px);
  transition: top 0.5s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease,
              transform 0.3s ease;
  max-height: 520px;
}

/* ── Header ── */
.gmf-header {
  background: linear-gradient(135deg, #2F5D9F, #1e3e6e);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}
.gmf-header:active { cursor: grabbing; }
.gmf-avatar { font-size: 1.2rem; flex-shrink: 0; }
.gmf-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.gmf-header-text strong { font-size: 0.88rem; }
.gmf-header-text span   { font-size: 0.72rem; opacity: 0.8; }
.gmf-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.gmf-close:hover { background: rgba(255,255,255,0.3); }

/* ── Progress ── */
.gmf-progress { height: 3px; background: #e8f0fb; flex-shrink: 0; }
.gmf-progress-fill { height: 100%; background: #4ade80; transition: width 0.4s ease; }

/* ── Messages ── */
.gmf-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* ── Message bubbles ── */
.gm-msg {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  animation: gmMsgIn 0.22s ease;
}
@keyframes gmMsgIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gm-msg.gm-user { flex-direction: row-reverse; }
.gm-bubble {
  max-width: 84%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.83rem;
  line-height: 1.5;
}
.gm-msg.gm-bot  .gm-bubble { background: #f1f5fb; color: #0F172A; border-bottom-left-radius: 3px; }
.gm-msg.gm-user .gm-bubble { background: #2F5D9F; color: #fff;    border-bottom-right-radius: 3px; }
.gm-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.gm-msg.gm-bot  .gm-icon { background: #e8f0fb; }
.gm-msg.gm-user .gm-icon { background: #dbeafe; }

/* ── Badges ── */
.gm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 3px 9px;
  font-size: 0.73rem; margin-top: 5px; font-weight: 500;
}
.gm-badge-fill    { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.gm-badge-context { background: #fef9c3; border: 1px solid #fde047; color: #713f12; }

/* ── Quick replies ── */
.gm-qr-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.gm-qr {
  padding: 4px 10px;
  border: 1.5px solid #2F5D9F;
  border-radius: 14px;
  font-size: 0.75rem;
  color: #2F5D9F;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}
.gm-qr:hover    { background: #2F5D9F; color: #fff; }
.gm-qr:disabled { opacity: 0.45; cursor: not-allowed; }
.gm-qr-yes { background: #f0fdf4; border-color: #86efac; color: #166534; }
.gm-qr-yes:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.gm-qr-no  { background: #fafafa; border-color: #cbd5e1; color: #475569; }
.gm-qr-no:hover  { background: #64748b; border-color: #64748b; color: #fff; }

/* ── Typing ── */
.gm-typing { display: flex; gap: 4px; padding: 3px 0; }
.gm-typing span {
  width: 6px; height: 6px; background: #475569;
  border-radius: 50%; animation: gmBounce 1.2s infinite;
}
.gm-typing span:nth-child(2) { animation-delay: 0.2s; }
.gm-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gmBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

/* ── Skip ── */
.gmf-skip {
  padding: 4px 12px;
  border-top: 1px solid #f1f5f9;
  text-align: right;
  flex-shrink: 0;
}
.gmf-skip button {
  background: none; border: none;
  color: #64748b; font-size: 0.74rem;
  cursor: pointer; font-family: inherit;
  text-decoration: underline; padding: 3px 0;
}
.gmf-skip button:hover { color: #2F5D9F; }

/* ── Input row ── */
.gmf-input-row {
  padding: 10px 12px;
  border-top: 1px solid #E6EDF6;
  display: flex; gap: 7px; align-items: flex-end;
  background: #fff; flex-shrink: 0;
}
#guideMeInput {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #E6EDF6;
  border-radius: 18px;
  font-size: 0.83rem;
  font-family: inherit;
  outline: none; resize: none;
  max-height: 72px; min-height: 36px;
  line-height: 1.4; color: #0F172A;
  transition: border-color 0.2s;
}
#guideMeInput:focus { border-color: #2F5D9F; }
#guideMeSend {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #2F5D9F; border: none; color: #fff;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 0.82rem; flex-shrink: 0;
  transition: all 0.15s;
}
#guideMeSend:hover    { filter: brightness(1.1); transform: scale(1.05); }
#guideMeSend:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Field fill animations ── */
.gm-field-filled {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  animation: gmFillPulse 0.5s ease;
}
@keyframes gmFillPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.gm-chip-filled { animation: gmChipPop 0.35s ease; }
@keyframes gmChipPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.13); }
  100% { transform: scale(1); }
}

/* ── Shared keyframes ── */
@keyframes gmPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.4); }
}

/* ── Hide on mobile (not enough room) ── */
@media (max-width: 1100px) {
  #gmFloatPanel { display: none !important; }
}