/* ============================================================================
   WaCta Suite - Complete Design System CSS
   Unifies all widget types, popups, forms, and launchers under one system
   ========================================================================= */

/* =============================================================================
   FONT FACES - Load Inter family locally
   ========================================================================= */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-extrabold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* =============================================================================
   CSS RESET - Normalize all elements
   ========================================================================= */
#wacta-suite-root,
#wacta-suite-root *,
#wacta-suite-root *::before,
#wacta-suite-root *::after,
.wacta-inline-trigger,
.wacta-inline-trigger::before,
.wacta-inline-trigger::after {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

/* Scroll lock - applied to html/body when panel is open */
html.wacta-lock-scroll,
body.wacta-lock-scroll {
  overflow: hidden !important;
}

#wacta-suite-root {
  position: relative;
  z-index: 999999;
}

/* =============================================================================
   DESIGN TOKENS - CSS Custom Properties on shell
   ========================================================================= */
#wacta-suite-root .wacta-shell {
  --wacta-primary: #25d366;
  --wacta-secondary: #075e54;
  --wacta-accent: #0ea5e9;
  --wacta-text: #ffffff;
  --wacta-radius: 18px;
  --wacta-size: 60px;
  --wacta-font: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  position: fixed;
  bottom: 20px;
  font-family: var(--wacta-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#wacta-suite-root .wacta-shell.is-right {
  right: 20px;
}

#wacta-suite-root .wacta-shell.is-left {
  left: 20px;
}

#wacta-suite-root .wacta-shell.is-scroll-hidden .wacta-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(80px);
}

/* =============================================================================
   OVERLAY - Backdrop for panel and popups
   ========================================================================= */
#wacta-suite-root .wacta-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 999998;
}

#wacta-suite-root .wacta-shell.is-open .wacta-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* =============================================================================
   LAUNCHER - The floating button (pill or circle)
   ========================================================================= */
#wacta-suite-root .wacta-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: var(--wacta-size);
  min-width: var(--wacta-size);
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wacta-primary), #19b955);
  color: var(--wacta-text);
  cursor: pointer;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--wacta-font);
  font-size: 14px;
  font-weight: 700;
  z-index: 3;
}

#wacta-suite-root .wacta-launcher:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}

#wacta-suite-root .wacta-launcher:active {
  transform: scale(0.96);
}

#wacta-suite-root .wacta-launcher.is-pill {
  padding: 0 20px;
}

#wacta-suite-root .wacta-launcher.is-circle {
  width: var(--wacta-size);
  height: var(--wacta-size);
  padding: 0;
}

/* Launcher Icon */
#wacta-suite-root .wacta-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#wacta-suite-root .wacta-launcher-icon svg,
#wacta-suite-root .wacta-panel-avatar svg,
#wacta-suite-root .wacta-direct-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Launcher Label (for pill style) */
#wacta-suite-root .wacta-launcher-label {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* Notification Pulse Dot */
#wacta-suite-root .wacta-launcher-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--wacta-text);
  border-radius: 50%;
  background: #ff4444;
  animation: wacta-pulse 2s infinite;
}

@keyframes wacta-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* =============================================================================
   PANEL - Main widget container
   ========================================================================= */
#wacta-suite-root .wacta-panel {
  position: fixed;
  z-index: 4;
  overflow: hidden;
  background: #ffffff;
  color: #333;
  border-radius: var(--wacta-radius);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

/* Regular panel (form/redirect) positioning */
#wacta-suite-root .wacta-shell.is-right .wacta-panel:not(.is-popup) {
  right: 20px;
  bottom: 92px;
  width: min(400px, calc(100vw - 32px));
}

#wacta-suite-root .wacta-shell.is-left .wacta-panel:not(.is-popup) {
  left: 20px;
  bottom: 92px;
  width: min(400px, calc(100vw - 32px));
}

/* Chat panel - wider height */
#wacta-suite-root .wacta-panel.is-chat {
  bottom: 92px;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, 82vh);
  background: #e5ddd5;
}

/* Popup modal - centered */
#wacta-suite-root .wacta-panel.is-popup {
  top: 50%;
  left: 50%;
  width: min(920px, calc(100vw - 28px));
  max-height: min(90vh, 90dvh);
  display: flex;
  flex-direction: column;
}

