/* Codex Line — live chat AI. Toate clasele sunt prefixate cu .cxl- ca să nu interfereze cu tema. */
.cxl-root {
  --cxl-accent: #1FC3B0;
  --cxl-accent-2: #17a596;
  --cxl-accent-ink: #06231f;
  --cxl-bg: #121314;
  --cxl-surface: #1b1d1f;
  --cxl-surface-2: #24272a;
  --cxl-line: rgba(255, 255, 255, .08);
  --cxl-text: #f2f4f5;
  --cxl-muted: #9aa3a8;
  --cxl-radius: 22px;
  --cxl-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: Montserrat, "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cxl-text);
  -webkit-font-smoothing: antialiased;
}
.cxl-root *, .cxl-root *::before, .cxl-root *::after { box-sizing: border-box; }
.cxl-root button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none; }
.cxl-root p { margin: 0; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.cxl-root a { color: inherit; }
.cxl-root svg { display: block; width: 100%; height: 100%; }
.cxl-root [hidden] { display: none !important; }
.cxl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Lansator ---------------- */
.cxl-launcher {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50% !important;
  background: linear-gradient(145deg, #2be0cb, var(--cxl-accent-2)) !important;
  color: var(--cxl-accent-ink) !important;
  box-shadow: 0 12px 30px -6px rgba(31, 195, 176, .55), 0 4px 12px rgba(0, 0, 0, .35) !important;
  display: grid;
  place-items: center;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
  opacity: 0;
  transform: scale(.6);
}
.cxl-ready .cxl-launcher { opacity: 1; transform: scale(1); }
.cxl-launcher:hover { transform: scale(1.06); }
.cxl-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.cxl-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--cxl-accent);
  animation: cxl-ring 2.8s ease-out infinite;
  pointer-events: none;
}
.cxl-open .cxl-launcher::before { animation: none; opacity: 0; }
@keyframes cxl-ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
.cxl-launcher-ico { position: absolute; width: 30px; height: 30px; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.cxl-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); width: 28px; height: 28px; }
.cxl-open .cxl-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.cxl-open .cxl-ico-close { opacity: 1; transform: none; }
.cxl-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--cxl-bg);
}

