/**
 * FON Concierge widget.
 * Colours mirror the fon-child theme (--navy-900 #0a1530, --gold-500 #c9a961),
 * but are literal here so the widget looks right on any template.
 */

.fon-ia {
  --ia-navy: #0a1530;
  --ia-navy-2: #16224a;
  --ia-gold: #c9a961;
  --ia-gold-dk: #b08d3f;
  --ia-ivory: #f4efe6;
  --ia-line: rgba(244, 239, 230, 0.16);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99998;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Launcher */
.fon-ia-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ia-navy);
  color: var(--ia-ivory);
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 24px rgba(10, 21, 48, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fon-ia-launch:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(10, 21, 48, 0.34); }
.fon-ia[data-open="true"] .fon-ia-launch { display: none; }
.fon-ia-launch { padding: 8px 20px 8px 8px; }

/* Portraits */
.fon-ia-face-sm,
.fon-ia-face {
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;   /* keep the face centred as the circle tightens */
  flex: none;
  display: block;
}
.fon-ia-face-sm { width: 34px; height: 34px; border: 1px solid rgba(201, 169, 97, 0.55); }
.fon-ia-face { width: 42px; height: 42px; border: 1px solid rgba(201, 169, 97, 0.5); }
.fon-ia-ident { display: flex; align-items: center; gap: 11px; min-width: 0; }

/* Panel */
.fon-ia-panel {
  display: none;
  flex-direction: column;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 54px rgba(10, 21, 48, 0.3);
}
.fon-ia[data-open="true"] .fon-ia-panel { display: flex; }

.fon-ia-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--ia-navy);
  color: var(--ia-ivory);
  border-bottom: 1px solid var(--ia-line);
}
.fon-ia-head h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
}
.fon-ia-head p { margin: 2px 0 0; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ia-gold); }
.fon-ia-close {
  border: 0; background: transparent; cursor: pointer;
  color: var(--ia-ivory); font-size: 22px; line-height: 1;
  padding: 4px 6px; border-radius: 6px; opacity: 0.75;
}
.fon-ia-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

/* Transcript */
.fon-ia-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--ia-ivory);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fon-ia-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fon-ia-msg.bot { align-self: flex-start; background: #fff; color: #16203d; border: 1px solid rgba(12, 20, 48, 0.09); border-bottom-left-radius: 4px; }
.fon-ia-msg.me { align-self: flex-end; background: var(--ia-navy-2); color: #fff; border-bottom-right-radius: 4px; }
.fon-ia-msg.note { align-self: center; max-width: 100%; background: transparent; border: 0; color: #6b7493; font-size: 12.5px; text-align: center; padding: 4px 0; }
.fon-ia-msg a { color: var(--ia-gold-dk); text-decoration: underline; }
.fon-ia-msg.me a { color: var(--ia-gold); }

/* Typing indicator */
.fon-ia-typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; background: #fff; border: 1px solid rgba(12, 20, 48, 0.09); border-radius: 12px; border-bottom-left-radius: 4px; }
.fon-ia-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa2bd; animation: fon-ia-bounce 1.3s infinite; }
.fon-ia-typing span:nth-child(2) { animation-delay: 0.18s; }
.fon-ia-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes fon-ia-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fon-ia-typing span { animation: none; }
  .fon-ia-launch { transition: none; }
}

/* Quick replies */
.fon-ia-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; background: var(--ia-ivory); }
.fon-ia-chip {
  border: 1px solid var(--ia-gold); background: transparent; color: var(--ia-gold-dk);
  padding: 7px 13px; border-radius: 999px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: background 0.15s ease, color 0.15s ease;
}
.fon-ia-chip:hover { background: var(--ia-gold); color: var(--ia-navy); }

/* Composer */
.fon-ia-form { display: flex; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid rgba(12, 20, 48, 0.1); }
.fon-ia-input {
  flex: 1; resize: none; border: 1px solid rgba(12, 20, 48, 0.18); border-radius: 9px;
  padding: 10px 12px; font: inherit; font-size: 14.5px; line-height: 1.4; color: #16203d;
  max-height: 110px; background: #fff;
}
.fon-ia-input:focus { outline: none; border-color: var(--ia-gold); box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.22); }
.fon-ia-input[disabled] { background: #f4f4f6; color: #8b93ab; cursor: not-allowed; }
.fon-ia-send {
  border: 0; cursor: pointer; padding: 0 17px; border-radius: 9px;
  background: var(--ia-navy); color: var(--ia-ivory); font: inherit; font-size: 14px;
}
.fon-ia-send:hover { background: var(--ia-navy-2); }
.fon-ia-send[disabled] { opacity: 0.5; cursor: default; }
.fon-ia-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 480px) {
  .fon-ia { right: 12px; bottom: 12px; left: 12px; }
  .fon-ia-panel { width: 100%; height: min(78vh, 560px); }
  .fon-ia-launch { margin-left: auto; }
}
