/* Sigur365 Chatbot 1.1.0 – navy, albastru deschis și gri; colțuri ușor rotunjite; fonturile site-ului. */
#s365-chat {
  --s365-chat-navy: #082f63;
  --s365-chat-navy-2: #0d3f7c;
  --s365-chat-ink: #142c48;
  --s365-chat-muted: #5d7188;
  --s365-chat-line: #dfe7f0;
  --s365-chat-soft: #f4f7fb;
  --s365-chat-sky: #eaf2fb;
  --s365-chat-ok: #1f9d63;
  --s365-chat-r: 8px;
  --s365-chat-bottom: 22px;
  --s365-chat-height: 640px;
  --s365-chat-head: "S365 Montserrat", "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  --s365-chat-body: "S365 Inter", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--s365-chat-ink);
  font: 400 14px/1.5 var(--s365-chat-body);
  text-align: left;
  letter-spacing: 0;
  position: relative;
  z-index: 100050;
}
#s365-chat *, #s365-chat *::before, #s365-chat *::after { box-sizing: border-box; }
#s365-chat [hidden] { display: none !important; }
#s365-chat button, #s365-chat textarea, #s365-chat a { font: inherit; letter-spacing: 0; text-transform: none; }
#s365-chat button { margin: 0; min-width: 0; min-height: 0; cursor: pointer; box-shadow: none; background-image: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease; }
#s365-chat button::before, #s365-chat button::after { content: none; }
#s365-chat svg { display: block; flex-shrink: 0; }
#s365-chat button:focus-visible, #s365-chat a:focus-visible, #s365-chat textarea:focus-visible, #s365-chat input:focus-visible { outline: 3px solid #74b6ed; outline-offset: 2px; }

/* Lansator */
#s365-chat .s365-chat-launch {
  position: fixed;
  inset: auto auto var(--s365-chat-bottom) 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px 0 8px;
  border: 1px solid #ffffff1f;
  border-radius: var(--s365-chat-r);
  background: linear-gradient(135deg, var(--s365-chat-navy-2), var(--s365-chat-navy));
  color: #fff;
  box-shadow: 0 10px 28px #082f6340, 0 2px 6px #082f6326;
}
#s365-chat .s365-chat-launch:hover { transform: translateY(-1px); box-shadow: 0 14px 32px #082f6347, 0 2px 6px #082f6326; }
#s365-chat .s365-chat-launch-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px; background: #ffffff1a; position: relative; }
#s365-chat .s365-chat-launch-icon svg { width: 22px; height: 22px; }
#s365-chat .s365-chat-launch-icon::after { content: ""; position: absolute; right: 2px; top: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--s365-chat-ok); border: 2px solid var(--s365-chat-navy); }
#s365-chat[data-online="false"] .s365-chat-launch-icon::after { background: #9fb3c8; }
#s365-chat .s365-chat-launch-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.1; }
#s365-chat .s365-chat-launch-text strong { font: 700 14px/1.1 var(--s365-chat-head); color: #fff; }
#s365-chat .s365-chat-launch-text small { font-size: 11px; font-weight: 500; color: #c9dcf1; }
#s365-chat[data-open="true"] .s365-chat-launch { visibility: hidden; }

/* Panou */
#s365-chat-panel {
  position: fixed;
  inset: auto auto var(--s365-chat-bottom) 20px;
  display: flex;
  flex-direction: column;
  width: 400px;
  height: min(640px, var(--s365-chat-height));
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 60px);
  overflow: hidden;
  border: 1px solid #d3deea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px #082f6338, 0 4px 14px #082f631a;
  isolation: isolate;
  animation: s365-chat-in .18s ease-out;
}
@keyframes s365-chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#s365-chat .s365-chat-header {
  display: flex; flex-shrink: 0; align-items: center; gap: 10px;
  padding: 14px 10px 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--s365-chat-navy-2) 0%, var(--s365-chat-navy) 70%);
}
#s365-chat .s365-chat-mark { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--s365-chat-r); background: #ffffff14; border: 1px solid #ffffff2e; }
#s365-chat .s365-chat-mark svg { width: 26px; height: 26px; }
#s365-chat .s365-chat-heading { min-width: 0; flex: 1; }
#s365-chat .s365-chat-header h2 { margin: 0; padding: 0; color: #fff; font: 700 16px/1.25 var(--s365-chat-head); letter-spacing: 0; }
#s365-chat .s365-chat-presence { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; padding: 0; color: #cfe0f3; font-size: 11.5px; line-height: 1.35; }
#s365-chat .s365-chat-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #9fb3c8; }
#s365-chat[data-online="true"] .s365-chat-dot { background: #3fd38f; box-shadow: 0 0 0 3px #3fd38f33; }
#s365-chat .s365-chat-icon, #s365-chat .s365-chat-close {
  display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; padding: 0;
  border: 0; border-radius: 7px; color: #fff; background: transparent; text-decoration: none;
}
#s365-chat .s365-chat-icon svg, #s365-chat .s365-chat-close svg { width: 20px; height: 20px; }
#s365-chat .s365-chat-icon:hover, #s365-chat .s365-chat-close:hover { background: #ffffff1f; color: #fff; text-decoration: none; }

