/* TEN Livechat — CI: hell, edel, TEN-Rot #cc0607, Nunito Sans */

.ten-livechat {
  --lc-ink: #1a1a1a;
  --lc-muted: #5a5a5a;
  --lc-line: #e6e8ec;
  --lc-surface: #ffffff;
  --lc-surface-soft: #f6f7f9;
  --lc-red: #cc0607;
  --lc-red-hover: #a80506;
  --lc-red-soft: rgba(204, 6, 7, 0.08);
  --lc-green: #159947;
  --lc-green-soft: #e8f6ec;
  --lc-radius: 20px;
  --lc-radius-sm: 10px;
  --lc-shadow: 0 20px 50px rgba(15, 23, 42, 0.14), 0 4px 14px rgba(15, 23, 42, 0.06);
  --lc-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 15000;
  font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--lc-ink);
}

/* —— FAB —— */
.ten-livechat__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 58px;
  height: 58px;
  padding: 0 16px 0 10px;
  border: 1px solid rgba(204, 6, 7, 0.1);
  border-radius: 999px;
  background: var(--lc-surface);
  color: var(--lc-ink);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: background 0.22s var(--lc-ease), box-shadow 0.22s var(--lc-ease), border-color 0.22s var(--lc-ease);
}

.ten-livechat__fab:hover,
.ten-livechat__fab:focus {
  background: #fff;
  border-color: rgba(204, 6, 7, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1), 0 0 0 3px var(--lc-red-soft);
  outline: none;
}

.ten-livechat__fab-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ten-livechat__signal {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
}

.ten-livechat__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lc-green);
  box-shadow: 0 0 0 3px rgba(21, 153, 71, 0.15);
}

.ten-livechat.is-live .ten-livechat__dot {
  animation: ten-livechat-glow 16s ease-in-out infinite;
}

.ten-livechat.is-live.is-panel-open .ten-livechat__dot,
.ten-livechat.is-live .ten-livechat__fab:hover .ten-livechat__dot,
.ten-livechat.is-live .ten-livechat__fab:focus .ten-livechat__dot {
  animation: none;
}

.ten-livechat.is-away .ten-livechat__dot {
  background: var(--lc-red);
  box-shadow: 0 0 0 3px rgba(204, 6, 7, 0.12);
  animation: none;
}

@keyframes ten-livechat-glow {
  0%, 86%, 100% {
    background: var(--lc-green);
    box-shadow: 0 0 0 3px rgba(21, 153, 71, 0.15);
  }
  90%, 94% {
    background: #4cd964;
    box-shadow: 0 0 0 5px rgba(62, 207, 90, 0.28), 0 0 14px rgba(62, 207, 90, 0.45);
  }
}

/* —— Panel —— */
.ten-livechat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(400px, calc(100vw - 24px));
  max-height: min(72vh, 580px);
  display: flex;
  flex-direction: column;
  background: var(--lc-surface);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  overflow: hidden;
  z-index: 1;
}

.ten-livechat__panel[hidden] {
  display: none !important;
}

.ten-livechat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-bottom: 1px solid var(--lc-line);
  position: relative;
}

.ten-livechat__head::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lc-red) 0%, #e83536 55%, rgba(204, 6, 7, 0.15) 100%);
}

.ten-livechat__head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.ten-livechat__head-eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lc-red);
}

.ten-livechat__head-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ten-livechat__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--lc-ink);
}

.ten-livechat__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--lc-green-soft);
  color: #0f6b32;
}

.ten-livechat__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ten-livechat.is-away .ten-livechat__status {
  background: var(--lc-red-soft);
  color: var(--lc-red);
}

.ten-livechat.is-away .ten-livechat__status::before {
  animation: none;
}

.ten-livechat.is-live .ten-livechat__status::before {
  animation: ten-livechat-dot 2s ease-in-out infinite;
}

@keyframes ten-livechat-dot {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.ten-livechat__subtitle {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--lc-muted);
}

.ten-livechat.is-away .ten-livechat__subtitle {
  display: none;
}

