:root {
  --fcw-color: #0066cc;
  --fcw-color-hover: #0052a3;
  --fcw-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Floating button */
#floating-contact-widget-btn {
  position: fixed;
  right: 20px;
  z-index: 9999;
  cursor: pointer;
  background: var(--fcw-color);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#floating-contact-widget-btn:hover,
#floating-contact-widget-btn:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(0, 102, 204, 0.4);
  outline: none;
}

#floating-contact-widget-btn:active {
  transform: scale(0.95);
}

/* Pulsating animation */
#floating-contact-widget-btn.fcw-pulse {
  animation: fcw-pulse-animation 2s ease-in-out infinite;
}

@keyframes fcw-pulse-animation {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(0, 102, 204, 0.5);
  }
}

#floating-contact-widget-btn.fcw-pulse:hover,
#floating-contact-widget-btn.fcw-pulse:focus-visible {
  animation: none;
  transform: scale(1.1);
}

/* Tooltip - Right position (default) */
#floating-contact-widget-btn.fcw-position-right::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 75px;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--fcw-font-family);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
}

#floating-contact-widget-btn.fcw-position-right::after {
  content: '';
  position: absolute;
  right: 65px;
  border: 7px solid transparent;
  border-left-color: #1a1a1a;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip - Left position */
#floating-contact-widget-btn.fcw-position-left::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 75px;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--fcw-font-family);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
}

#floating-contact-widget-btn.fcw-position-left::after {
  content: '';
  position: absolute;
  left: 65px;
  border: 7px solid transparent;
  border-right-color: #1a1a1a;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#floating-contact-widget-btn:hover::before,
#floating-contact-widget-btn:hover::after {
  opacity: 1;
}

/* Modal box */
#floating-contact-widget-box {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: min(650px, calc(100vh - 120px));
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  flex-direction: column;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#floating-contact-widget-box.active {
  display: flex;
}

/* Header */
.floating-contact-widget-header {
  background: var(--fcw-color);
  color: #fff;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--fcw-font-family);
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.floating-contact-widget-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-weight: 300;
}

.floating-contact-widget-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Body */
.floating-contact-widget-body {
  color: #2d2d2d;
  font-family: var(--fcw-font-family);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.floating-contact-widget-body form {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.floating-contact-widget-form-fields {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  padding-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.floating-contact-widget-form-footer {
  flex-shrink: 0;
  padding: 16px 24px 24px 24px;
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* Custom scrollbar for webkit browsers */
.floating-contact-widget-form-fields::-webkit-scrollbar {
  width: 6px;
}

.floating-contact-widget-form-fields::-webkit-scrollbar-track {
  background: transparent;
}

.floating-contact-widget-form-fields::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.floating-contact-widget-form-fields::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.floating-contact-widget-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a4a;
  margin-top: 14px;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.floating-contact-widget-body input,
.floating-contact-widget-body textarea {
  width: 100%;
  padding: 12px 14px;
  margin-top: 0;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-family: var(--fcw-font-family);
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.2s;
  background: #fafafa;
  color: #2d2d2d;
}

.floating-contact-widget-body input:focus,
.floating-contact-widget-body textarea:focus {
  outline: none;
  border-color: var(--fcw-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.floating-contact-widget-body textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.floating-contact-widget-terms {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 14px 0;
  padding: 0;
  text-align: justify;
}

.floating-contact-widget-terms a {
  color: var(--fcw-color);
  text-decoration: underline;
}

.floating-contact-widget-terms a:hover {
  color: var(--fcw-color-hover);
}

.floating-contact-widget-form-footer button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--fcw-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  transition: all 0.3s;
  font-family: var(--fcw-font-family);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.floating-contact-widget-form-footer button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
  color: #fff;
}

.floating-contact-widget-form-footer button[type="submit"]:active {
  transform: translateY(0);
}

.floating-contact-widget-form-footer .helper {
  font-size: 13px;
  color: #666;
  margin-top: 10px;
  margin-bottom: 0;
  line-height: 1.4;
}


/* Footer link */
#floating-contact-widget-link {
  display: block;
  padding: 12px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--fcw-color);
  text-decoration: none;
  border-top: 1px solid #f0f0f0;
  transition: all 0.2s;
  flex-shrink: 0;
}

#floating-contact-widget-link:hover {
  color: var(--fcw-color-hover);
  background: #fafafa;
}

/* Responsive design */
@media (max-width: 480px) {
  #floating-contact-widget-box {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    max-height: min(550px, calc(100vh - 100px));
  }

  #floating-contact-widget-btn {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .floating-contact-widget-form-fields {
    padding: 20px;
    padding-bottom: 0;
  }

  .floating-contact-widget-form-footer {
    padding: 12px 20px 20px 20px;
  }

  #floating-contact-widget-link {
    padding: 12px 20px;
  }

  .floating-contact-widget-header {
    padding: 16px 20px;
    font-size: 16px;
  }
}

/* Very small screens (height) */
@media (max-height: 600px) {
  #floating-contact-widget-box {
    bottom: 80px;
    max-height: min(450px, calc(100vh - 100px));
  }

  .floating-contact-widget-form-fields {
    padding: 16px;
    padding-bottom: 0;
  }

  .floating-contact-widget-form-footer {
    padding: 12px 16px 16px 16px;
  }

  #floating-contact-widget-link {
    padding: 12px 16px;
  }

  .floating-contact-widget-body label {
    margin-top: 10px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  #floating-contact-widget-btn,
  #floating-contact-widget-box,
  .floating-contact-widget-body input,
  .floating-contact-widget-body textarea,
  .floating-contact-widget-body button {
    transition: none;
    animation: none;
  }
}