/* Conversație */
#s365-chat .s365-chat-messages { flex: 1 1 auto; min-height: 0; padding: 18px 16px 8px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: var(--s365-chat-soft); }
#s365-chat .s365-chat-message { position: relative; width: fit-content; max-width: 88%; margin: 0 0 12px; padding: 10px 13px; border-radius: var(--s365-chat-r); overflow-wrap: anywhere; }
#s365-chat .s365-chat-message p { margin: 0; padding: 0; white-space: pre-wrap; color: inherit; font-size: 13.5px; line-height: 1.6; }
#s365-chat .s365-chat-assistant { margin-left: 34px; border: 1px solid var(--s365-chat-line); background: #fff; color: var(--s365-chat-ink); box-shadow: 0 1px 2px #082f630d; border-top-left-radius: 3px; }
#s365-chat .s365-chat-assistant::before {
  content: ""; position: absolute; left: -34px; top: 0; width: 26px; height: 26px; border-radius: 6px;
  background: var(--s365-chat-navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 2.8l7.5 3v5.6c0 4.6-3.1 8.7-7.5 9.9-4.4-1.2-7.5-5.3-7.5-9.9V5.8z' stroke='%23fff' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M8.6 12.1l2.4 2.4 4.6-4.8' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 17px no-repeat;
}
#s365-chat .s365-chat-user { margin-left: auto; background: var(--s365-chat-navy); color: #fff; border: 1px solid var(--s365-chat-navy); border-top-right-radius: 3px; }
#s365-chat .s365-chat-ai-tag { display: block; margin-bottom: 6px; color: var(--s365-chat-muted); font-size: 10.5px; font-weight: 600; }

/* Carduri de start */
#s365-chat .s365-chat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 0 14px 34px; }
#s365-chat .s365-chat-cards button {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; row-gap: 1px; align-items: center;
  padding: 10px; min-height: 64px; min-width: 0; text-align: left; white-space: normal;
  border: 1px solid var(--s365-chat-line); border-radius: var(--s365-chat-r); background: #fff; color: var(--s365-chat-ink);
}
#s365-chat .s365-chat-cards button:hover { border-color: #b8cce2; background: #fbfdff; box-shadow: 0 4px 12px #082f6314; transform: translateY(-1px); }
#s365-chat .s365-chat-card-ic { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--s365-chat-sky); color: var(--s365-chat-navy); }
#s365-chat .s365-chat-card-ic svg { width: 19px; height: 19px; }
#s365-chat .s365-chat-cards strong { font: 700 12.5px/1.25 var(--s365-chat-head); color: var(--s365-chat-navy); }
#s365-chat .s365-chat-cards small { font-size: 11px; line-height: 1.3; color: var(--s365-chat-muted); }
#s365-chat[data-engaged="true"] .s365-chat-cards { display: none; }

/* Linkuri din răspunsuri */
#s365-chat .s365-chat-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#s365-chat .s365-chat-links a {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 10px;
  border: 1px solid #c8d8ea; border-radius: 7px; background: #fff; color: var(--s365-chat-navy);
  font-size: 12px; font-weight: 600; line-height: 1.3; text-decoration: none;
}
#s365-chat .s365-chat-links a::after { content: "→"; font-weight: 600; opacity: .7; }
#s365-chat .s365-chat-links a[target="_blank"]::after { content: "↗"; }
#s365-chat .s365-chat-links a[href^="tel:"]::after { content: none; }
#s365-chat .s365-chat-links a:hover { background: var(--s365-chat-sky); border-color: #a9c3df; text-decoration: none; }
#s365-chat .s365-chat-links a.s365-chat-primary { background: var(--s365-chat-navy); border-color: var(--s365-chat-navy); color: #fff; }
#s365-chat .s365-chat-links a.s365-chat-primary:hover { background: var(--s365-chat-navy-2); }

