/* ============================================
   Dental Live Chat — chat.css
   ============================================ */

/* ---- root / pill ---- */
#dlc-root {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

#dlc-pill {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 2147483645;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0a3d7c;
  color: #fff;
  padding: 11px 14px 11px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(10, 61, 124, .38);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .4s ease, transform .4s ease, box-shadow .25s;
  user-select: none;
  pointer-events: none;
}

#dlc-pill.dlc-pill-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#dlc-pill:hover {
  box-shadow: 0 10px 36px rgba(10, 61, 124, .48);
  transform: translateY(-2px);
}

#dlc-pill-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.dlc-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
}

.dlc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #4ade80;
  animation: dlc-ring 2s ease-out infinite;
}

@keyframes dlc-ring {
  0%   { transform: scale(1); opacity: .65; }
  75%, 100% { transform: scale(2.8); opacity: 0; }
}

/* ---- pill avatar ---- */
#dlc-pill-avatar-wrap {
  flex-shrink: 0;
}

#dlc-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

#dlc-pill-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#dlc-pill-avatar-emoji {
  font-size: 20px;
  line-height: 1;
}

#dlc-pill-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

#dlc-pill-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

#dlc-pill-text span {
  font-size: 11.5px;
  color: rgba(255,255,255,.58);
}

#dlc-pill-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  flex-shrink: 0;
  transition: background .2s;
  padding: 0;
  font-family: inherit;
}

#dlc-pill-close:hover {
  background: rgba(255,255,255,.26);
}

/* ---- widget ---- */
#dlc-widget {
  position: fixed;
  bottom: 100px;
  left: 28px;
  z-index: 2147483646;
  width: 350px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 60px rgba(10, 61, 124, .2), 0 4px 12px rgba(0,0,0,.08);
  display: none;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

#dlc-widget.dlc-widget-open {
  display: flex;
  animation: dlc-rise .3s cubic-bezier(.34, 1.45, .64, 1) both;
}

@keyframes dlc-rise {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ---- header ---- */
#dlc-header {
  background: linear-gradient(135deg, #0a3d7c 0%, #1d72c8 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

#dlc-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

#dlc-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#dlc-header-avatar-emoji {
  font-size: 24px;
  line-height: 1;
}

#dlc-header-avatar svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

#dlc-header-info {
  flex: 1;
  min-width: 0;
}

#dlc-header-name {
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -.01em;
}

#dlc-header-sub {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dlc-widget-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  padding: 0;
  font-family: inherit;
}

#dlc-widget-close:hover {
  background: rgba(255,255,255,.24);
}

/* ---- body ---- */
#dlc-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f2f7ff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
}

#dlc-body::-webkit-scrollbar { width: 3px; }
#dlc-body::-webkit-scrollbar-thumb { background: #c2d9f8; border-radius: 3px; }

/* steps */
.dlc-step {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: dlc-fadein .22s ease both;
}

.dlc-step.dlc-active {
  display: flex;
}

@keyframes dlc-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* bubble */
.dlc-bubble {
  background: #fff;
  border: 1px solid #d6e8ff;
  border-radius: 4px 16px 16px 16px;
  padding: 12px 15px;
  font-size: 14px;
  line-height: 1.65;
  color: #0f172a;
  max-width: 92%;
  box-shadow: 0 1px 4px rgba(10, 61, 124, .07);
}

/* chips */
#dlc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dlc-chip {
  background: #fff;
  border: 1.5px solid #b8d6f9;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #0a5bb5;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  line-height: 1;
}

.dlc-chip:hover,
.dlc-chip.dlc-chip-active {
  background: #0a5bb5;
  color: #fff;
  border-color: #0a5bb5;
  box-shadow: 0 4px 14px rgba(10, 91, 181, .28);
  transform: translateY(-1px);
}

/* free text area */
#dlc-free-wrap {
  background: #fff;
  border: 1.5px solid #b8d6f9;
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}

#dlc-free-wrap:focus-within {
  border-color: #1d72c8;
  box-shadow: 0 0 0 3px rgba(29, 114, 200, .12);
}

#dlc-free-text {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 13.5px;
  color: #0f172a;
  background: transparent;
  line-height: 1.6;
  font-family: inherit;
  min-height: 64px;
}

#dlc-free-text::placeholder {
  color: #94a3b8;
}

/* offline notice */
#dlc-offline-notice {
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  color: #6d4c00;
  line-height: 1.55;
  display: none;
}

#dlc-offline-notice strong {
  display: block;
  font-size: 13px;
  color: #5a3c00;
  margin-bottom: 3px;
}

/* form fields */
.dlc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dlc-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dlc-req {
  color: #e11d48;
}

.dlc-input {
  width: 100%;
  border: 1.5px solid #c8deff;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}

.dlc-input:focus {
  border-color: #1d72c8;
  box-shadow: 0 0 0 3px rgba(29, 114, 200, .12);
}

/* error */
#dlc-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 13px;
  color: #b91c1c;
  display: none;
  line-height: 1.45;
}

/* success */
#dlc-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px 8px;
}

#dlc-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 2px solid #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dlc-success-icon svg {
  width: 28px;
  height: 28px;
  color: #1d4ed8;
}

#dlc-success-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

#dlc-success-text {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.65;
  max-width: 260px;
}

/* ---- footer ---- */
#dlc-footer {
  background: #fff;
  border-top: 1px solid #d6e8ff;
  padding: 14px 16px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dlc-footer-step {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.dlc-footer-step.dlc-active {
  display: flex;
}

.dlc-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0a5bb5, #1d72c8);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .01em;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(10, 91, 181, .3);
}

.dlc-btn-primary:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(10, 91, 181, .38);
}

.dlc-btn-primary:active {
  transform: scale(.98);
}

.dlc-btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dlc-btn-secondary {
  width: 100%;
  background: transparent;
  color: #0a5bb5;
  border: 1.5px solid #b8d6f9;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.dlc-btn-secondary:hover {
  background: #f0f7ff;
  border-color: #0a5bb5;
}

#dlc-powered {
  text-align: center;
  font-size: 12px;
  color: black;
  margin-top: 6px;
  letter-spacing: .01em;
}

/* ---- responsive (mobile ≤ 420px) ---- */
@media (max-width: 767px) {
  #dlc-widget {
    width: calc(100vw - 20px);
    left: 10px;
    bottom: 86px;
    border-radius: 16px;
  }
  #dlc-pill {
    left: 14px;
    bottom: 14px;
    padding: 8px 10px;
    gap: 7px;
    max-width: calc(100vw - 120px);
  }
  #dlc-pill-text strong {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
  }
  #dlc-pill-text span {
    display: none;
  }
}