/**
 * C&C SRL — assistant widget styles.
 * Uses the theme design tokens from base.css.
 *
 * @package ccsrl-hightech
 */

/* Tokens this widget needs that base.css does not define yet.
   CONTRACT.md §3 allows hex only inside a :root block. */
:root{
  --cc-navy-hover: #244d84;  /* navy launcher hover */
  --cc-orange-dk:  #e0611f;  /* orange hover */
  --cc-error:      #b3261e;  /* form error text */
}

/* The launcher used to pop in at full size the instant the page painted,
   which reads as an ad. It now arrives a couple of seconds later, after the
   visitor has had time to look at the page. Animation only under .cc-js and
   only when motion is welcome — see the reduced-motion block below, and note
   the button is fully usable throughout regardless. */
@keyframes cc-chat-in{
  from{ opacity: 0; transform: scale(.6); }
  to{   opacity: 1; transform: scale(1); }
}

.cc-js .cc-chat__launch{
  animation: cc-chat-in .45s cubic-bezier(.2,.7,.3,1) 2s backwards;
}

@media (prefers-reduced-motion: reduce){
  .cc-js .cc-chat__launch{ animation: none; }
}

.cc-chat__launch{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cc-navy);
  color: var(--cc-surface);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(30, 66, 114, 0.34);
  transition: transform .2s var(--cc-ease), background-color .2s var(--cc-ease);
}

.cc-chat__launch::after{
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--cc-orange);
  opacity: 0;
  transition: opacity .2s var(--cc-ease);
}

.cc-chat__launch:hover{ transform: translateY(-2px); background: var(--cc-navy-hover); }
.cc-chat__launch:hover::after,
.cc-chat__launch:focus-visible::after{ opacity: 1; }
.cc-chat__launch.is-open{ background: var(--cc-orange); }

.cc-chat__panel{
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 9000;
  width: 350px;
  max-width: calc(100vw - 32px);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cc-surface);
  border: 1px solid rgba(30, 66, 114, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 40, 70, 0.28);
}

.cc-chat__panel[hidden]{ display: none; }

.cc-chat__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cc-navy);
  color: var(--cc-surface);
  border-bottom: 3px solid var(--cc-orange);
}

.cc-chat__heads{ display: flex; flex-direction: column; line-height: 1.2; }
.cc-chat__title{ font-family: var(--cc-font-display); font-size: 16px; font-weight: 700; }
.cc-chat__subtitle{ font-family: var(--cc-font-mono); font-size: 10px; letter-spacing: 1px; color: var(--cc-on-navy-dim); text-transform: uppercase; margin-top: 2px; }

.cc-chat__close{
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--cc-surface);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cc-chat__close:hover{ background: rgba(255, 255, 255, 0.24); }

.cc-chat__body{
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cc-bg);
}

.cc-chat__msg{ display: flex; }
.cc-chat__msg--bot{ justify-content: flex-start; }
.cc-chat__msg--user{ justify-content: flex-end; }

.cc-chat__bubble{
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.cc-chat__msg--bot .cc-chat__bubble{
  background: var(--cc-surface);
  color: var(--cc-ink);
  border: 1px solid rgba(30, 66, 114, 0.12);
  border-bottom-left-radius: 4px;
}

.cc-chat__msg--user .cc-chat__bubble{
  background: var(--cc-navy);
  color: var(--cc-surface);
  border-bottom-right-radius: 4px;
}

.cc-chat__quick{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(30, 66, 114, 0.1);
  background: var(--cc-surface);
}

.cc-chat__chip{
  border: 1px solid var(--cc-navy);
  background: transparent;
  color: var(--cc-navy);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s var(--cc-ease), color .18s var(--cc-ease);
}
.cc-chat__chip:hover{ background: var(--cc-navy); color: var(--cc-surface); }

.cc-chat__form{
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  background: var(--cc-surface);
  border: 1px solid rgba(30, 66, 114, 0.12);
  border-radius: 12px;
  margin-top: 4px;
}

.cc-chat__field{ display: flex; flex-direction: column; gap: 3px; }
.cc-chat__label{ font-size: 12px; font-weight: 600; color: var(--cc-navy); }

.cc-chat__input{
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--cc-ink);
  background: var(--cc-bg);
  border: 1px solid rgba(30, 66, 114, 0.18);
  border-radius: 8px;
}
.cc-chat__input:focus{ outline: 2px solid var(--cc-orange); outline-offset: 1px; border-color: var(--cc-orange); }
textarea.cc-chat__input{ resize: vertical; min-height: 60px; }

.cc-chat__hp{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cc-chat__error{ margin: 0; font-size: 13px; color: var(--cc-error); min-height: 1px; }

.cc-chat__submit{
  margin-top: 2px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--cc-orange);
  color: var(--cc-surface);
  font-family: var(--cc-font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .18s var(--cc-ease);
}
.cc-chat__submit:hover{ background: var(--cc-orange-dk); }
.cc-chat__submit:disabled{ opacity: .6; cursor: default; }

.cc-chat-noscript{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--cc-navy);
  color: var(--cc-surface);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(30, 66, 114, 0.34);
}

@media (max-width: 480px){
  .cc-chat__panel{
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-height: 70vh;
  }
  .cc-chat__launch{ right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce){
  .cc-chat__launch{ transition: none; }
}
