/* =========================================================
   Compu-Tech Chat Toggle  v1.1.0
   ========================================================= */

.ct-chat-toggle,
.ct-chat-widget,
.ct-chat-widget * {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

/* ----- Toggle button (always visible, bottom-right) ----- */
.ct-chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0 14px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b4fa8, #1174d6);
  box-shadow: 0 8px 28px rgba(8, 35, 74, 0.35);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 999999;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.ct-chat-toggle:hover,
.ct-chat-toggle:focus {
  background: linear-gradient(135deg, #084f9f, #0b63c7);
  box-shadow: 0 12px 36px rgba(8, 35, 74, 0.45);
  transform: translateY(-2px);
  outline: none;
}

.ct-chat-toggle-icon {
  font-size: 20px;
  line-height: 1;
}

/* ----- Chat widget panel ----- */
.ct-chat-widget {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(580px, calc(100vh - 110px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(8, 35, 74, 0.12);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(8, 35, 74, 0.22);
  z-index: 999998;
  animation: ct-slide-up 0.22s ease;
}

@keyframes ct-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ct-chat-widget.is-open {
  display: flex;
}

/* ----- Header ----- */
.ct-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b4fa8, #1174d6);
  flex-shrink: 0;
}

.ct-chat-header-icon {
  font-size: 20px;
  line-height: 1;
}

.ct-chat-header strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.25;
  flex: 1;
}

.ct-chat-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ct-chat-close:hover,
.ct-chat-close:focus {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

/* ----- Form ----- */
.ct-chat-form {
  padding: 14px 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.ct-chat-label {
  display: block;
  margin: 12px 0 5px;
  color: #102033;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.ct-chat-label:first-child {
  margin-top: 4px;
}

.ct-chat-form input,
.ct-chat-form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cfd8e3;
  border-radius: 8px;
  color: #102033;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ct-chat-form input {
  min-height: 42px;
}

.ct-chat-form textarea {
  min-height: 90px;
  resize: vertical;
}

.ct-chat-form input::placeholder,
.ct-chat-form textarea::placeholder {
  color: #9aacbc;
}

.ct-chat-form input:focus,
.ct-chat-form textarea:focus {
  border-color: #1174d6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 116, 214, 0.14);
}

/* ----- Submit button ----- */
.ct-chat-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b4fa8, #1174d6);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.ct-chat-submit:hover,
.ct-chat-submit:focus {
  opacity: 0.9;
  transform: translateY(-1px);
  outline: none;
}

.ct-chat-submit:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

/* ----- Status message ----- */
.ct-chat-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: #23405f;
}

.ct-chat-status.is-error   { color: #b42318; }
.ct-chat-status.is-success { color: #067647; font-weight: 700; }

/* ----- Mobile ----- */
@media (max-width: 600px) {
  .ct-chat-toggle {
    right: 12px;
    bottom: 12px;
    padding: 0 16px 0 12px;
    height: 52px;
    font-size: 14px;
  }

  .ct-chat-widget {
    right: 8px;
    bottom: 78px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 96px);
  }
}