/* Întrebări înrudite */
#s365-chat .s365-chat-related { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px 34px; }
#s365-chat .s365-chat-related button { padding: 5px 10px; min-height: 30px; border: 1px dashed #b9cde3; border-radius: 7px; background: transparent; color: #2a5482; font-size: 12px; font-weight: 500; line-height: 1.3; text-align: left; }
#s365-chat .s365-chat-related button:hover { border-style: solid; background: #fff; }

/* Indicator de scriere */
#s365-chat .s365-chat-typing { display: inline-flex; align-items: center; gap: 4px; padding: 13px 14px; }
#s365-chat .s365-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8aa2bd; animation: s365-chat-dot 1.1s infinite ease-in-out; }
#s365-chat .s365-chat-typing span:nth-child(2) { animation-delay: .15s; }
#s365-chat .s365-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes s365-chat-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Subiecte după prima întrebare */
#s365-chat .s365-chat-topics { display: none; flex-shrink: 0; gap: 6px; padding: 10px 14px 2px; overflow-x: auto; scrollbar-width: none; background: #fff; border-top: 1px solid #e8eef5; }
#s365-chat .s365-chat-topics::-webkit-scrollbar { display: none; }
#s365-chat[data-engaged="true"] .s365-chat-topics { display: flex; }
#s365-chat .s365-chat-topics button { flex-shrink: 0; padding: 6px 11px; min-height: 30px; border: 1px solid var(--s365-chat-line); border-radius: 7px; background: var(--s365-chat-soft); color: #214567; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
#s365-chat .s365-chat-topics button:hover { background: var(--s365-chat-sky); border-color: #c2d3e6; }

#s365-chat .s365-chat-status { flex-shrink: 0; min-height: 0; padding: 0 16px; color: #9a3412; font-size: 11.5px; line-height: 1.5; background: #fff; }
#s365-chat .s365-chat-status:not(:empty) { padding-top: 6px; }

/* Formular */
#s365-chat .s365-chat-form { display: flex; flex-shrink: 0; align-items: flex-end; gap: 8px; margin: 0; padding: 12px 14px 4px; background: #fff; border-top: 1px solid #e8eef5; }
#s365-chat[data-engaged="true"] .s365-chat-form { border-top: 0; }
#s365-chat .s365-chat-form textarea {
  display: block; flex: 1; width: 100%; height: 44px; min-height: 44px; max-height: 96px; resize: none; margin: 0; padding: 11px 12px;
  border: 1px solid #c6d5e5; border-radius: var(--s365-chat-r); outline: 0; background: #fff; color: var(--s365-chat-ink); box-shadow: none; font-size: 14px; line-height: 20px;
}
#s365-chat .s365-chat-form textarea:focus { border-color: #5c94c4; box-shadow: 0 0 0 3px #dcecf9; outline: none; }
#s365-chat .s365-chat-form textarea::placeholder { color: #7a8899; opacity: 1; }
#s365-chat .s365-chat-form button { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--s365-chat-r); background: var(--s365-chat-navy); color: #fff; }
#s365-chat .s365-chat-form button:hover { background: var(--s365-chat-navy-2); }
#s365-chat .s365-chat-form button svg { width: 20px; height: 20px; }
#s365-chat button:disabled { cursor: wait; opacity: .55; transform: none; }

#s365-chat .s365-chat-ai { flex-shrink: 0; padding: 8px 16px 0; font-size: 11px; color: #52677e; background: #fff; }
#s365-chat .s365-chat-ai label { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: inherit; line-height: 1.5; cursor: pointer; }
#s365-chat .s365-chat-ai input { -webkit-appearance: auto; appearance: auto; position: static; width: 14px; height: 14px; margin: 2px 0 0; opacity: 1; flex-shrink: 0; accent-color: #082f63; }