/* Panel open state */
#wacta-suite-root .wacta-shell.is-open .wacta-panel {
  opacity: 1;
  pointer-events: auto;
}

#wacta-suite-root .wacta-shell.is-open .wacta-panel:not(.is-popup) {
  transform: translateY(0) scale(1);
}

#wacta-suite-root .wacta-shell.is-open .wacta-panel.is-popup {
  transform: translate(-50%, -50%) scale(1);
}

/* Default closed state transforms */
#wacta-suite-root .wacta-panel:not(.is-popup) {
  transform: translateY(12px) scale(0.97);
}

#wacta-suite-root .wacta-panel.is-popup {
  transform: translate(-50%, -50%) scale(0.96);
}

/* Panel Header - Green gradient */
#wacta-suite-root .wacta-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, var(--wacta-secondary), var(--wacta-primary));
  color: var(--wacta-text);
  position: relative;
  flex-shrink: 0;
}

#wacta-suite-root .wacta-panel.is-chat .wacta-panel-header {
  padding-right: 60px;
}

/* Panel Avatar - WhatsApp icon in header */
#wacta-suite-root .wacta-panel-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* Panel Head Copy - Title and subtitle */
#wacta-suite-root .wacta-panel-headcopy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#wacta-suite-root .wacta-panel-headcopy h2,
#wacta-suite-root .wacta-panel-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--wacta-text);
  margin: 0;
  line-height: 1.2;
}

#wacta-suite-root .wacta-panel-headcopy p,
#wacta-suite-root .wacta-panel-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.3;
}

#wacta-suite-root .wacta-panel-agent {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

/* Close Button */
#wacta-suite-root .wacta-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--wacta-text);
  font-size: 20px;
  line-height: 1;
  z-index: 5;
}

#wacta-suite-root .wacta-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

#wacta-suite-root .wacta-close:active {
  transform: scale(0.9);
}

/* Panel Body - Content area */
#wacta-suite-root .wacta-panel-body {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

#wacta-suite-root .wacta-panel.is-popup .wacta-panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: min(72vh, 72dvh);
}

/* Scrollbar styling */
#wacta-suite-root .wacta-panel-body::-webkit-scrollbar {
  width: 6px;
}

#wacta-suite-root .wacta-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

#wacta-suite-root .wacta-panel-body::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

#wacta-suite-root .wacta-panel-body::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* =============================================================================
   POPUP PANEL - Form popup with two-column layout
   ========================================================================= */

/* Left column - Intro section */
#wacta-suite-root .wacta-panel-intro {
  display: none;
}

#wacta-suite-root .wacta-panel.is-popup .wacta-panel-intro {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--wacta-secondary), var(--wacta-primary));
  color: var(--wacta-text);
  padding: 30px 24px;
  justify-content: flex-start;
  gap: 20px;
}

#wacta-suite-root .wacta-panel-media {
  position: relative;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  background: #f0f0f0;
}

#wacta-suite-root .wacta-panel-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#wacta-suite-root .wacta-panel-intro-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#wacta-suite-root .wacta-panel-intro-copy h3,
#wacta-suite-root .wacta-panel-intro h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--wacta-text);
}

#wacta-suite-root .wacta-panel-intro-copy p,
#wacta-suite-root .wacta-panel-intro p {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

#wacta-suite-root .wacta-panel-intro-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Right column - Form area */
#wacta-suite-root .wacta-panel.is-popup .wacta-panel-body > div:last-child,
#wacta-suite-root .wacta-panel.is-popup .wacta-form,
#wacta-suite-root .wacta-panel.is-popup .wacta-chat,
#wacta-suite-root .wacta-panel.is-popup .wacta-direct-card {
  min-height: 100%;
  overflow-y: auto;
  padding: 30px 24px;
}

/* =============================================================================
   FORM COMPONENTS
   ========================================================================= */
#wacta-suite-root .wacta-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 20px;
}

/* Form Field Group */
#wacta-suite-root .wacta-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#wacta-suite-root .wacta-field label,
#wacta-suite-root .wacta-field span {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  display: block;
  text-transform: capitalize;
}

#wacta-suite-root .wacta-field input,
#wacta-suite-root .wacta-field textarea,
#wacta-suite-root .wacta-chat-input {
  font-family: var(--wacta-font);
  font-size: 14px;
  padding: 14px 16px;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  transition: all 0.2s ease;
  width: 100%;
  background: #fff;
  color: #333;
}

