/* Global settings for widget size */
:root {
  --widget-size: 45px; /* Increased from 30px but still smaller than original 60px */
}

/* Base visibility states */
.widget-container {
  position: fixed;
  z-index: 999998;
  bottom: var(--widget-offset, 20px);
  right: var(--widget-offset, 20px);
  display: flex;
  align-items: center;
  gap: 4px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s ease, opacity 0.3s ease;
}

/* Widget Type-Specific Styles */

/* Banner Widget */
.widget-type-banner {
  position: fixed;
  z-index: 999998;
  left: 0;
  right: 0;
  width: 100%;
  padding: 8px 20px;
  background-color: var(--widget-color, #6366f1);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  gap: 8px;
  visibility: hidden; /* Start hidden */
  height: 0; /* No height when hidden */
  overflow: hidden; /* Hide content when collapsed */
  padding: 0; /* No padding when hidden */
}

/* Position-specific settings for banners */
.widget-type-banner[data-position="top"] {
  top: 0;
  bottom: auto;
  transform: translateY(-100%); /* Start offscreen above the viewport */
}

.widget-type-banner[data-position="bottom"] {
  top: auto;
  bottom: 0;
  transform: translateY(100%); /* Start offscreen below the viewport */
  height: auto; /* Use auto height like the top banner */
  max-height: none; /* Allow banner to expand as needed based on content */
}

/* Special styling for banners in preview mode to not overlap with nav */
.preview-mode .widget-type-banner[data-position="top"] {
  top: 60px; /* Add space for the application nav when positioned at top */
}

/* For bottom banners in preview mode, ensure they stay at the bottom */
.preview-mode .widget-type-banner[data-position="bottom"] {
  bottom: 0; /* Keep at bottom of viewport */
  top: auto; /* Cancel any top positioning */
}

.widget-initialized.widget-type-banner {
  transform: translateY(0) !important; /* Move into view */
  visibility: visible !important; /* Show when initialized */
  height: auto !important; /* Restore height */
  padding: 8px 20px !important; /* Restore padding */
  overflow: visible !important; /* Show content */
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.widget-type-banner .banner-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 2px;
  min-width: 0; /* Allows proper text wrapping and prevents overflow */
  width: 100%; /* Use all available width */
}

.widget-type-banner .banner-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  white-space: nowrap; /* Prevent title from wrapping to new line */
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis if title is too long */
}

.widget-type-banner .banner-description {
  font-size: 14px;
  margin: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100ch; /* Allows for approximately 100 characters per line */
  line-height: 1.3;
  text-wrap: balance; /* Ensures text is evenly distributed across lines */
}

