/* Callback widget — compact icon first, expand on first click */

.callback-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: inherit;
}

.callback-widget,
.callback-widget * {
  box-sizing: border-box;
}

.callback-widget.is-hidden {
  display: none !important;
}

/* Collapsed state: square icon button */
.callback-widget__toggle {
  position: relative;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  margin: 0;
  border: 0 !important;
  outline: none !important;
  outline-offset: 0 !important;
  border-radius: 3px;
  background: #FF8B00 !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;
  transition:
    width .24s ease,
    min-width .24s ease,
    padding .24s ease,
    gap .24s ease,
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
  vertical-align: middle;
  text-decoration: none;
  overflow: hidden;
}

.callback-widget__toggle:hover,
.callback-widget__toggle:active,
.callback-widget__toggle:focus,
.callback-widget__toggle:focus-visible {
  border: 0 !important;
  outline: none !important;
  outline-offset: 0 !important;
  background: #FF8B00 !important;
  color: #fff !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26) !important;
}

.callback-widget__toggle:hover {
  transform: translateY(-1px);
}

.callback-widget__toggle:active {
  transform: translateY(0);
}

.callback-widget__icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  line-height: 1;
}

.callback-widget__label {
  display: inline-flex !important;
  align-items: center !important;
  align-self: center !important;
  flex: 0 0 auto;
  width: 0;
  max-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap !important;
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  
  transition:
    max-width .22s ease,
    width .22s ease,
    opacity .18s ease;
}

/* Expanded state: icon + text */
.callback-widget.is-expanded .callback-widget__toggle {
  justify-content: flex-start !important;
  gap: 10px;
  width: auto;
  min-width: 220px;
  padding: 0 18px 0 14px;
}

.callback-widget.is-expanded .callback-widget__label {
  width: auto;
  max-width: 220px;
  opacity: 1;
}

/* Dismiss button only visible when expanded */
.callback-widget__dismiss {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 3;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: none !important;
  outline-offset: 0 !important;
  border-radius: 3px;
  background: #ffffff !important;
  color: #000000 !important;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22) !important;
}

.callback-widget.is-expanded .callback-widget__dismiss {
  display: inline-flex !important;
}

.callback-widget__dismiss:hover,
.callback-widget__dismiss:active,
.callback-widget__dismiss:focus,
.callback-widget__dismiss:focus-visible {
  border: 0 !important;
  outline: none !important;
  outline-offset: 0 !important;
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22) !important;
}

/* Overlay + popup */
.callback-widget__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
  z-index: 99997;
}

.callback-widget__popup {
  position: absolute;
  left: 0;
  bottom: 78px;
  width: min(360px, calc(100vw - 28px));
  border-radius: 18px;
  background: #fff;
  color: #111;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.26);
  overflow: visible;
  z-index: 99998;
  transform-origin: left bottom;
  animation: callbackWidgetIn .2s ease;
}

@keyframes callbackWidgetIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.callback-widget__popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f5;
  color: #111;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.callback-widget__popup-inner {
  padding: 22px 18px 18px;
}

.callback-widget__title {
  margin: 0 32px 16px 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.callback-widget__form {
  display: grid;
  gap: 10px;
}

.callback-widget__field-wrap {
  display: grid;
  gap: 6px;
}

.callback-widget__label-field {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.callback-widget__form input,
.callback-widget__form textarea {
  width: 100%;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font: inherit;
  color: #111;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.callback-widget__form input:focus,
.callback-widget__form textarea:focus {
  outline: none;
  border-color: #28c76f;
  box-shadow: 0 0 0 4px rgba(40, 199, 111, 0.14);
}

.callback-widget__honeypot {
  display: none !important;
}

.callback-widget__status {
  min-height: 18px;
  font-size: 13px;
  line-height: 1.4;
}

.callback-widget__status.is-error {
  color: #c92a2a;
}

.callback-widget__status.is-success {
  color: #117a37;
}

.callback-widget__submit {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: #28c76f;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
  box-shadow: 0 12px 26px rgba(40, 199, 111, 0.22);
}

.callback-widget__submit:hover {
  transform: translateY(-1px);
}

.callback-widget__submit:disabled {
  opacity: .7;
  cursor: wait;
  transform: none;
}

@media (max-width: 767px) {
  .callback-widget {
    left: 14px;
    bottom: 14px;
  }

  .callback-widget__toggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .callback-widget__label {
    min-height: 52px;
    font-size: 15px;
  }

  .callback-widget.is-expanded .callback-widget__toggle {
    min-width: 200px;
    padding: 0 16px 0 12px;
  }

  .callback-widget.is-expanded .callback-widget__label {
    max-width: 200px;
  }

  .callback-widget__dismiss {
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    font-size: 20px;
  }

  .callback-widget__popup {
    width: min(340px, calc(100vw - 28px));
    bottom: 74px;
  }
}