#wacta-suite-root .wacta-field input::placeholder,
#wacta-suite-root .wacta-field textarea::placeholder,
#wacta-suite-root .wacta-chat-input::placeholder {
  color: #999;
}

#wacta-suite-root .wacta-field input:focus,
#wacta-suite-root .wacta-field textarea:focus,
#wacta-suite-root .wacta-chat-input:focus {
  outline: 3px solid #00b2ff;
  outline-offset: 2px;
  border-color: var(--wacta-primary);
}

#wacta-suite-root .wacta-field textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

/* Error State */
#wacta-suite-root .wacta-field.has-error input,
#wacta-suite-root .wacta-field.has-error textarea {
  border-color: #ff4444;
  background: #fff5f5;
}

#wacta-suite-root .wacta-field-error {
  font-size: 12px;
  color: #ff4444;
  margin-top: 4px;
  display: none;
}

#wacta-suite-root .wacta-field.has-error .wacta-field-error {
  display: block;
}

/* Honeypot hidden field */
#wacta-suite-root .wacta-honeypot {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
}

/* =============================================================================
   BUTTONS
   ========================================================================= */
#wacta-suite-root .wacta-submit,
#wacta-suite-root .wacta-skip {
  font-family: var(--wacta-font);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#wacta-suite-root .wacta-submit {
  background: linear-gradient(135deg, var(--wacta-primary), #19b955);
  color: var(--wacta-text);
  width: 100%;
}

#wacta-suite-root .wacta-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

#wacta-suite-root .wacta-submit:active {
  transform: translateY(0);
}

#wacta-suite-root .wacta-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#wacta-suite-root .wacta-skip {
  background: transparent;
  color: var(--wacta-primary);
  border: 1.5px solid var(--wacta-primary);
  width: 100%;
}

#wacta-suite-root .wacta-skip:hover {
  background: rgba(37, 211, 102, 0.05);
}

#wacta-suite-root .wacta-skip:active {
  background: rgba(37, 211, 102, 0.1);
}

/* =============================================================================
   TEXT & CREDIT
   ========================================================================= */
#wacta-suite-root .wacta-privacy,
#wacta-suite-root .wacta-credit,
#wacta-suite-root .wacta-feedback,
#wacta-suite-root .wacta-chat-empty {
  font-size: 11px;
  color: #999;
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

#wacta-suite-root .wacta-privacy a,
#wacta-suite-root .wacta-credit a {
  color: var(--wacta-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

#wacta-suite-root .wacta-privacy a:hover,
#wacta-suite-root .wacta-credit a:hover {
  color: var(--wacta-secondary);
  text-decoration: underline;
}

/* =============================================================================
   FEEDBACK MESSAGES
   ========================================================================= */
#wacta-suite-root .wacta-feedback {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  animation: slide-in 0.3s ease;
}

#wacta-suite-root .wacta-feedback.is-visible {
  display: block;
}

#wacta-suite-root .wacta-feedback.is-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

#wacta-suite-root .wacta-feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================================
   CHAT WIDGET
   ========================================================================= */
#wacta-suite-root .wacta-chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 16px;
}

/* Chat Feed - Messages container with WhatsApp wallpaper */
#wacta-suite-root .wacta-chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background-color: #e5ddd5;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 0;
}

#wacta-suite-root .wacta-chat-feed::-webkit-scrollbar {
  width: 6px;
}

#wacta-suite-root .wacta-chat-feed::-webkit-scrollbar-track {
  background: transparent;
}

#wacta-suite-root .wacta-chat-feed::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Empty state */
#wacta-suite-root .wacta-chat-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px;
}

/* Chat Row */
#wacta-suite-root .wacta-chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#wacta-suite-root .wacta-chat-row.is-user {
  flex-direction: row-reverse;
}

#wacta-suite-root .wacta-chat-row.is-assistant {
  flex-direction: row;
}

/* Chat Bubble */
#wacta-suite-root .wacta-chat-bubble {
  max-width: 70%;
  padding: 12px 14px;
  border-radius: 14px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#wacta-suite-root .wacta-chat-row.is-user .wacta-chat-bubble {
  background: var(--wacta-primary);
  color: var(--wacta-text);
  border-bottom-right-radius: 4px;
}