.widget-type-banner .banner-button {
  padding: 8px 14px;
  background: white;
  color: var(--widget-color, #6366f1);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.widget-type-banner .banner-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Banner email form */
.widget-type-banner .banner-email-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-type-banner .banner-email-input {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
  outline: none;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.widget-type-banner .banner-email-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.widget-type-banner .banner-email-input:focus {
  border-color: white;
  background-color: rgba(255, 255, 255, 0.3);
}

.widget-type-banner .banner-email-submit {
  padding: 8px 14px;
  background: white;
  color: var(--widget-color, #6366f1);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.widget-type-banner .banner-email-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.widget-type-banner .banner-replace {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.widget-type-banner .banner-replace:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.widget-type-banner .banner-close {
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
}

/* Toast Widget */
.widget-type-toast {
  position: fixed;
  z-index: 999998;
  bottom: var(--widget-offset, 20px);
  right: var(--widget-offset, 20px);
  width: 300px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  gap: 12px;
  border-left: 4px solid var(--widget-color, #6366f1);
}

.widget-initialized.widget-type-toast {
  opacity: 1;
  transform: translateY(0);
}

.widget-type-toast .toast-content {
  flex: 1;
}

.widget-type-toast .toast-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.widget-type-toast .toast-description {
  font-size: 14px;
  margin: 0 0 12px 0;
  color: #4b5563;
  line-height: 1.4;
}

.widget-type-toast .toast-button {
  display: inline-block;
  background: var(--widget-color, #6366f1);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.widget-type-toast .toast-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Toast email form */
.widget-type-toast .toast-email-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.widget-type-toast .toast-email-input {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: all 0.2s ease;
}

.widget-type-toast .toast-email-input:focus {
  border-color: var(--widget-color, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.widget-type-toast .toast-email-submit {
  padding: 8px 14px;
  background: var(--widget-color, #6366f1);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.widget-type-toast .toast-email-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.widget-type-toast .toast-replace {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.05);
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.widget-type-toast .toast-replace:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.widget-type-toast .toast-close {
  align-self: flex-start;
  cursor: pointer;
  color: #9ca3af;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.widget-type-toast .toast-close:hover {
  background: rgba(0, 0, 0, 0.15);
  color: #4b5563;
}

/* Rive Widget */
.widget-type-rive {
  position: fixed;
  z-index: 999998;
  bottom: var(--widget-offset, 20px);
  /* No size constraints - let Rive handle sizing */
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget-initialized.widget-type-rive {
  opacity: 1;
  transform: scale(1);
}

.widget-type-rive .rive-canvas {
  display: block;
  /* No size constraints - let Rive determine canvas size */
}

/* Remove overlay and CTA button styles - handled by Rive animation */

.widget-type-rive .rive-close {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
}

.widget-type-rive .rive-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Special handling for auth page widget container */
#auth-widget-container .widget-container {
  position: relative;
  bottom: auto;
  right: auto;
  visibility: visible;
  opacity: 1;
}

/* Update widget positioning for both sides */
.widget-position-bottom-right {
  bottom: var(--widget-offset, 20px);
  right: var(--widget-offset, 20px);
  flex-direction: row;
}

.widget-position-bottom-left {
  bottom: var(--widget-offset, 20px);
  left: var(--widget-offset, 20px);
  right: auto;
  flex-direction: row-reverse;
}

.widget-position-top-right {
  top: var(--widget-offset, 20px);
  right: var(--widget-offset, 20px);
}

.widget-position-top-left {
  top: var(--widget-offset, 20px);
  left: var(--widget-offset, 20px);
  right: auto;
}

.blob-container {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
}

/* Hide title label when overlay is visible */
.widget-overlay--visible ~ .widget-container .widget-title-label {
  display: none !important;
}

/* Remove hover transform animation */
.blob-container:hover {
  transform: none;
}

.widget-title-label {
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
  white-space: nowrap;
  max-width: 200px;
  overflow: visible; /* Change to visible to prevent cutting off the close button */
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
  cursor: pointer;
  position: relative;
}

/* Default styling for right-aligned widgets */
.widget-position-bottom-right .widget-title-label {
  margin-left: 6px; /* Reduced space further to make label closer to blob */
  margin-right: 0;
}

/* Styling for left-aligned widgets */
.widget-position-bottom-left .widget-title-label {
  margin-left: 0;
  margin-right: 6px; /* Reduced space further to make label closer to blob */
}

.widget-title-close {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0; /* Hidden by default on desktop */
  transition: opacity 0.2s ease;
  z-index: 10;
  color: white;
}

/* Position for right-aligned widgets */
.widget-position-bottom-right .widget-title-close {
  left: -18px;
  right: auto;
}

/* Position for left-aligned widgets */
.widget-position-bottom-left .widget-title-close {
  left: auto;
  right: -18px;
}

.widget-title-label:hover .widget-title-close {
  opacity: 1;
}

.widget-title-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.widget-overlay {
  position: fixed;
  inset: 0; /* Cover the entire screen to detect clicks outside */
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: calc(var(--widget-offset, 20px) + var(--widget-size, 60px) + 16px) var(--widget-offset, 20px) var(--widget-offset, 20px);
  background: transparent;
  z-index: 999999;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.widget-overlay--visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.1); /* Slight overlay for better UX when clicking outside */
}

.widget-overlay .widget-content {
  transform: translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  width: 100%;
  max-width: 400px;
  margin-left: auto; /* Position at the right side by default */
}

.widget-overlay--visible .widget-content {
  transform: translateY(0);
}

/* Update widget positioning for both sides */
.widget-position-bottom-right .blob-container {
  flex-direction: row;
}

.widget-position-bottom-left .blob-container {
  flex-direction: row-reverse;
}

.widget-blob {
  width: var(--widget-size, 60px);
  height: var(--widget-size, 60px);
  transition: none;
  padding: 5px; /* Reduced from 10px */
  box-sizing: content-box;
  margin: -5px; /* Reduced from -10px */
}

/* Remove hover animations */
.widget-blob:hover {
  transform: none;
  animation-play-state: running;
}

.widget-blob:active {
  transform: none;
}

.widget-blob svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.widget-blob .blob-path {
  fill: var(--widget-color, #6366f1);
  /* Animation removed as per request */
  transform-origin: center;
}

/* Remove hover opacity animation */
.blob-container:hover .widget-title-label {
  opacity: 0.9;
}

/* Position overlay content on the left side when widget is on the left */
.widget-position-bottom-left ~ .widget-overlay .widget-content {
  margin-left: 0;
  margin-right: auto;
}
.widget-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
  max-height: 80vh;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Mobile full-page content styling */
@media (max-width: 640px) {
  .widget-content {
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem;
    max-height: none;
    min-height: 100vh;
    flex: 1;
  }
}

/* Email form styles */
.widget-email-form {
  display: flex;
  flex-direction: column;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

.widget-email-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.widget-email-input {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.widget-email-input:focus {
  outline: none;
  border-color: var(--widget-color, #6366f1);
}

.widget-email-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  display: none;
}

.widget-email-submit {
  padding: 0.625rem;
  border: none;
  border-radius: 0.375rem;
  color: white;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  transition: opacity 0.2s ease;
}

.widget-email-submit:hover {
  opacity: 0.9;
}

.widget-email-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.widget-card {
  background: #f8fafc;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem !important;
  border: 1px solid #e2e8f0;
}

.widget-card h3 {
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.widget-card .space-y-1 {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.widget-card p {
  color: #475569;
  font-size: 0.875rem;
  margin: 0;
}

.widget-card .font-medium {
  font-weight: 500;
  color: #1e293b;
}

.widget-content.has-form {
  padding-top: 3rem !important;
}

.widget-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1rem;
  padding: 0.5rem;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s ease;
  line-height: 0;
  z-index: 2;
  border-radius: 50%;
}

.widget-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #64748b;
  transition: color 0.2s ease;
  z-index: 2;
}

.widget-close:hover,
.widget-back:hover {
  color: #1e293b;
}

.widget-image {
  margin: 0 0 1rem 0;
  overflow: hidden;
  border-radius: 1rem;
}

.widget-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.widget-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  padding-right: 2rem;
  color: #1e293b;
  text-align: left;
}

.widget-body {
  color: #4b5563;
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
  font-size: 1.125rem;
}

.widget-body p {
  margin: 0 0 1.25rem;
}

#payment-form {
  overflow-y: auto;
  flex: 1;
  padding-right: 0.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#payment-form > div {
  margin-bottom: 0.25rem;
}

#payment-form label {
  display: flex;
  align-items: center;
  margin-bottom: 0.125rem;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: left;
}

#payment-form input,
#payment-form textarea {
  width: 100%;
  padding: 0.375rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
  background-color: #f9fafb;
}

#payment-form input:focus,
#payment-form textarea:focus {
  outline: none;
  border-color: #6366f1;
  background-color: white;
}

#payment-form textarea {
  min-height: 60px;
  resize: vertical;
}

#payment-element {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background-color: #f9fafb;
}

.payment-error {
  display: none;
  color: #ef4444;
  margin-bottom: 0.75rem;
  padding: 0.625rem;
  border-radius: 0.5rem;
  background-color: #fee2e2;
  font-size: 0.875rem;
}

.error-message {
  color: #ef4444;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.widget-cta,
.widget-replace-offer,
#payment-form button[type="submit"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

.widget-cta {
  display: inline-block;
  color: white;
  text-decoration: none;
}

.widget-cta:hover {
  opacity: 0.9;
}

.widget-replace-offer {
  cursor: pointer;
  background: transparent;
  margin-top: 0.75rem;
}

.widget-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.widget-link-button {
  display: block;
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.widget-link-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.widget-replace-offer:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

#payment-form button[type="submit"] {
  color: white;
  border: none;
  cursor: pointer;
  margin-top: 0.75rem;
}

#payment-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  /* Always show close button on mobile devices */
  .widget-title-close {
    opacity: 1; /* Always visible on mobile */
    width: 16px; /* 50% smaller than previous 32px */
    height: 16px; /* 50% smaller than previous 32px */
    background: rgba(0, 0, 0, 0.65); /* Slightly darker for better visibility */
    font-size: 12px; /* Proportionally smaller X */
    top: -8px; /* Center the icon on the corner of the blob */
    transform: none; /* Remove vertical centering */
  }
  
  /* Adjust position for right-aligned widgets on mobile - pin to corner */
  .widget-position-bottom-right .widget-title-close {
    left: -8px; /* Center on blob corner */
  }
  
  /* Adjust position for left-aligned widgets on mobile - pin to corner */
  .widget-position-bottom-left .widget-title-close {
    right: -8px; /* Center on blob corner */
  }
  
  /* Also increase the margin space for the label to accommodate larger X button */
  .widget-position-bottom-right .widget-title-label {
    margin-left: 8px;
  }
  
  .widget-position-bottom-left .widget-title-label {
    margin-right: 8px;
  }
  
  /* Mobile overlay styling - full page takeover */
  .widget-overlay {
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }
  
  .widget-position-bottom-left ~ .widget-overlay,
  .widget-position-bottom-right ~ .widget-overlay {
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
  }
  
  .widget-overlay .widget-content {
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-width: none;
    margin: 0;
    border-radius: 0;
    max-height: none;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .widget-overlay--visible .widget-content {
    transform: translateY(0);
  }
  
  /* Improve close button visibility on mobile */
  .widget-close {
    background: rgba(0, 0, 0, 0.8) !important; /* More prominent background */
    top: 0.75rem !important; /* Move closer to corner */
    right: 0.75rem !important; /* Move closer to corner */
    width: 40px !important; /* Larger tap target */
    height: 40px !important; /* Larger tap target */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important; /* Add subtle border for definition */
  }
  
  .widget-close:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
  }
}

.payment-success {
  text-align: left;
  padding: 2rem 0;
}

.checkmark {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #4ade80;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #4ade80;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4ade80;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 30px #4ade80;
  }
}

/* Mobile full-page layout - no internal scroll container */
@media (max-width: 640px) {
  .widget-form-container {
    max-height: none;
    overflow-y: visible;
    padding: 0;
    margin: 0;
  }
}

/* Desktop maintains original scroll behavior */
@media (min-width: 641px) {
  .widget-form-container {
    max-height: calc(90vh - 8rem);
    overflow-y: auto;
    padding: 0 0.25rem;
    margin: 0 -0.25rem;
  }
}

.widget-card.sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-upload-container {
  border: 2px dashed #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.75rem;
  text-align: center;
  transition: border-color 0.2s ease;
  background-color: #f9fafb;
}

.file-upload-container:hover {
  border-color: #6366f1;
}

.file-upload-container input[type="file"] {
  width: 100%;
  cursor: pointer;
}

.file-preview {
  margin-top: 1rem;
  max-width: 100%;
}

.file-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 0.375rem;
}

.upload-progress {
  margin-top: 1rem;
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-bar {
  height: 0.5rem;
  background-color: #6366f1;
  width: 0%;
  transition: width 0.3s ease;
}

.tooltip-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  color: #94a3b8;
  cursor: help;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 70%;
  transform: translateX(-20%);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  white-space: normal;
  min-width: 10rem;
  z-index: 999999;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: none;
}

.tooltip-content::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1e293b;
}

.tooltip-icon:hover .tooltip-content {
  display: block;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(0.95);
  }
}

/* Blob animation keyframes removed as per request to remove the animated blob */

/* Initialization states */
.widget-initialized {
  visibility: visible;
  opacity: 1;
}

/* Hide blob path initially and animate in */
.widget-blob .blob-path {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.widget-initialized .widget-blob .blob-path {
  opacity: 1;
}

/* Ensure smooth transitions for all interactive elements */
.widget-content {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.widget-overlay--visible .widget-content {
  opacity: 1;
  transform: translateY(0);
}