.ten-livechat__close {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 2px 0 0;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4a5563;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s var(--lc-ease), opacity 0.2s var(--lc-ease);
}

.ten-livechat__close:hover,
.ten-livechat__close:focus {
  color: var(--lc-ink);
  opacity: 1;
  outline: none;
}

.ten-livechat__close svg {
  display: block;
}

/* —— Body —— */
.ten-livechat__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--lc-surface-soft);
}

.ten-livechat__intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lc-muted);
}

.ten-livechat__start {
  padding: 18px;
  background: #fff;
}

.ten-livechat__field {
  display: block;
  margin-bottom: 12px;
}

.ten-livechat__field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--lc-ink);
}

.ten-livechat__field input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #9aa3ad;
  border-radius: var(--lc-radius-sm);
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--lc-ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s var(--lc-ease), box-shadow 0.2s var(--lc-ease);
}

.ten-livechat__field input::placeholder {
  color: #6b7280;
}

.ten-livechat__field input:hover {
  border-color: #6b7280;
}

.ten-livechat__field input:focus {
  border-color: var(--lc-red);
  box-shadow: 0 0 0 3px var(--lc-red-soft), inset 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
}

.ten-livechat__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: var(--lc-red);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(204, 6, 7, 0.2);
  transition: background 0.22s var(--lc-ease), box-shadow 0.22s var(--lc-ease), transform 0.22s var(--lc-ease);
}

.ten-livechat__submit:hover,
.ten-livechat__submit:focus {
  background: var(--lc-red-hover);
  box-shadow: 0 10px 26px rgba(204, 6, 7, 0.26);
  outline: none;
}

.ten-livechat__submit:active {
  transform: translateY(1px);
}

/* —— Chat view —— */
.ten-livechat__chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 280px;
  max-height: min(52vh, 420px);
}

.ten-livechat__meta {
  flex: 0 0 auto;
  padding: 10px 16px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--lc-muted);
  text-transform: uppercase;
}

.ten-livechat__messages {
  flex: 1 1 auto;
  min-height: 140px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 8px;
  scroll-behavior: smooth;
}

.ten-livechat__bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ten-livechat__bubble--in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--lc-line);
  color: var(--lc-ink);
  border-bottom-left-radius: 4px;
}

.ten-livechat__bubble--out {
  align-self: flex-end;
  background: #fff5f5;
  border: 1px solid rgba(204, 6, 7, 0.12);
  color: var(--lc-ink);
  border-bottom-right-radius: 4px;
}

.ten-livechat__composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 12px 14px 14px;
  background: #fff;
  border-top: 1px solid var(--lc-line);
}

.ten-livechat__composer textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1.5px solid #9aa3ad;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  background: #fff;
  color: var(--lc-ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s var(--lc-ease), box-shadow 0.2s var(--lc-ease);
}

.ten-livechat__composer textarea::placeholder {
  color: #6b7280;
}

.ten-livechat__composer textarea:focus {
  border-color: var(--lc-red);
  box-shadow: 0 0 0 3px var(--lc-red-soft), inset 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
}

.ten-livechat__send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--lc-red);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(204, 6, 7, 0.22);
  transition: background 0.22s var(--lc-ease), box-shadow 0.22s var(--lc-ease), transform 0.22s var(--lc-ease);
}

.ten-livechat__send:hover,
.ten-livechat__send:focus {
  background: var(--lc-red-hover);
  box-shadow: 0 8px 20px rgba(204, 6, 7, 0.28);
  outline: none;
}

.ten-livechat__send:active {
  transform: translateY(1px);
}

.ten-livechat .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ten-livechat .ten-sg-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .ten-livechat__fab {
    min-width: 66px;
    height: 62px;
  }
}

@media (max-width: 480px) {
  .ten-livechat__panel {
    width: calc(100vw - 24px);
    right: 0;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ten-livechat.is-live .ten-livechat__dot,
  .ten-livechat.is-live .ten-livechat__status::before {
    animation: none;
  }
}