#s365-chat .s365-chat-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 10px; padding: 8px 16px 12px; font-size: 10.5px; line-height: 1.45; color: #6a7c90; background: #fff; }
#s365-chat .s365-chat-footer span { display: flex; align-items: center; gap: 5px; min-width: 0; }
#s365-chat .s365-chat-footer span svg { width: 13px; height: 13px; }
#s365-chat .s365-chat-privacy { flex-shrink: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #3c6388; text-decoration: underline; font-size: 10.5px; font-weight: 500; line-height: 1.45; }
#s365-chat .s365-chat-privacy-panel { position: absolute; inset: 70px 0 0; padding: 20px; background: #fff; overflow-y: auto; color: #40556b; }
#s365-chat .s365-chat-privacy-panel h3 { margin: 0 0 12px; font: 700 15px/1.3 var(--s365-chat-head); color: var(--s365-chat-navy); }
#s365-chat .s365-chat-privacy-panel p { font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
#s365-chat .s365-chat-privacy-panel a { color: #164c81; text-decoration: underline; }
#s365-chat .s365-chat-privacy-back { display: block; margin-top: 20px; padding: 10px 14px; border: 0; border-radius: var(--s365-chat-r); background: var(--s365-chat-navy); color: #fff; font-size: 13px; font-weight: 600; }
#s365-chat .s365-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Ecrane joase */
#s365-chat[data-compact="true"] .s365-chat-header { padding: 9px 8px 9px 12px; }
#s365-chat[data-compact="true"] .s365-chat-mark { width: 34px; height: 34px; }
#s365-chat[data-compact="true"] .s365-chat-mark svg { width: 21px; height: 21px; }
#s365-chat[data-compact="true"] .s365-chat-header h2 { font-size: 14.5px; }
#s365-chat[data-compact="true"] .s365-chat-cards small { display: none; }
#s365-chat[data-compact="true"] .s365-chat-cards button { min-height: 48px; padding: 8px; }
#s365-chat[data-compact="true"] .s365-chat-form { padding-top: 8px; }
#s365-chat[data-compact="true"] .s365-chat-footer { padding-top: 6px; padding-bottom: 8px; }
#s365-chat[data-compact="true"] .s365-chat-privacy-panel { top: 54px; }

@media (max-width: 767px) {
  /* Calculatorul deține bara fixă de acțiuni cât este deschis, inclusiv în PWA. */
  body.s365-calc-on #s365-chat { display: none; }
  #s365-chat { --s365-chat-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  #s365-chat .s365-chat-launch { left: 12px; height: 46px; padding: 0 12px 0 6px; gap: 8px; }
  #s365-chat .s365-chat-launch-icon { width: 32px; height: 32px; }
  #s365-chat .s365-chat-launch-icon svg { width: 20px; height: 20px; }
  #s365-chat .s365-chat-launch-text strong { font-size: 13px; }
  #s365-chat .s365-chat-launch-text small { font-size: 10px; }
  #s365-chat-panel { left: 12px; width: calc(100vw - 24px); max-width: 420px; height: min(620px, var(--s365-chat-height)); }
  #s365-chat .s365-chat-header { padding: 11px 8px 11px 12px; gap: 8px; }
  #s365-chat .s365-chat-mark { width: 38px; height: 38px; }
  #s365-chat .s365-chat-header h2 { font-size: 15px; }
  #s365-chat .s365-chat-icon, #s365-chat .s365-chat-close { width: 34px; height: 34px; }
  #s365-chat .s365-chat-messages { padding: 14px 12px 6px; }
  #s365-chat .s365-chat-message { max-width: 92%; }
  #s365-chat .s365-chat-message p { font-size: 13px; }
  #s365-chat .s365-chat-cards { gap: 6px; }
  #s365-chat .s365-chat-cards button { padding: 8px; column-gap: 7px; }
  #s365-chat .s365-chat-card-ic { width: 28px; height: 28px; }
  #s365-chat .s365-chat-form { padding: 10px 12px 4px; }
  #s365-chat .s365-chat-form textarea { font-size: 16px; }
  #s365-chat .s365-chat-footer { padding: 6px 12px 10px; font-size: 10px; }
  #s365-chat .s365-chat-privacy-panel { inset: 62px 0 0; }
}
@media (max-width: 480px) {
  #s365-chat .s365-chat-cards { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #s365-chat .s365-chat-cards button { min-height: 52px; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #s365-chat button, #s365-chat-panel { transition: none; animation: none; }
  #s365-chat .s365-chat-typing span { animation: none; opacity: .7; }
}