#wacta-suite-root .wacta-chat-row.is-assistant .wacta-chat-bubble {
  background: #ffffff;
  color: #333;
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
#wacta-suite-root .wacta-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: #ffffff;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#wacta-suite-root .wacta-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: typing-bounce 1.4s infinite;
}

#wacta-suite-root .wacta-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

#wacta-suite-root .wacta-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Chat Composer - Input area */
#wacta-suite-root .wacta-chat-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
  background: transparent;
  border-radius: 0;
}

/* Chat Actions - Send/Skip buttons */
#wacta-suite-root .wacta-chat-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

#wacta-suite-root .wacta-chat-actions button {
  flex: 1;
  font-family: var(--wacta-font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#wacta-suite-root .wacta-chat-actions .wacta-submit,
#wacta-suite-root .wacta-chat-actions button[type="submit"] {
  background: linear-gradient(135deg, var(--wacta-primary), #19b955);
  color: var(--wacta-text);
  flex: 2;
}

#wacta-suite-root .wacta-chat-actions .wacta-skip {
  background: transparent;
  color: var(--wacta-primary);
  border: 1.5px solid var(--wacta-primary);
  padding: 12px 16px;
}

/* Chat Summary - Card before handoff */
#wacta-suite-root .wacta-chat-summary {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#wacta-suite-root .wacta-chat-summary-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

#wacta-suite-root .wacta-chat-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#wacta-suite-root .wacta-chat-summary-item strong {
  font-weight: 600;
  color: #333;
  font-size: 12px;
}

#wacta-suite-root .wacta-chat-summary-item span {
  color: #666;
  font-size: 12px;
  word-break: break-word;
}

/* =============================================================================
   REDIRECT CARD
   ========================================================================= */
#wacta-suite-root .wacta-direct-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 30px 20px;
}

#wacta-suite-root .wacta-direct-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--wacta-primary), #19b955);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.25);
}

#wacta-suite-root .wacta-direct-card h3,
#wacta-suite-root .wacta-direct-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.3;
}

#wacta-suite-root .wacta-direct-card p {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

#wacta-suite-root .wacta-direct-card .wacta-cta,
#wacta-suite-root .wacta-direct-card button {
  background: linear-gradient(135deg, var(--wacta-primary), #19b955);
  color: var(--wacta-text);
  width: 100%;
  margin-top: 12px;
  font-family: var(--wacta-font);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#wacta-suite-root .wacta-direct-card .wacta-cta:hover,
#wacta-suite-root .wacta-direct-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

/* =============================================================================
   POPUP AUTO - Separate modal component (wacta-auto prefix)
   ========================================================================= */
#wacta-auto-root {
  position: relative;
  z-index: 9999997;
}

.wacta-auto-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999998;
}

.wacta-auto-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.wacta-auto-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999999;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.26);
  overflow: hidden;
  width: 90vw;
  max-width: 900px;
  max-height: 80vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.wacta-auto-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.wacta-auto-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  color: #333;
  font-size: 24px;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

.wacta-auto-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.wacta-auto-close:active {
  transform: scale(0.9);
}

/* Left Column - Media */
.wacta-auto-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
  background: #f0f0f0;
}

.wacta-auto-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Gradient overlay on image */
.wacta-auto-media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Text over image */
.wacta-auto-media-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 24px;
  color: #ffffff;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wacta-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #25d366;
  color: #ffffff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.wacta-auto-media-copy h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.wacta-auto-media-copy p {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}

/* Right Column - Form Area */
.wacta-auto-form-area {
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  overflow-y: auto;
  background: #ffffff;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.wacta-auto-form-area::-webkit-scrollbar {
  width: 6px;
}

.wacta-auto-form-area::-webkit-scrollbar-track {
  background: transparent;
}

.wacta-auto-form-area::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

.wacta-auto-form-area::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Form Head */
.wacta-auto-form-head {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wacta-auto-form-head h3 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.2;
}

.wacta-auto-form-head p {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Form Grid */
.wacta-auto-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

/* Form Group - Field wrapper */
.wacta-auto-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wacta-auto-group label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  display: block;
}

.wacta-auto-group input,
.wacta-auto-group textarea {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  transition: all 0.2s ease;
  width: 100%;
  background: #fff;
  color: #333;
}

