/* ==========================================
   FLOWPAST CONTACT WIDGET
   Desktop: floating bottom-right card
   Mobile:  bottom bar + fullscreen overlay
   ========================================== */

/* ---- RESET WPFORMS INSIDE WIDGET ---- */
.fcw-card-body .wpforms-container,
.fcw-overlay-body .wpforms-container {
  margin: 0 !important;
  padding: 0 !important;
}
.fcw-card-body .wpforms-form .wpforms-field,
.fcw-overlay-body .wpforms-form .wpforms-field {
  margin-bottom: 12px !important;
  padding: 0 !important;
}
.fcw-card-body .wpforms-form input[type="text"],
.fcw-card-body .wpforms-form input[type="email"],
.fcw-card-body .wpforms-form textarea,
.fcw-overlay-body .wpforms-form input[type="text"],
.fcw-overlay-body .wpforms-form input[type="email"],
.fcw-overlay-body .wpforms-form textarea {
  font-size: 14px !important;
  padding: 10px 12px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.fcw-card-body .wpforms-form textarea,
.fcw-overlay-body .wpforms-form textarea {
  min-height: 70px !important;
  resize: vertical !important;
}
.fcw-card-body .wpforms-form button[type="submit"],
.fcw-overlay-body .wpforms-form button[type="submit"] {
  background: var(--fcw-accent, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: background 0.2s !important;
}
.fcw-card-body .wpforms-form button[type="submit"]:hover,
.fcw-overlay-body .wpforms-form button[type="submit"]:hover {
  background: #1d4ed8 !important;
}

/* ---- CLOSE BUTTON (shared) ---- */
.fcw-x {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.fcw-x:hover {
  opacity: 1;
}

/* ==========================================
   DESKTOP — floating card bottom-right
   ========================================== */
.fcw-desktop {
  display: none;
  right: 80px !important;
}

@media (min-width: 769px) {
  .fcw-desktop {
    display: block;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  /* Collapsed tab */
  .fcw-tab {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--fcw-brand, #0f172a);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition:
      transform 0.2s,
      box-shadow 0.2s;
  }
  .fcw-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  }
  .fcw-tab svg {
    flex-shrink: 0;
  }
  .fcw-tab.is-visible {
    display: flex;
  }

  /* Expanded card */
  .fcw-card {
    display: none;
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: fcw-slide-up 0.3s ease-out;
  }
  .fcw-card.is-visible {
    display: block;
  }

  @keyframes fcw-slide-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .fcw-card-header {
    background: var(--fcw-brand, #0f172a);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .fcw-card-title {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .fcw-card-sub {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.4;
  }
  .fcw-card-body {
    padding: 20px;
    max-height: 380px;
    overflow-y: auto;
  }
}

/* ==========================================
   MOBILE — bottom bar + fullscreen overlay
   ========================================== */
.fcw-mobile {
  display: none;
}

@media (max-width: 768px) {
  .fcw-mobile {
    display: block;
    position: fixed;
    z-index: 99999;
    font-family:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }

  /* Bottom bar */
  .fcw-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--fcw-brand, #0f172a);
    color: #fff;
    padding: 12px 16px;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    animation: fcw-slide-bar 0.3s ease-out;
  }
  .fcw-bar.is-visible {
    display: flex;
  }

  @keyframes fcw-slide-bar {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .fcw-bar-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
  }
  .fcw-bar-btn {
    background: var(--fcw-accent, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .fcw-bar-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.7;
    line-height: 1;
  }
  .fcw-bar-x:hover {
    opacity: 1;
  }

  /* Fullscreen overlay */
  .fcw-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 100000;
    overflow-y: auto;
    animation: fcw-fade-in 0.25s ease-out;
  }
  .fcw-overlay.is-visible {
    display: block;
  }

  @keyframes fcw-fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .fcw-overlay-top {
    background: var(--fcw-brand, #0f172a);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .fcw-overlay-title {
    font-size: 20px;
    font-weight: 700;
  }
  .fcw-overlay-sub {
    padding: 16px 20px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
  }
  .fcw-overlay-body {
    padding: 16px 20px 40px;
  }
}

.fcw-form-intro {
  font-size: 16px;
  color: #475569;
  line-height: 1.5;
  margin: 10px 0px 16px;
}
.fcw-card-title,
.fcw-overlay-title {
  font-size: 24px !important;
}

.fcw-card-header {
  padding: 14px 20px !important;
}
.fcw-card-body {
  padding: 14px 20px !important;
  max-height: none !important;
  overflow-y: visible !important;
}
.fcw-card-body .wpforms-form button[type="submit"],
.fcw-overlay-body .wpforms-form button[type="submit"] {
  background: var(--fcw-brand, #059669) !important;
}
.fcw-card-body .wpforms-form button[type="submit"]:hover,
.fcw-overlay-body .wpforms-form button[type="submit"]:hover {
  background: #047857 !important;
}