/* ---------------- Bula de previzualizare (teaser) ---------------- */
.cxl-teaser {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px 14px;
  border-radius: 18px 18px 6px 18px;
  background: var(--cxl-surface);
  box-shadow: var(--cxl-shadow);
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.cxl-teaser.cxl-show { opacity: 1; transform: none; }
.cxl-teaser-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.cxl-teaser-head .cxl-avatar { width: 26px; height: 26px; }
.cxl-teaser-text { color: #dfe4e6; cursor: pointer; font-size: 14px; }
.cxl-teaser-cta {
  margin-top: 10px !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: var(--cxl-accent) !important;
  color: var(--cxl-accent-ink) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.cxl-teaser-x {
  position: absolute !important;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 6px !important;
  border-radius: 50% !important;
  color: var(--cxl-muted) !important;
}
.cxl-teaser-x:hover { background: var(--cxl-surface-2) !important; color: #fff !important; }

/* ---------------- Panou ---------------- */
.cxl-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 390px;
  height: min(640px, calc(100vh - 120px - var(--cxl-lift, 0px)));
  display: flex;
  flex-direction: column;
  border-radius: var(--cxl-radius);
  background: var(--cxl-bg);
  box-shadow: var(--cxl-shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .22s, transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s;
}
.cxl-open .cxl-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .22s, transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s; }

.cxl-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 16px 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(31, 195, 176, .28), transparent 55%),
    linear-gradient(180deg, #1c1f21, #16181a);
  border-bottom: 1px solid var(--cxl-line);
}
.cxl-head-id { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.cxl-head-id .cxl-avatar { width: 42px; height: 42px; flex: none; }
.cxl-online {
  position: absolute;
  left: 31px;
  top: 30px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #36d67a;
  box-shadow: 0 0 0 2.5px #1a1d1f;
}
.cxl-head-name { font-weight: 700; font-size: 15px; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cxl-head-status { font-size: 12px; color: var(--cxl-muted); }
.cxl-test { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 6px; border-radius: 5px; background: #ffb020; color: #2b1d00; font-size: 10px; font-weight: 800; }
.cxl-head-actions { display: flex; gap: 2px; flex: none; }
.cxl-icon-btn { width: 36px; height: 36px; padding: 9px !important; border-radius: 10px !important; color: #c9d0d3 !important; transition: background .15s, color .15s; }
.cxl-icon-btn:hover, .cxl-icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
.cxl-icon-btn:focus-visible, .cxl-chip:focus-visible, .cxl-send:focus-visible { outline: 2px solid var(--cxl-accent); outline-offset: 2px; }

.cxl-menu {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 3;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  background: var(--cxl-surface-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 1px var(--cxl-line);
}
.cxl-menu a, .cxl-menu button {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-size: 13.5px !important;
  text-align: left;
  color: #e9edef !important;
}
.cxl-menu a:hover, .cxl-menu button:hover { background: rgba(255, 255, 255, .07) !important; }
.cxl-menu svg { width: 18px; height: 18px; flex: none; color: var(--cxl-accent); }

/* ---------------- Mesaje ---------------- */
.cxl-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px 8px;
  scroll-behavior: smooth;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(31, 195, 176, .05), transparent 70%),
    var(--cxl-bg);
}
.cxl-body::-webkit-scrollbar { width: 6px; }
.cxl-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }
.cxl-log { display: flex; flex-direction: column; gap: 10px; }
.cxl-row { display: flex; align-items: flex-end; gap: 8px; animation: cxl-in .28s cubic-bezier(.2, .8, .2, 1) both; }
.cxl-row.cxl-grouped { margin-top: -6px; }
@keyframes cxl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cxl-row-av { width: 28px; flex: none; align-self: flex-start; }
.cxl-row-av .cxl-avatar { width: 28px; height: 28px; }
.cxl-avatar { display: block; border-radius: 50%; overflow: hidden; }
.cxl-bwrap { display: flex; flex-direction: column; max-width: 82%; min-width: 0; }
.cxl-user { justify-content: flex-end; }
.cxl-user .cxl-bwrap { align-items: flex-end; }
.cxl-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.cxl-bot .cxl-bubble { background: var(--cxl-surface); color: var(--cxl-text); border-top-left-radius: 6px; }
.cxl-bot.cxl-grouped .cxl-bubble { border-top-left-radius: 18px; }
.cxl-user .cxl-bubble { background: linear-gradient(145deg, #25d3bf, var(--cxl-accent-2)); color: var(--cxl-accent-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.cxl-bubble p + p { margin-top: 6px; }
.cxl-bubble .cxl-gap { display: block; height: 4px; }
.cxl-bubble ul, .cxl-bubble ol { margin: 6px 0 6px 2px !important; padding-left: 18px !important; }
.cxl-bubble li { margin: 3px 0 !important; padding: 0 !important; list-style: inherit; }
.cxl-bubble ul li { list-style: disc; }
.cxl-bubble ol li { list-style: decimal; }
.cxl-bubble li::marker { color: var(--cxl-accent); }
.cxl-bubble strong { font-weight: 700; color: #fff; }
.cxl-user .cxl-bubble strong { color: inherit; }
.cxl-bot .cxl-bubble a { color: var(--cxl-accent) !important; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.cxl-bot .cxl-bubble a:hover { color: #6ff0e0 !important; }
.cxl-time { font-size: 11px; color: #6c767b; margin: 3px 6px 0; }
.cxl-time:empty { display: none; }
.cxl-grouped + .cxl-grouped .cxl-time { }
.cxl-caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--cxl-accent); animation: cxl-blink 1s steps(2) infinite; }
@keyframes cxl-blink { 50% { opacity: 0; } }

.cxl-typing { display: inline-flex; align-items: center; gap: 4px; padding: 13px 16px !important; }
.cxl-typing span { width: 7px; height: 7px; border-radius: 50%; background: #7d898e; animation: cxl-dot 1.2s infinite ease-in-out; }
.cxl-typing span:nth-child(2) { animation-delay: .15s; }
.cxl-typing span:nth-child(3) { animation-delay: .3s; }
.cxl-typing em { margin-left: 8px; font-style: normal; font-size: 12.5px; color: var(--cxl-muted); }
@keyframes cxl-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.cxl-sys { justify-content: center; }
.cxl-err { max-width: 92%; padding: 10px 12px; border-radius: 12px; background: rgba(255, 77, 79, .1); border: 1px solid rgba(255, 77, 79, .3); color: #ffc9c9; font-size: 13px; text-align: center; }
.cxl-retry { margin-left: 6px !important; padding: 3px 10px !important; border-radius: 999px !important; background: rgba(255, 255, 255, .1) !important; font-weight: 600 !important; font-size: 12.5px !important; color: #fff !important; }

/* ---------------- Răspunsuri rapide ---------------- */
.cxl-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 10px 50px; }
.cxl-chip {
  padding: 8px 13px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(31, 195, 176, .45) !important;
  color: #bff5ee !important;
  background: rgba(31, 195, 176, .08) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  transition: background .15s, border-color .15s, transform .15s;
  animation: cxl-in .35s .1s cubic-bezier(.2, .8, .2, 1) both;
}
.cxl-chip:hover { background: rgba(31, 195, 176, .2) !important; border-color: var(--cxl-accent) !important; transform: translateY(-1px); }

/* ---------------- Formular ---------------- */
.cxl-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 12px;
  padding: 6px 6px 6px 14px;
  border-radius: 16px;
  background: var(--cxl-surface);
  border: 1px solid var(--cxl-line);
  transition: border-color .15s, box-shadow .15s;
}
.cxl-form:focus-within { border-color: rgba(31, 195, 176, .6); box-shadow: 0 0 0 3px rgba(31, 195, 176, .12); }
.cxl-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  margin: 0 !important;
  padding: 8px 0 !important;
  border: 0 !important;
  outline: 0 !important;
  resize: none;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--cxl-text) !important;
  font: inherit;
  font-size: 15px !important;
  line-height: 1.35 !important;
}
.cxl-input::placeholder { color: #7a8489; }
.cxl-send {
  width: 38px;
  height: 38px;
  flex: none;
  padding: 9px !important;
  border-radius: 12px !important;
  background: var(--cxl-accent) !important;
  color: var(--cxl-accent-ink) !important;
  transition: opacity .15s, transform .15s;
}
.cxl-send:not(:disabled):hover { transform: scale(1.05); }
.cxl-send:disabled { opacity: .35; cursor: default; }
.cxl-foot { padding: 8px 16px 12px; font-size: 11px; color: #6f797e; text-align: center; }
.cxl-foot a { color: #9aa3a8 !important; text-decoration: underline; }

/* ---------------- Mobil ---------------- */
@media (max-width: 560px) {
  .cxl-root { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cxl-launcher { width: 56px; height: 56px; }
  .cxl-teaser { bottom: 70px; width: calc(100vw - 32px); }
  .cxl-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    transform: translateY(24px);
  }
  .cxl-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .cxl-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .cxl-open .cxl-launcher { opacity: 0; pointer-events: none; transform: scale(.6); }
  .cxl-input { font-size: 16px !important; } /* fără zoom automat pe iOS */
  .cxl-bwrap { max-width: 86%; }
}
html.cxl-lock, html.cxl-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
  .cxl-root *, .cxl-root *::before { animation: none !important; transition: none !important; }
}
@media print { .cxl-root { display: none !important; } }