.wacta-auto-group input::placeholder,
.wacta-auto-group textarea::placeholder {
  color: #999;
}

.wacta-auto-group input:focus,
.wacta-auto-group textarea:focus {
  outline: 3px solid #00b2ff;
  outline-offset: 2px;
  border-color: #25d366;
}

.wacta-auto-group textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
}

/* Error State */
.wacta-auto-group.has-error input,
.wacta-auto-group.has-error textarea {
  border-color: #ff4444;
  background: #fff5f5;
}

.wacta-auto-error {
  font-size: 12px;
  color: #ff4444;
  display: none;
  margin-top: 4px;
}

.wacta-auto-group.has-error .wacta-auto-error {
  display: block;
}

/* Submit Button */
.wacta-auto-submit {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  background: linear-gradient(135deg, #25d366, #19b955);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 8px;
}

.wacta-auto-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

.wacta-auto-submit:active {
  transform: translateY(0);
}

.wacta-auto-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Credit Link */
.wacta-auto-credit {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.wacta-auto-credit a {
  color: #25d366;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wacta-auto-credit a:hover {
  color: #075e54;
  text-decoration: underline;
}

/* Scroll lock */
.wacta-auto-no-scroll {
  overflow: hidden !important;
}

/* =============================================================================
   INLINE TRIGGERS
   ========================================================================= */
.wacta-inline-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #25d366, #19b955);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.wacta-inline-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

.wacta-inline-trigger:active {
  transform: translateY(0);
}

/* =============================================================================
   OUT-OF-HOURS BANNER
   ========================================================================= */
#wacta-suite-root .wacta-ooh-banner {
  background: #fbbf24;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#wacta-suite-root .wacta-ooh-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ========================================================================= */

/* Tablet - Auto popup collapses to single column */
@media (max-width: 840px) {
  .wacta-auto-popup {
    grid-template-columns: 1fr;
    max-width: 500px;
    max-height: 90vh;
  }

  .wacta-auto-media {
    display: none;
  }

  .wacta-auto-form-area {
    padding: 32px 24px;
  }
}

/* Tablet - Panel popup collapses to single column */
@media (max-width: 920px) {
  #wacta-suite-root .wacta-panel.is-popup {
    width: min(520px, calc(100vw - 20px));
  }

  #wacta-suite-root .wacta-panel.is-popup .wacta-panel-body {
    grid-template-columns: 1fr;
    max-height: min(86vh, 86dvh);
  }

  #wacta-suite-root .wacta-panel.is-popup .wacta-panel-intro {
    display: none;
  }
}

/* Mobile - Smaller spacing and adjustments */
@media (max-width: 640px) {
  #wacta-suite-root .wacta-shell {
    bottom: 16px;
  }

  #wacta-suite-root .wacta-shell.is-right {
    right: 16px;
  }

  #wacta-suite-root .wacta-shell.is-left {
    left: 16px;
  }

  #wacta-suite-root .wacta-panel:not(.is-popup),
  #wacta-suite-root .wacta-panel.is-chat {
    width: min(100vw - 24px, 380px);
    bottom: 86px;
  }

  #wacta-suite-root .wacta-panel.is-popup {
    width: calc(100vw - 16px);
  }

  #wacta-suite-root .wacta-panel-header {
    padding-right: 54px;
  }

  #wacta-suite-root .wacta-launcher.is-pill {
    padding: 0 18px;
  }

  .wacta-auto-popup {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 40px);
  }

  .wacta-auto-form-area {
    padding: 28px 20px;
  }

  .wacta-auto-media {
    min-height: 250px;
  }
}

/* Extra small - Mobile adjustments */
@media (max-width: 480px) {
  #wacta-suite-root .wacta-launcher {
    --wacta-size: 56px;
  }

  #wacta-suite-root .wacta-panel {
    width: calc(100vw - 16px);
  }

  #wacta-suite-root .wacta-field input,
  #wacta-suite-root .wacta-field textarea,
  .wacta-auto-group input,
  .wacta-auto-group textarea {
    font-size: 16px;
  }
}

/* =============================================================================
   PRINT STYLES
   ========================================================================= */
@media print {
  #wacta-suite-root,
  #wacta-auto-root,
  .wacta-inline-trigger {
    display: none;
  }
}
